New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Add typescript version of paperbase theme #17213
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = { | ||
rules: { | ||
'jsx-a11y/anchor-is-valid': 'off', | ||
'react/prop-types': 'off', | ||
}, | ||
}; |
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,84 @@ | ||
import React from 'react'; | ||
import AppBar from '@material-ui/core/AppBar'; | ||
import Toolbar from '@material-ui/core/Toolbar'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import Grid from '@material-ui/core/Grid'; | ||
import Button from '@material-ui/core/Button'; | ||
import TextField from '@material-ui/core/TextField'; | ||
import Tooltip from '@material-ui/core/Tooltip'; | ||
import IconButton from '@material-ui/core/IconButton'; | ||
import { createStyles, Theme, withStyles, WithStyles } from '@material-ui/core/styles'; | ||
import SearchIcon from '@material-ui/icons/Search'; | ||
import RefreshIcon from '@material-ui/icons/Refresh'; | ||
|
||
const styles = (theme: Theme) => | ||
createStyles({ | ||
paper: { | ||
maxWidth: 936, | ||
margin: 'auto', | ||
overflow: 'hidden', | ||
}, | ||
searchBar: { | ||
borderBottom: '1px solid rgba(0, 0, 0, 0.12)', | ||
}, | ||
searchInput: { | ||
fontSize: theme.typography.fontSize, | ||
}, | ||
block: { | ||
display: 'block', | ||
}, | ||
addUser: { | ||
marginRight: theme.spacing(1), | ||
}, | ||
contentWrapper: { | ||
margin: '40px 16px', | ||
}, | ||
}); | ||
|
||
export interface ContentProps extends WithStyles<typeof styles> {} | ||
|
||
function Content(props: ContentProps) { | ||
const { classes } = props; | ||
|
||
return ( | ||
<Paper className={classes.paper}> | ||
<AppBar className={classes.searchBar} position="static" color="default" elevation={0}> | ||
<Toolbar> | ||
<Grid container spacing={2} alignItems="center"> | ||
<Grid item> | ||
<SearchIcon className={classes.block} color="inherit" /> | ||
</Grid> | ||
<Grid item xs> | ||
<TextField | ||
fullWidth | ||
placeholder="Search by email address, phone number, or user UID" | ||
InputProps={{ | ||
disableUnderline: true, | ||
className: classes.searchInput, | ||
}} | ||
/> | ||
</Grid> | ||
<Grid item> | ||
<Button variant="contained" color="primary" className={classes.addUser}> | ||
Add user | ||
</Button> | ||
<Tooltip title="Reload"> | ||
<IconButton> | ||
<RefreshIcon className={classes.block} color="inherit" /> | ||
</IconButton> | ||
</Tooltip> | ||
</Grid> | ||
</Grid> | ||
</Toolbar> | ||
</AppBar> | ||
<div className={classes.contentWrapper}> | ||
<Typography color="textSecondary" align="center"> | ||
No users for this project yet | ||
</Typography> | ||
</div> | ||
</Paper> | ||
); | ||
} | ||
|
||
export default withStyles(styles)(Content); |
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,136 @@ | ||
import React from 'react'; | ||
import AppBar from '@material-ui/core/AppBar'; | ||
import Avatar from '@material-ui/core/Avatar'; | ||
import Button from '@material-ui/core/Button'; | ||
import Grid from '@material-ui/core/Grid'; | ||
import HelpIcon from '@material-ui/icons/Help'; | ||
import Hidden from '@material-ui/core/Hidden'; | ||
import IconButton from '@material-ui/core/IconButton'; | ||
import Link from '@material-ui/core/Link'; | ||
import MenuIcon from '@material-ui/icons/Menu'; | ||
import NotificationsIcon from '@material-ui/icons/Notifications'; | ||
import Tab from '@material-ui/core/Tab'; | ||
import Tabs from '@material-ui/core/Tabs'; | ||
import Toolbar from '@material-ui/core/Toolbar'; | ||
import Tooltip from '@material-ui/core/Tooltip'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import { createStyles, Theme, withStyles, WithStyles } from '@material-ui/core/styles'; | ||
|
||
const lightColor = 'rgba(255, 255, 255, 0.7)'; | ||
|
||
const styles = (theme: Theme) => | ||
createStyles({ | ||
secondaryBar: { | ||
zIndex: 0, | ||
}, | ||
menuButton: { | ||
marginLeft: -theme.spacing(1), | ||
}, | ||
iconButtonAvatar: { | ||
padding: 4, | ||
}, | ||
link: { | ||
textDecoration: 'none', | ||
color: lightColor, | ||
'&:hover': { | ||
color: theme.palette.common.white, | ||
}, | ||
}, | ||
button: { | ||
borderColor: lightColor, | ||
}, | ||
}); | ||
|
||
interface HeaderProps extends WithStyles<typeof styles> { | ||
onDrawerToggle: () => void; | ||
} | ||
|
||
function Header(props: HeaderProps) { | ||
const { classes, onDrawerToggle } = props; | ||
|
||
return ( | ||
<React.Fragment> | ||
<AppBar color="primary" position="sticky" elevation={0}> | ||
<Toolbar> | ||
<Grid container spacing={1} alignItems="center"> | ||
<Hidden smUp> | ||
<Grid item> | ||
<IconButton | ||
color="inherit" | ||
aria-label="open drawer" | ||
onClick={onDrawerToggle} | ||
className={classes.menuButton} | ||
> | ||
<MenuIcon /> | ||
</IconButton> | ||
</Grid> | ||
</Hidden> | ||
<Grid item xs /> | ||
<Grid item> | ||
<Link className={classes.link} href="#" variant="body2"> | ||
Go to docs | ||
</Link> | ||
</Grid> | ||
<Grid item> | ||
<Tooltip title="Alerts • No alters"> | ||
<IconButton color="inherit"> | ||
<NotificationsIcon /> | ||
</IconButton> | ||
</Tooltip> | ||
</Grid> | ||
<Grid item> | ||
<IconButton color="inherit" className={classes.iconButtonAvatar}> | ||
<Avatar src="/static/images/avatar/1.jpg" alt="My Avatar" /> | ||
</IconButton> | ||
</Grid> | ||
</Grid> | ||
</Toolbar> | ||
</AppBar> | ||
<AppBar | ||
component="div" | ||
className={classes.secondaryBar} | ||
color="primary" | ||
position="static" | ||
elevation={0} | ||
> | ||
<Toolbar> | ||
<Grid container alignItems="center" spacing={1}> | ||
<Grid item xs> | ||
<Typography color="inherit" variant="h5" component="h1"> | ||
Authentication | ||
</Typography> | ||
</Grid> | ||
<Grid item> | ||
<Button className={classes.button} variant="outlined" color="inherit" size="small"> | ||
Web setup | ||
</Button> | ||
</Grid> | ||
<Grid item> | ||
<Tooltip title="Help"> | ||
<IconButton color="inherit"> | ||
<HelpIcon /> | ||
</IconButton> | ||
</Tooltip> | ||
</Grid> | ||
</Grid> | ||
</Toolbar> | ||
</AppBar> | ||
<AppBar | ||
component="div" | ||
className={classes.secondaryBar} | ||
color="primary" | ||
position="static" | ||
elevation={0} | ||
> | ||
<Tabs value={0} textColor="inherit"> | ||
<Tab textColor="inherit" label="Users" /> | ||
<Tab textColor="inherit" label="Sign-in method" /> | ||
<Tab textColor="inherit" label="Templates" /> | ||
<Tab textColor="inherit" label="Usage" /> | ||
</Tabs> | ||
</AppBar> | ||
</React.Fragment> | ||
); | ||
} | ||
|
||
export default withStyles(styles)(Header); |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class wasn't defined anymore