@@ -3,7 +3,7 @@ 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' ;
99import { DarkModeSwitch } from 'react-toggle-dark-mode' ;
@@ -47,7 +47,7 @@ function DisplayPinInfo(): React.JSX.Element {
4747 const { colorMode, toggleColorMode } = useColorMode ( )
4848
4949 var loadingRows = loading ? 2 : 0
50- var bgColour = colorMode === 'dark' ? " black" : "white"
50+ const bgColour = useColorModeValue ( 'white' , ' black' )
5151
5252 if ( error ) return (
5353 < Alert status = 'error' >
@@ -92,12 +92,9 @@ function DisplayPinInfo(): React.JSX.Element {
9292 < >
9393 < div >
9494 < DarkModeButton
95- aria-label = 'Search database'
9695 style = { { marginBottom : '1rem' , marginLeft : '.25rem' , marginTop : '.25rem' , position : 'relative' , left : '1875px' } }
97- isDark = { colorMode === 'dark' }
9896 onClick = { toggleColorMode }
9997 variant = { 'unstyled' }
100- colorScheme = { colorMode === 'dark' ? '#a3a3a3' : 'white' }
10198 />
10299 < Helmet >
103100 < style > { `body { background-color: ${ bgColour } }` } </ style >
0 commit comments