-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
37 lines (32 loc) · 828 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react';
import Button from '@material-ui/core/Button';
import red from '@material-ui/core/colors/red';
import lime from '@material-ui/core/colors/lime';
import Link from 'next/link';
import { useThemeManagerContext } from '../src';
const theme2 = {
palette: {
primary: red,
secondary: lime,
},
};
const Index = () => {
const { setTheme } = useThemeManagerContext();
const handleChangeTheme = () => {
setTheme(theme2, () => {
console.log('changed to theme2!');
});
};
return (
<div>
<Button color="primary">Hello World</Button>
<Button color="secondary" variant="outlined" onClick={handleChangeTheme}>
Change Theme
</Button>
<Link href="/page1">
<Button>To Page1</Button>
</Link>
</div>
);
};
export default Index;