mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-12 11:40:44 +08:00
Merge pull request #478 from LAION-AI/cleanup-web-import-warnings
Fixing most of the eslint warnings in the web code
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
import { Button, useDisclosure } from "@chakra-ui/react";
|
import {
|
||||||
import { Modal, ModalOverlay, ModalContent, ModalHeader, ModalBody, ModalCloseButton } from "@chakra-ui/react";
|
Button,
|
||||||
|
Modal,
|
||||||
|
ModalBody,
|
||||||
|
ModalCloseButton,
|
||||||
|
ModalContent,
|
||||||
|
ModalHeader,
|
||||||
|
ModalOverlay,
|
||||||
|
useDisclosure,
|
||||||
|
} from "@chakra-ui/react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export const CollapsableText = ({ text, maxLength = 220 }) => {
|
export const CollapsableText = ({ text, maxLength = 220 }) => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Box } from "@chakra-ui/react";
|
import { Box } from "@chakra-ui/react";
|
||||||
import { Message } from "./Messages";
|
import { Message } from "src/components/Messages";
|
||||||
|
|
||||||
export const ContextMessages = ({ messages }: { messages: Message[] }) => {
|
export const ContextMessages = ({ messages }: { messages: Message[] }) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ import {
|
|||||||
import { FlagIcon, QuestionMarkCircleIcon } from "@heroicons/react/20/solid";
|
import { FlagIcon, QuestionMarkCircleIcon } from "@heroicons/react/20/solid";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import poster from "src/lib/poster";
|
import poster from "src/lib/poster";
|
||||||
import useSWRMutation from "swr/mutation";
|
|
||||||
import { colors } from "styles/Theme/colors";
|
import { colors } from "styles/Theme/colors";
|
||||||
|
import useSWRMutation from "swr/mutation";
|
||||||
|
|
||||||
export const FlaggableElement = (props) => {
|
export const FlaggableElement = (props) => {
|
||||||
const [isEditing, setIsEditing] = useBoolean();
|
const [isEditing, setIsEditing] = useBoolean();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Box, CircularProgress, Stack, StackDivider, useColorModeValue } from "@chakra-ui/react";
|
import { Stack, StackDivider } from "@chakra-ui/react";
|
||||||
import { MessageTableEntry } from "./MessageTableEntry";
|
import { MessageTableEntry } from "src/components/Messages/MessageTableEntry";
|
||||||
|
|
||||||
export function MessageTable({ messages }) {
|
export function MessageTable({ messages }) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Avatar, Box, HStack, LinkBox, useColorModeValue } from "@chakra-ui/react";
|
import { Avatar, HStack, LinkBox, useColorModeValue } from "@chakra-ui/react";
|
||||||
import { boolean } from "boolean";
|
import { boolean } from "boolean";
|
||||||
import NextLink from "next/link";
|
import NextLink from "next/link";
|
||||||
import { FlaggableElement } from "../FlaggableElement";
|
import { FlaggableElement } from "src/components/FlaggableElement";
|
||||||
|
|
||||||
interface Message {
|
interface Message {
|
||||||
text: string;
|
text: string;
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { Box, CircularProgress, Flex, HStack, StackDivider, Text, TextProps, StackProps } from "@chakra-ui/react";
|
import { Box, CircularProgress, Flex, HStack, StackDivider, StackProps, Text, TextProps } from "@chakra-ui/react";
|
||||||
import { useState } from "react";
|
|
||||||
import useSWR from "swr";
|
|
||||||
|
|
||||||
import fetcher from "src/lib/fetcher";
|
|
||||||
import { MessageTableEntry } from "./MessageTableEntry";
|
|
||||||
import { boolean } from "boolean";
|
import { boolean } from "boolean";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { MessageTableEntry } from "src/components/Messages/MessageTableEntry";
|
||||||
|
import fetcher from "src/lib/fetcher";
|
||||||
|
import useSWR from "swr";
|
||||||
|
|
||||||
const MessageHeaderProps: TextProps = {
|
const MessageHeaderProps: TextProps = {
|
||||||
align: "center",
|
align: "center",
|
||||||
@@ -36,7 +35,7 @@ export function MessageWithChildren(props: MessageWithChildrenProps) {
|
|||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
setMessage(data);
|
setMessage(data);
|
||||||
},
|
},
|
||||||
onError: (err, key, config) => {
|
onError: () => {
|
||||||
setMessage(null);
|
setMessage(null);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -44,7 +43,7 @@ export function MessageWithChildren(props: MessageWithChildrenProps) {
|
|||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
setChildren(data);
|
setChildren(data);
|
||||||
},
|
},
|
||||||
onError: (err, key, config) => {
|
onError: () => {
|
||||||
setChildren(null);
|
setChildren(null);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Box, useColorMode } from "@chakra-ui/react";
|
import { Box, useColorMode } from "@chakra-ui/react";
|
||||||
|
import { MenuButtonOption, SideMenu } from "src/components/SideMenu";
|
||||||
import { colors } from "styles/Theme/colors";
|
import { colors } from "styles/Theme/colors";
|
||||||
import { SideMenu, MenuButtonOption } from "src/components/SideMenu";
|
|
||||||
|
|
||||||
interface SideMenuLayoutProps {
|
interface SideMenuLayoutProps {
|
||||||
menuButtonOptions: MenuButtonOption[];
|
menuButtonOptions: MenuButtonOption[];
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
ModalOverlay,
|
ModalOverlay,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { TaskControls, TaskControlsProps } from "./TaskControls";
|
import { TaskControls, TaskControlsProps } from "src/components/Survey/TaskControls";
|
||||||
|
|
||||||
interface TaskControlsOverridableProps extends TaskControlsProps {
|
interface TaskControlsOverridableProps extends TaskControlsProps {
|
||||||
isValid: boolean;
|
isValid: boolean;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Container } from "./Container";
|
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
import { Container } from "src/components/Container";
|
||||||
|
|
||||||
const Vision = () => {
|
const Vision = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
import Image from "next/image";
|
||||||
|
import { CallToAction } from "src/components/CallToAction";
|
||||||
import { Container } from "src/components/Container";
|
import { Container } from "src/components/Container";
|
||||||
|
import Roadmap from "src/components/Roadmap";
|
||||||
import Services from "src/components/Services";
|
import Services from "src/components/Services";
|
||||||
import Vision from "src/components/Vision";
|
import Vision from "src/components/Vision";
|
||||||
import Roadmap from "src/components/Roadmap";
|
|
||||||
import { CallToAction } from "src/components/CallToAction";
|
|
||||||
import Image from "next/image";
|
|
||||||
|
|
||||||
const AboutPage = () => {
|
const AboutPage = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { getSession } from "next-auth/react";
|
import { getSession } from "next-auth/react";
|
||||||
import prisma from "../../lib/prismadb";
|
import prisma from "src/lib/prismadb";
|
||||||
|
|
||||||
// POST /api/post
|
// POST /api/post
|
||||||
// Required fields in body: title
|
// Required fields in body: title
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
|
|
||||||
import { getDashboardLayout } from "src/components/Layout";
|
|
||||||
import { LeaderboardTable, TaskOption } from "src/components/Dashboard";
|
import { LeaderboardTable, TaskOption } from "src/components/Dashboard";
|
||||||
|
import { getDashboardLayout } from "src/components/Layout";
|
||||||
|
|
||||||
const Dashboard = () => {
|
const Dashboard = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import { Box, Container, Text, useColorModeValue } from "@chakra-ui/react";
|
import { Box, Container, Text, useColorModeValue } from "@chakra-ui/react";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import useSWR from "swr";
|
|
||||||
|
|
||||||
import fetcher from "src/lib/fetcher";
|
|
||||||
import { MessageTableEntry } from "src/components/Messages/MessageTableEntry";
|
|
||||||
import { LoadingScreen } from "src/components/Loading/LoadingScreen";
|
import { LoadingScreen } from "src/components/Loading/LoadingScreen";
|
||||||
|
import { MessageTableEntry } from "src/components/Messages/MessageTableEntry";
|
||||||
import { MessageWithChildren } from "src/components/Messages/MessageWithChildren";
|
import { MessageWithChildren } from "src/components/Messages/MessageWithChildren";
|
||||||
|
import fetcher from "src/lib/fetcher";
|
||||||
|
import useSWR from "swr";
|
||||||
|
|
||||||
const MessageDetail = ({ id }) => {
|
const MessageDetail = ({ id }) => {
|
||||||
const mainBg = useColorModeValue("bg-slate-300", "bg-slate-900");
|
const mainBg = useColorModeValue("bg-slate-300", "bg-slate-900");
|
||||||
@@ -18,7 +16,7 @@ const MessageDetail = ({ id }) => {
|
|||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
setParent(data);
|
setParent(data);
|
||||||
},
|
},
|
||||||
onError: (err, key, config) => {
|
onError: () => {
|
||||||
setParent(null);
|
setParent(null);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { Box, CircularProgress, SimpleGrid, Text, useColorModeValue } from "@chakra-ui/react";
|
import { Box, CircularProgress, SimpleGrid, Text, useColorModeValue } from "@chakra-ui/react";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import useSWRImmutable from "swr/immutable";
|
|
||||||
import fetcher from "src/lib/fetcher";
|
|
||||||
import { MessageTable } from "src/components/Messages/MessageTable";
|
|
||||||
import { getDashboardLayout } from "src/components/Layout";
|
import { getDashboardLayout } from "src/components/Layout";
|
||||||
|
import { MessageTable } from "src/components/Messages/MessageTable";
|
||||||
|
import fetcher from "src/lib/fetcher";
|
||||||
|
import useSWRImmutable from "swr/immutable";
|
||||||
|
|
||||||
const MessagesDashboard = () => {
|
const MessagesDashboard = () => {
|
||||||
const boxBgColor = useColorModeValue("white", "gray.700");
|
const boxBgColor = useColorModeValue("white", "gray.700");
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { Container, Heading } from "@chakra-ui/react";
|
import { Container, Heading } from "@chakra-ui/react";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { Footer } from "src/components/Footer";
|
|
||||||
import { Header } from "src/components/Header";
|
|
||||||
import { getTransparentHeaderLayout } from "src/components/Layout";
|
import { getTransparentHeaderLayout } from "src/components/Layout";
|
||||||
|
|
||||||
const PrivacyPolicy = () => {
|
const PrivacyPolicy = () => {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { Container, Heading } from "@chakra-ui/react";
|
import { Container, Heading } from "@chakra-ui/react";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { Footer } from "src/components/Footer";
|
|
||||||
import { Header } from "src/components/Header";
|
|
||||||
import { getTransparentHeaderLayout } from "src/components/Layout";
|
import { getTransparentHeaderLayout } from "src/components/Layout";
|
||||||
|
|
||||||
const TermsOfService = () => {
|
const TermsOfService = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user