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

View File

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

View File

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

View File

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