Hide snackbar option to view traffic info if already on that page
This commit is contained in:
		
							
								
								
									
										11
									
								
								src/App.js
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								src/App.js
									
									
									
									
									
								
							@@ -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() }}
 | 
				
			||||||
                            >
 | 
					                            >
 | 
				
			||||||
                                <Link to="/traffic">Visa trafikinfo</Link>
 | 
					                                {this.currentPageName() !== "TrafficInfo" &&
 | 
				
			||||||
 | 
					                                    <Link to="/traffic">Visa trafikinfo</Link>
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
                                <img src={closeIcon} alt="" />
 | 
					                                <img src={closeIcon} alt="" />
 | 
				
			||||||
                            </IconButton>,
 | 
					                            </IconButton>,
 | 
				
			||||||
                        ]}
 | 
					                        ]}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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;
 | 
				
			||||||
@@ -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;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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 {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user