diff options
author | 2021-08-03 16:25:25 +0000 | |
---|---|---|
committer | 2021-08-03 16:25:25 +0000 | |
commit | c51fd5692565983658c1daa12ecae6adebc257d5 (patch) | |
tree | 0172f94532605c0ec68d3f9d4e755e420d7e41ae /sdnr/wt/odlux/framework/src/components/navigationMenu.tsx | |
parent | 53cb85faef848051ca1264b30e9a279f56b04631 (diff) | |
parent | 96d32fbfa1c0dcda85db3d06edaff36267023cfa (diff) |
Merge "Add aria-labels to odlux tables"
Diffstat (limited to 'sdnr/wt/odlux/framework/src/components/navigationMenu.tsx')
-rw-r--r-- | sdnr/wt/odlux/framework/src/components/navigationMenu.tsx | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx b/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx index 437ba1b3a..b65eb29e2 100644 --- a/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx +++ b/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx @@ -87,9 +87,10 @@ const styles = (theme: Theme) => createStyles({ const tabletWidthBreakpoint = 768;
export const NavigationMenu = withStyles(styles)(connect()(({ classes, state, dispatch }: WithStyles<typeof styles> & Connect & Connect) => {
- const { user } = state.framework.authenticationState
- const isOpen = state.framework.applicationState.isMenuOpen
- const closedByUser = state.framework.applicationState.isMenuClosedByUser
+ const { user } = state.framework.authenticationState;
+ const isOpen = state.framework.applicationState.isMenuOpen;
+ const closedByUser = state.framework.applicationState.isMenuClosedByUser;
+ const transportUrl = state.framework.applicationState.transportpceUrl;
const [responsive, setResponsive] = React.useState(false);
@@ -139,20 +140,25 @@ export const NavigationMenu = withStyles(styles)(connect()(({ classes, state, di ) || null;
}) || null;
- const transportPCELink = <ListItemLink
- key={"transportPCE"}
- to={window.localStorage.getItem(transportPCEUrl)!}
- primary={"TransportPCE"}
- icon={<FontAwesomeIcon icon={faProjectDiagram}/>}
- external/>;
-
- const linkFound = menuItems.find(obj=>obj.key === "linkCalculation");
- if(linkFound){
- const index = menuItems.indexOf(linkFound);
- menuItems.splice(index+1,0,transportPCELink);
- }else{
- menuItems.push(transportPCELink);
+ if(transportUrl.length>0){
+
+ const transportPCELink = <ListItemLink
+ key={"transportPCE"}
+ to={transportUrl}
+ primary={"TransportPCE"}
+ icon={<FontAwesomeIcon icon={faProjectDiagram} />}
+ external />;
+
+ const linkFound = menuItems.find(obj => obj.key === "linkCalculation");
+
+ if (linkFound) {
+ const index = menuItems.indexOf(linkFound);
+ menuItems.splice(index + 1, 0, transportPCELink);
+ } else {
+ menuItems.push(transportPCELink);
+ }
}
+
return (
<Drawer
|