This repository has been archived by the owner on Sep 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from GispoCoding/15_basicui
15_basicui
- Loading branch information
Showing
10 changed files
with
515 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ yarn-debug.log* | |
yarn-error.log* | ||
|
||
.vscode | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import React from 'react'; | ||
import AppBar from '@material-ui/core/AppBar'; | ||
import Toolbar from '@material-ui/core/Toolbar'; | ||
import IconButton from '@material-ui/core/IconButton'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import InputBase from '@material-ui/core/InputBase'; | ||
import { | ||
createStyles, fade, Theme, makeStyles, | ||
} from '@material-ui/core/styles'; | ||
import { Search, Settings } from '@material-ui/icons'; | ||
import { Grid } from '@material-ui/core'; | ||
|
||
const useStyles = makeStyles((theme: Theme) => createStyles({ | ||
root: { | ||
backgroundColor: theme.palette.primary.main, | ||
flexGrow: 1, | ||
margin: '30px auto 0 auto', | ||
pointerEvents: 'auto', | ||
[theme.breakpoints.up('md')]: { | ||
margin: '30px 30px 0 auto', | ||
}, | ||
[theme.breakpoints.down('sm')]: { | ||
paddingRight: 0, | ||
}, | ||
}, | ||
menuButton: { | ||
marginRight: theme.spacing(2), | ||
}, | ||
title: { | ||
marginLeft: '16px', | ||
flexGrow: 1, | ||
pointerEvents: 'none', | ||
userSelect: 'none', | ||
display: 'none', | ||
[theme.breakpoints.up('sm')]: { | ||
display: 'block', | ||
}, | ||
}, | ||
search: { | ||
position: 'relative', | ||
borderRadius: theme.shape.borderRadius, | ||
backgroundColor: fade(theme.palette.common.white, 0.15), | ||
'&:hover': { | ||
backgroundColor: fade(theme.palette.common.white, 0.25), | ||
}, | ||
margin: '8px 0 8px 8px', | ||
width: '100%', | ||
[theme.breakpoints.up('sm')]: { | ||
marginLeft: theme.spacing(1), | ||
width: 'auto', | ||
}, | ||
}, | ||
searchIcon: { | ||
padding: theme.spacing(0, 2), | ||
height: '100%', | ||
position: 'absolute', | ||
pointerEvents: 'none', | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
inputRoot: { | ||
color: 'inherit', | ||
}, | ||
inputInput: { | ||
padding: theme.spacing(2, 1, 2, 0), | ||
// vertical padding + font size from searchIcon | ||
paddingLeft: `calc(1em + ${theme.spacing(4)}px)`, | ||
transition: theme.transitions.create('width'), | ||
width: '100%', | ||
[theme.breakpoints.up('sm')]: { | ||
width: '12ch', | ||
'&:focus': { | ||
width: '20ch', | ||
}, | ||
}, | ||
}, | ||
})); | ||
|
||
export default function Header() { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<Grid | ||
className={classes.root} | ||
item | ||
md={6} | ||
sm={11} | ||
xs={12} | ||
> | ||
<AppBar position="static"> | ||
<Toolbar disableGutters> | ||
<Typography className={classes.title} variant="h6" noWrap> | ||
aukigo | ||
</Typography> | ||
<div className={classes.search}> | ||
<div className={classes.searchIcon}> | ||
<Search /> | ||
</div> | ||
<InputBase | ||
placeholder="Search…" | ||
classes={{ | ||
root: classes.inputRoot, | ||
input: classes.inputInput, | ||
}} | ||
inputProps={{ 'aria-label': 'search' }} | ||
/> | ||
</div> | ||
<IconButton color="inherit"> | ||
<Settings /> | ||
</IconButton> | ||
</Toolbar> | ||
</AppBar> | ||
</Grid> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import React from 'react'; | ||
import { | ||
Grid, makeStyles, createStyles, IconButton, Paper, Theme, | ||
} from '@material-ui/core'; | ||
import { | ||
AcUnit, Accessible, AccountBalance, AccountCircle, Apartment, | ||
} from '@material-ui/icons'; | ||
|
||
const useStyles = makeStyles((theme: Theme) => ( | ||
createStyles({ | ||
root: { | ||
backgroundColor: theme.palette.primary.main, | ||
zIndex: 100, | ||
margin: 'auto', | ||
pointerEvents: 'auto', | ||
flexGrow: 1, | ||
[theme.breakpoints.up('md')]: { | ||
position: 'absolute', | ||
bottom: '30px', | ||
right: '30px', | ||
}, | ||
}, | ||
layerSelButton: { | ||
minWidth: '100%', | ||
}, | ||
}) | ||
)); | ||
|
||
export default function LayerSelector() { | ||
const classes = useStyles(); | ||
return ( | ||
<Grid | ||
alignItems="center" | ||
className={classes.root} | ||
container | ||
direction="row" | ||
justify="space-evenly" | ||
spacing={3} | ||
md={6} | ||
sm={11} | ||
xs={12} | ||
> | ||
<Grid item xs> | ||
<Paper> | ||
<IconButton className={classes.layerSelButton}> | ||
<AcUnit /> | ||
</IconButton> | ||
</Paper> | ||
</Grid> | ||
<Grid item xs> | ||
<Paper> | ||
<IconButton className={classes.layerSelButton}> | ||
<Accessible /> | ||
</IconButton> | ||
</Paper> | ||
</Grid> | ||
<Grid item xs> | ||
<Paper> | ||
<IconButton className={classes.layerSelButton}><AccountBalance /></IconButton> | ||
</Paper> | ||
</Grid> | ||
<Grid item xs> | ||
<Paper> | ||
<IconButton className={classes.layerSelButton}> | ||
<AccountCircle /> | ||
</IconButton> | ||
</Paper> | ||
</Grid> | ||
<Grid item xs> | ||
<Paper> | ||
<IconButton className={classes.layerSelButton}> | ||
<Apartment /> | ||
</IconButton> | ||
</Paper> | ||
</Grid> | ||
</Grid> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from 'react'; | ||
import { Grid } from '@material-ui/core'; | ||
import { ThemeProvider, makeStyles, createStyles } from '@material-ui/core/styles'; | ||
import Header from './header'; | ||
import LayerSelector from './layerselector'; | ||
import theme from '../theme'; | ||
|
||
const useStyles = makeStyles(() => ( | ||
createStyles({ | ||
root: { | ||
flexGrow: 1, | ||
position: 'fixed', | ||
top: 0, | ||
left: 0, | ||
minHeight: '100vh', | ||
pointerEvents: 'none', | ||
zIndex: 100, | ||
}, | ||
header: { | ||
flexGrow: 1, | ||
}, | ||
}) | ||
)); | ||
|
||
export default function MainUI() { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<ThemeProvider theme={theme}> | ||
<Grid | ||
container | ||
className={classes.root} | ||
direction="column" | ||
justify="flex-start" | ||
spacing={0} | ||
xs={12} | ||
> | ||
<Grid item className={classes.header}> | ||
<Header /> | ||
</Grid> | ||
<Grid item> | ||
<LayerSelector /> | ||
</Grid> | ||
</Grid> | ||
</ThemeProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { createMuiTheme } from '@material-ui/core'; | ||
import { orange, blue } from '@material-ui/core/colors'; | ||
|
||
declare module '@material-ui/core/styles/createMuiTheme' { | ||
interface Theme { | ||
custom: { | ||
variable: string, | ||
}, | ||
} | ||
interface ThemeOptions { | ||
custom?: { | ||
variable: string, | ||
} | ||
} | ||
} | ||
|
||
const defaultTheme = createMuiTheme({ | ||
palette: { | ||
primary: blue, | ||
secondary: orange, | ||
}, | ||
custom: { | ||
variable: '#000', | ||
}, | ||
}); | ||
|
||
export default defaultTheme; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.