File tree 4 files changed +68
-12
lines changed 4 files changed +68
-12
lines changed Original file line number Diff line number Diff line change 3
3
"name" : " horizon-ui-chakra" ,
4
4
"version" : " 1.0.1" ,
5
5
"private" : true ,
6
- "dependencies" : {
6
+ "dependencies" : {
7
7
"@chakra-ui/icons" : " ^1.1.5" ,
8
8
"@chakra-ui/react" : " 1.8.8" ,
9
9
"@chakra-ui/system" : " ^1.12.1" ,
10
10
"@chakra-ui/theme-tools" : " ^1.3.6" ,
11
11
"@emotion/cache" : " ^11.7.1" ,
12
12
"@emotion/react" : " ^11.4.1" ,
13
13
"@emotion/styled" : " ^11.3.0" ,
14
+ "@hypertheme-editor/chakra-ui" : " ^0.1.5" ,
14
15
"@testing-library/jest-dom" : " ^5.14.1" ,
15
16
"@testing-library/react" : " ^11.2.7" ,
16
17
"@testing-library/user-event" : " ^12.8.3" ,
Original file line number Diff line number Diff line change @@ -22,10 +22,11 @@ import PropTypes from "prop-types";
22
22
import React from "react" ;
23
23
// Assets
24
24
import navImage from "assets/img/layout/Navbar.png" ;
25
- import { MdNotificationsNone , MdInfoOutline } from "react-icons/md" ;
25
+ import { MdNotificationsNone , MdInfoOutline , MdPalette } from "react-icons/md" ;
26
26
import { IoMdMoon , IoMdSunny } from "react-icons/io" ;
27
27
import { FaEthereum } from "react-icons/fa" ;
28
28
import routes from "routes.js" ;
29
+ import { ThemeEditor } from "./ThemeEditor" ;
29
30
export default function HeaderLinks ( props ) {
30
31
const { secondary } = props ;
31
32
const { colorMode, toggleColorMode } = useColorMode ( ) ;
@@ -205,7 +206,7 @@ export default function HeaderLinks(props) {
205
206
</ MenuList >
206
207
</ Menu >
207
208
208
- < Button
209
+ { /* <Button
209
210
variant='no-hover'
210
211
bg='transparent'
211
212
p='0px'
@@ -221,7 +222,10 @@ export default function HeaderLinks(props) {
221
222
color={navbarIcon}
222
223
as={colorMode === "light" ? IoMdMoon : IoMdSunny}
223
224
/>
224
- </ Button >
225
+ </Button> */ }
226
+
227
+ < ThemeEditor navbarIcon = { navbarIcon } />
228
+
225
229
< Menu >
226
230
< MenuButton p = '0px' >
227
231
< Avatar
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+ import {
3
+ ThemeEditor as ThemeEditorContainer ,
4
+ ThemeEditorDrawer ,
5
+ ThemeEditorColors ,
6
+ ThemeEditorFontSizes
7
+ } from '@hypertheme-editor/chakra-ui'
8
+ import { Button , Icon } from '@chakra-ui/react'
9
+ import { CgColorPicker } from 'react-icons/cg'
10
+ import { ImFontSize } from 'react-icons/im'
11
+ import { MdPalette } from 'react-icons/md'
12
+
13
+ export function ThemeEditor ( props ) {
14
+ return (
15
+ < ThemeEditorContainer >
16
+ < ThemeEditorButton { ...props } />
17
+ < ThemeEditorDrawer hideUpgradeToPro >
18
+ < ThemeEditorColors icon = { CgColorPicker } title = "Colors" />
19
+ < ThemeEditorFontSizes icon = { ImFontSize } title = "Font Sizes" />
20
+ </ ThemeEditorDrawer >
21
+ </ ThemeEditorContainer >
22
+ )
23
+ }
24
+
25
+ function ThemeEditorButton ( { onOpen, navbarIcon, ...rest } ) {
26
+ return (
27
+ < Button
28
+ variant = 'no-hover'
29
+ bg = 'transparent'
30
+ p = '0px'
31
+ minW = 'unset'
32
+ minH = 'unset'
33
+ h = '18px'
34
+ w = 'max-content'
35
+ _focus = { { boxShadow : 'none' } }
36
+ onClick = { onOpen }
37
+ { ...rest }
38
+ >
39
+ < Icon
40
+ me = '10px'
41
+ h = '18px'
42
+ w = '18px'
43
+ color = { navbarIcon }
44
+ as = { MdPalette }
45
+ />
46
+ </ Button >
47
+ )
48
+ }
Original file line number Diff line number Diff line change @@ -7,18 +7,21 @@ import AdminLayout from "layouts/admin";
7
7
import RTLLayout from "layouts/rtl" ;
8
8
import { ChakraProvider } from "@chakra-ui/react" ;
9
9
import theme from "theme/theme" ;
10
+ import { ThemeEditorProvider } from "@hypertheme-editor/chakra-ui" ;
10
11
11
12
ReactDOM . render (
12
13
< ChakraProvider theme = { theme } >
13
14
< React . StrictMode >
14
- < HashRouter >
15
- < Switch >
16
- < Route path = { `/auth` } component = { AuthLayout } />
17
- < Route path = { `/admin` } component = { AdminLayout } />
18
- < Route path = { `/rtl` } component = { RTLLayout } />
19
- < Redirect from = '/' to = '/admin' />
20
- </ Switch >
21
- </ HashRouter >
15
+ < ThemeEditorProvider >
16
+ < HashRouter >
17
+ < Switch >
18
+ < Route path = { `/auth` } component = { AuthLayout } />
19
+ < Route path = { `/admin` } component = { AdminLayout } />
20
+ < Route path = { `/rtl` } component = { RTLLayout } />
21
+ < Redirect from = '/' to = '/admin' />
22
+ </ Switch >
23
+ </ HashRouter >
24
+ </ ThemeEditorProvider >
22
25
</ React . StrictMode >
23
26
</ ChakraProvider > ,
24
27
document . getElementById ( "root" )
You can’t perform that action at this time.
0 commit comments