Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
feat: disable inactive routes
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-calavera authored and mvines committed Jul 30, 2019
1 parent 893cc1e commit dc4a254
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/v2/components/Dashboard/NetworkOverview/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const NetworkOverview = () => {
return (
<Container>
<div className={classes.root}>
<SectionHeader title="Network Overview" />
<SectionHeader title={<div>Network Overview <div className={classes.betaLabel}>Beta</div></div>} />
<Grid container spacing={2} className={classes.row}>
<Grid item xs={12} md={6}>
<TPS />
Expand Down
6 changes: 6 additions & 0 deletions src/v2/components/Dashboard/NetworkOverview/styles.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {makeStyles} from '@material-ui/core';
import getColor from 'v2/utils/getColor';

export default makeStyles(theme => ({
root: {
Expand All @@ -11,4 +12,9 @@ export default makeStyles(theme => ({
row: {
marginBottom: 8,
},
betaLabel: {
fontSize: 15,
color: getColor('main')(theme),
lineHeight: 1
}
}));
36 changes: 28 additions & 8 deletions src/v2/components/NavBar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,33 @@ const NavBar = ({
const theme = useTheme();
const showDrawer = useMediaQuery(theme.breakpoints.up('md'));
const routes = [
'dashboard',
'transactions',
'validators',
'tour-de-sol',
'applications',
'blocks',
'favorites',
{
link: 'dashboard',
},
{
link: 'transactions',
disabled: true,
},
{
link: 'validators',
},
{
link: 'tour-de-sol',
},
{
link: 'applications',
disabled: true,
},
{
link: 'blocks',
disabled: true,
},
{
link: 'favorites',
disabled: true,
},
];
const renderLink = link => {
const renderLink = ({link, disabled}: {link: string, disabled?: boolean}) => {
const Icon = icons[link];
const isDashboard = eq('dashboard', link);
const selected =
Expand All @@ -86,6 +104,7 @@ const NavBar = ({
button
component="a"
key={link}
disabled={disabled}
classes={{root: classes.item, selected: classes.itemSelected}}
>
<ListItemIcon className={classes.icon}>
Expand All @@ -95,6 +114,7 @@ const NavBar = ({
classes={{primary: classes.itemText, root: classes.itemTextRoot}}
primary={link}
/>
{disabled && <div className={classes.coming}>Coming Soon</div>}
</ListItem>
);
};
Expand Down
32 changes: 26 additions & 6 deletions src/v2/components/NavBar/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ export default makeStyles(theme => ({
width: 0,
},
},
coming: {
position: 'absolute',
fontSize: 12,
color: getColor('main')(theme),
opacity: 0,
transition: '.15s ease-in-out',
bottom: -8,
[theme.breakpoints.down('sm')]: {
opacity: 1,
},
},
toolbar: {
display: 'flex',
alignItems: 'center',
Expand All @@ -25,9 +36,6 @@ export default makeStyles(theme => ({
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
[theme.breakpoints.down('sm')]: {
height: 97,
},
},
icon: {
justifyContent: 'center',
Expand All @@ -52,6 +60,10 @@ export default makeStyles(theme => ({
opacity: 1,
visibility: 'visible',
},
'&:hover a div:nth-child(3)': {
opacity: 1,
visibility: 'visible',
},
[theme.breakpoints.down('sm')]: {
width: '100%',
background: getColor('dark')(theme),
Expand All @@ -63,9 +75,16 @@ export default makeStyles(theme => ({
transition: '.15s ease-in-out',
overflowX: 'hidden',
overflowY: 'auto',
height: '100%',
'&:hover': {
width: 225,
},
[theme.breakpoints.down('sm')]: {
width: '100%',
'&:hover': {
width: '100%',
},
},
},
menuButton: {
marginLeft: 'auto',
Expand All @@ -86,15 +105,16 @@ export default makeStyles(theme => ({
visibility: 'hidden',
position: 'absolute',
bottom: 2,
[theme.breakpoints.down('sm')]: {
opacity: 1,
visibility: 'visible',
},
},
itemText: {
textTransform: 'uppercase',
fontSize: 15,
fontWeight: 'bold',
letterSpacing: 2.5,
whiteSpace: 'nowrap',
[theme.breakpoints.down('sm')]: {
marginLeft: 38,
},
},
}));

0 comments on commit dc4a254

Please sign in to comment.