File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 5
5
GridItem ,
6
6
Heading ,
7
7
HStack ,
8
+ useColorMode ,
8
9
VStack ,
9
10
} from "@chakra-ui/react" ;
10
11
import { useRouter } from "next/router" ;
@@ -17,6 +18,7 @@ import { BackButton } from "@/components/BackButton/BackButton";
17
18
import { StatusIndicator } from "@/components/StatusIndicator/StatusIndicator" ;
18
19
import { TestnetBanner } from "@/components/TestnetBanner/TestnetBanner" ;
19
20
import { useFeatureFlags } from "@/providers/FeatureFlagsProvider" ;
21
+ import { trpcReact } from "@/providers/TRPCProvider" ;
20
22
import { ChakraLink } from "@/ui/ChakraLink/ChakraLink" ;
21
23
import { COLORS } from "@/ui/colors" ;
22
24
import { AddressBook } from "@/ui/SVGs/AddressBook" ;
@@ -111,12 +113,19 @@ function ResponsiveLogo() {
111
113
function Sidebar ( ) {
112
114
const router = useRouter ( ) ;
113
115
const { formatMessage } = useIntl ( ) ;
114
-
116
+ const { colorMode } = useColorMode ( ) ;
115
117
const { flags } = useFeatureFlags ( ) ;
116
-
118
+ const { mutate : setUserSettings } = trpcReact . setUserSettings . useMutation ( ) ;
117
119
return (
118
120
< Flex flexDirection = "column" alignItems = "stretch" w = "100%" >
119
121
< Box
122
+ onDoubleClick = { ( ) => {
123
+ if ( flags . themeToggle . enabled ) {
124
+ colorMode === "dark"
125
+ ? setUserSettings ( { theme : "light" } )
126
+ : setUserSettings ( { theme : "dark" } ) ;
127
+ }
128
+ } }
120
129
pl = { 4 }
121
130
mb = { 10 }
122
131
color = { flags . demoFlag . enabled ? "#2C72FF" : undefined }
Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ const FLAGS_DEFINITION = [
27
27
"Turning this flag on will enable importing Ledger accounts and signing transactions with your Ledger device." ,
28
28
key : "ledgerSupport" ,
29
29
} ,
30
+ {
31
+ name : "Global Theme Toggle" ,
32
+ description :
33
+ "Turning this flag on will allow double clicking the logo to change the theme" ,
34
+ key : "themeToggle" ,
35
+ } ,
30
36
] as const ;
31
37
32
38
type FlagsDefinition = Writable < ( typeof FLAGS_DEFINITION ) [ number ] > ;
You can’t perform that action at this time.
0 commit comments