@@ -3,10 +3,9 @@ import { useQuery } from "@apollo/client";
33import { gql } from './__generated__/gql' ;
44import React from "react" ;
55import { theme } from "./styles/theme"
6- import { ChakraProvider , Alert , AlertIcon , AlertTitle , AlertDescription , Button , HStack , useColorMode } from "@chakra-ui/react" ;
6+ import { ChakraProvider , Alert , AlertIcon , AlertTitle , AlertDescription , Button , HStack , useColorMode , useColorModeValue } from "@chakra-ui/react" ;
77import { Table } from "./components/Table" ;
88import { Helmet } from 'react-helmet' ;
9- import { DarkModeSwitch } from 'react-toggle-dark-mode' ;
109import { DarkModeButton } from "./components/DarkModeButton" ;
1110
1211const GET_INFO = gql ( `
@@ -47,7 +46,7 @@ function DisplayPinInfo(): React.JSX.Element {
4746 const { colorMode, toggleColorMode } = useColorMode ( )
4847
4948 var loadingRows = loading ? 2 : 0
50- var bgColour = colorMode === 'dark' ? " black" : "white"
49+ const bgColour = useColorModeValue ( 'white' , ' black' )
5150
5251 if ( error ) return (
5352 < Alert status = 'error' >
@@ -92,12 +91,9 @@ function DisplayPinInfo(): React.JSX.Element {
9291 < >
9392 < div >
9493 < DarkModeButton
95- aria-label = 'Search database'
9694 style = { { marginBottom : '1rem' , marginLeft : '.25rem' , marginTop : '.25rem' , position : 'relative' , left : '1875px' } }
97- isDark = { colorMode === 'dark' }
9895 onClick = { toggleColorMode }
9996 variant = { 'unstyled' }
100- colorScheme = { colorMode === 'dark' ? '#a3a3a3' : 'white' }
10197 />
10298 < Helmet >
10399 < style > { `body { background-color: ${ bgColour } }` } </ style >
0 commit comments