Hide snackbar option to view traffic info if already on that page

This commit is contained in:
André Wahlberg 2020-12-11 19:05:30 +01:00
parent 30bcbd0286
commit 13bf20c2ea
4 changed files with 15 additions and 7 deletions

View File

@ -20,6 +20,13 @@ import closeIcon from './img/close.svg';
class App extends Component { class App extends Component {
currentPageName = () => {
if (globalData.currentPage.constructor !== undefined)
return globalData.currentPage.constructor.name;
else
return "";
};
render() { render() {
globalData.root = this; globalData.root = this;
@ -52,7 +59,9 @@ class App extends Component {
color="inherit" color="inherit"
onClick={() => { globalData.snackbarVisible = false; globalData.root.forceUpdate() }} onClick={() => { globalData.snackbarVisible = false; globalData.root.forceUpdate() }}
> >
{this.currentPageName() !== "TrafficInfo" &&
<Link to="/traffic">Visa trafikinfo</Link> <Link to="/traffic">Visa trafikinfo</Link>
}
<img src={closeIcon} alt="" /> <img src={closeIcon} alt="" />
</IconButton>, </IconButton>,
]} ]}

View File

@ -14,7 +14,8 @@ let globalData = {
disruption: new Disruption( disruption: new Disruption(
), ),
stop: new Stop( stop: new Stop(
) ),
currentPage: ""
}; };
export default globalData; export default globalData;

View File

@ -56,7 +56,7 @@
.timeColumn { .timeColumn {
flex-basis: 20%; flex-basis: 20%;
justify-content: space-between !important; justify-content: flex-start !important;
align-items: center; align-items: center;
} }

View File

@ -71,17 +71,15 @@ button {
} }
.MuiIconButton-label { .MuiIconButton-label {
justify-content: space-between !important; justify-content: flex-end !important;
} }
.MuiIconButton-label a { .MuiIconButton-label a {
align-items: center; align-items: center;
}
.MuiIconButton-label a {
font-size: 3.5vw; font-size: 3.5vw;
color: white; color: white;
text-decoration: none; text-decoration: none;
margin-right: 5vw;
} }
.MuiIconButton-label img { .MuiIconButton-label img {