diff --git a/hyperglass/ui/components/ColorModeToggle.js b/hyperglass/ui/components/ColorModeToggle.js deleted file mode 100644 index e0f377d..0000000 --- a/hyperglass/ui/components/ColorModeToggle.js +++ /dev/null @@ -1,73 +0,0 @@ -import * as React from 'react'; -import { forwardRef } from 'react'; -import { Button, useColorMode } from '@chakra-ui/core'; - -const Sun = ({ color, size = '1.5rem', ...props }) => ( - - - -); - -const Moon = ({ color, size = '1.5rem', ...props }) => ( - - - -); - -const iconMap = { dark: Moon, light: Sun }; -const outlineColor = { dark: 'primary.300', light: 'primary.600' }; - -export const ColorModeToggle = forwardRef((props, ref) => { - const { colorMode, toggleColorMode } = useColorMode(); - const Icon = iconMap[colorMode]; - - const label = `Switch to ${colorMode === 'light' ? 'dark' : 'light'} mode`; - - return ( - - ); -}); diff --git a/hyperglass/ui/components/FormField.js b/hyperglass/ui/components/FormField.js deleted file mode 100644 index 7d1f4ad..0000000 --- a/hyperglass/ui/components/FormField.js +++ /dev/null @@ -1,55 +0,0 @@ -import * as React from 'react'; -import { Flex, FormControl, FormLabel, FormErrorMessage, useColorMode } from '@chakra-ui/core'; - -const labelColor = { dark: 'whiteAlpha.700', light: 'blackAlpha.700' }; - -export const FormField = ({ - label, - name, - error, - hiddenLabels, - helpIcon, - targetInfo, - setTarget, - labelAddOn, - fieldAddOn, - children, - ...props -}) => { - const { colorMode } = useColorMode(); - - return ( - - - {label} - {labelAddOn || null} - - {children} - {fieldAddOn && ( - - {fieldAddOn} - - )} - - {error && error.message} - - - ); -}; diff --git a/hyperglass/ui/components/Greeting.js b/hyperglass/ui/components/Greeting.js deleted file mode 100644 index fd79296..0000000 --- a/hyperglass/ui/components/Greeting.js +++ /dev/null @@ -1,67 +0,0 @@ -import * as React from 'react'; -import { - Button, - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalFooter, - ModalBody, - ModalCloseButton, - useColorMode, - useDisclosure, -} from '@chakra-ui/core'; -import { Markdown } from 'app/components'; -import { motion } from 'framer-motion'; - -const bg = { light: 'white', dark: 'black' }; -const color = { light: 'black', dark: 'white' }; - -const AnimatedModalContent = motion.custom(ModalContent); -const AnimatedModalOverlay = motion.custom(ModalOverlay); - -export const Greeting = ({ greetingConfig, content, onClickThrough }) => { - const { isOpen, onOpen, onClose } = useDisclosure(true); - const { colorMode } = useColorMode(); - - const handleClick = () => { - onClickThrough(true); - onClose(); - }; - - return ( - - - - {greetingConfig.title} - {!greetingConfig.required && } - - - - - - - - - ); -}; diff --git a/hyperglass/ui/components/Layout.js b/hyperglass/ui/components/Layout.js deleted file mode 100644 index abd3e03..0000000 --- a/hyperglass/ui/components/Layout.js +++ /dev/null @@ -1,58 +0,0 @@ -import * as React from 'react'; -import { useRef } from 'react'; -import { Flex, useColorMode } from '@chakra-ui/core'; -import { useConfig, useHyperglassState } from 'app/context'; -import { Debugger, Greeting, Footer, Header } from 'app/components'; - -const bg = { light: 'white', dark: 'black' }; -const color = { light: 'black', dark: 'white' }; - -export const Layout = ({ children }) => { - const config = useConfig(); - const { colorMode } = useColorMode(); - const { greetingAck, setGreetingAck, setSubmitting, setFormData } = useHyperglassState(); - const containerRef = useRef(null); - - const resetForm = () => { - containerRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' }); - setSubmitting(false); - setFormData({}); - }; - - return ( - <> - - -
- - - {children} - -