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