import React, { Component } from
"react"
;
import
"./App.css"
;
import CssBaseline from
"@material-ui/core/CssBaseline"
;
import { ThemeProvider } from
"@material-ui/styles"
;
import { createMuiTheme } from
"@material-ui/core/styles"
;
import Container from
"@material-ui/core/Container"
;
import Typography from
"@material-ui/core/Typography"
;
import Button from
"@material-ui/core/Button"
;
import { AppBar, Toolbar } from
"@material-ui/core"
;
import Switch from
"@material-ui/core/Switch"
;
import lightTheme, { darkTheme } from
"./theme"
;
import Grid from
"@material-ui/core/Grid"
;
import Component1 from
"./Component1"
;
function
App() {
const [checked, setChecked] = React.useState(
false
);
const [newtheme, setTheme] = React.useState(
false
);
function
changeTheme() {
setTheme(!newtheme);
setChecked(!checked);
}
const appliedTheme = createMuiTheme(newtheme ? darkTheme : lightTheme);
return
(
<React.Fragment>
<ThemeProvider theme={appliedTheme}>
<CssBaseline />
<AppBar position=
"static"
color=
"transparent"
elevation={0}>
<Toolbar>
{
}
<Switch
checked={checked}
onChange={() => {
changeTheme();
}}
style={{
color: appliedTheme.palette.secondary.icons,
}}
/>
</Toolbar>
</AppBar>
<Container maxWidth=
"sm"
>
<Typography
component=
"h1"
variant=
"h1"
align=
"center"
color=
"textPrimary"
gutterBottom
>
Geeks
for
Geeks
</Typography>
<br />
<Component1></Component1>
<br />
<Grid
container
direction=
"row"
justify=
"center"
spacing={4}
>
<Grid item>
<Button variant=
"contained"
color=
"secondary"
>
Button 1
</Button>
</Grid>
<Grid item>
<Button variant=
"outlined"
color=
"secondary"
>
Button 2
</Button>
</Grid>
</Grid>
<br />
</Container>
</ThemeProvider>
</React.Fragment>
);
}
export
default
App;