From 53673d2aa3534f7329161ce7dea9a2f29c553eab Mon Sep 17 00:00:00 2001 From: Lucian Petri Date: Fri, 30 Dec 2022 03:19:36 +0200 Subject: [PATCH] pre-commit lint --- website/src/components/Footer.tsx | 93 +++++++++---------- website/src/components/TwoColumns.tsx | 11 ++- website/src/components/UI/ColorModeSwitch.tsx | 1 - .../pages/evaluate/rank_assistant_replies.tsx | 2 +- .../pages/evaluate/rank_initial_prompts.tsx | 2 +- website/src/styles/Theme/colors.ts | 4 +- .../src/styles/Theme/components/Container.ts | 10 +- 7 files changed, 60 insertions(+), 63 deletions(-) diff --git a/website/src/components/Footer.tsx b/website/src/components/Footer.tsx index 33ccc128..022e70c5 100644 --- a/website/src/components/Footer.tsx +++ b/website/src/components/Footer.tsx @@ -4,22 +4,29 @@ import Link from "next/link"; import { Container, Text, useColorModeValue } from "@chakra-ui/react"; export function Footer() { - return ( ); diff --git a/website/src/components/TwoColumns.tsx b/website/src/components/TwoColumns.tsx index e3f59433..b4189496 100644 --- a/website/src/components/TwoColumns.tsx +++ b/website/src/components/TwoColumns.tsx @@ -1,17 +1,20 @@ import { Container, useColorModeValue } from "@chakra-ui/react"; - export const TwoColumns = ({ children }: { children: React.ReactNode[] }) => { if (!Array.isArray(children) || children.length !== 2) { throw new Error("TwoColumns expects 2 children"); } - const bg = useColorModeValue("white", "gray.700") + const bg = useColorModeValue("white", "gray.700"); const [first, second] = children; return ( - {first} - {second} + + {first} + + + {second} + ); }; diff --git a/website/src/components/UI/ColorModeSwitch.tsx b/website/src/components/UI/ColorModeSwitch.tsx index 98651a74..05c9bde3 100644 --- a/website/src/components/UI/ColorModeSwitch.tsx +++ b/website/src/components/UI/ColorModeSwitch.tsx @@ -1,7 +1,6 @@ import { Switch, useColorMode } from "@chakra-ui/react"; import React from "react"; - const ColorModeSwitch = () => { const { colorMode, toggleColorMode } = useColorMode(); return ( diff --git a/website/src/pages/evaluate/rank_assistant_replies.tsx b/website/src/pages/evaluate/rank_assistant_replies.tsx index 08381adf..faf353dc 100644 --- a/website/src/pages/evaluate/rank_assistant_replies.tsx +++ b/website/src/pages/evaluate/rank_assistant_replies.tsx @@ -20,7 +20,7 @@ const RankAssistantReplies = () => { * The best reply will have index 0, and the worst is the last. */ const [ranking, setRanking] = useState([]); - const bg = useColorModeValue("gray.100", "gray.800") + const bg = useColorModeValue("gray.100", "gray.800"); const { isLoading } = useSWRImmutable("/api/new_task/rank_assistant_replies", fetcher, { onSuccess: (data) => { setTasks([data]); diff --git a/website/src/pages/evaluate/rank_initial_prompts.tsx b/website/src/pages/evaluate/rank_initial_prompts.tsx index 3649ae5c..bcc181c3 100644 --- a/website/src/pages/evaluate/rank_initial_prompts.tsx +++ b/website/src/pages/evaluate/rank_initial_prompts.tsx @@ -21,7 +21,7 @@ const RankInitialPrompts = () => { * The best prompt will have index 0, and the worst is the last. */ const [ranking, setRanking] = useState([]); - const bg = useColorModeValue("gray.100", "gray.800") + const bg = useColorModeValue("gray.100", "gray.800"); const { isLoading } = useSWRImmutable("/api/new_task/rank_initial_prompts", fetcher, { onSuccess: (data) => { diff --git a/website/src/styles/Theme/colors.ts b/website/src/styles/Theme/colors.ts index bf031c81..acbaa642 100644 --- a/website/src/styles/Theme/colors.ts +++ b/website/src/styles/Theme/colors.ts @@ -1,10 +1,10 @@ export const colors = { light: { bg: "gray.100", - text: "black" + text: "black", }, dark: { bg: "gray.900", - text: "white" + text: "white", }, }; diff --git a/website/src/styles/Theme/components/Container.ts b/website/src/styles/Theme/components/Container.ts index 9168e099..b6fdee2e 100644 --- a/website/src/styles/Theme/components/Container.ts +++ b/website/src/styles/Theme/components/Container.ts @@ -1,13 +1,13 @@ -import { color, defineStyle, defineStyleConfig, transition } from "@chakra-ui/styled-system" -import { colors } from "../colors" +import { color, defineStyle, defineStyleConfig, transition } from "@chakra-ui/styled-system"; +import { colors } from "../colors"; -const baseStyle = defineStyle(({colorMode}) => ({ +const baseStyle = defineStyle(({ colorMode }) => ({ minWidth: "100%", bg: colorMode === "light" ? colors.light.bg : colors.dark.bg, transition: "background-color 200ms cubic-bezier(0.4, 0, 1, 1)", color: colorMode === "light" ? colors.light.text : colors.dark.text, -})) +})); export const containerTheme = defineStyleConfig({ baseStyle, -}) \ No newline at end of file +});