Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions pkg/app/web/src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
PAGE_PATH_SETTINGS,
PAGE_PATH_LOGIN,
} from "../constants";
import { Link as RouterLink } from "react-router-dom";
import { NavLink as RouterLink } from "react-router-dom";
import { useMe } from "../modules/me";
import ArrowDownIcon from "@material-ui/icons/ArrowDropDown";

Expand All @@ -34,9 +34,6 @@ const useStyles = makeStyles((theme) => ({
width: theme.spacing(4),
height: theme.spacing(4),
},
link: {
marginRight: theme.spacing(2),
},
userAvatar: {
width: theme.spacing(4),
height: theme.spacing(4),
Expand All @@ -45,6 +42,16 @@ const useStyles = makeStyles((theme) => ({
marginLeft: theme.spacing(1),
textTransform: "none",
},
link: {
marginRight: theme.spacing(2),
display: "inline-flex",
height: "100%",
alignItems: "center",
},
activeLink: {
fontWeight: "bold",
borderBottom: `2px solid ${theme.palette.background.paper}`,
},
}));

export const Header: FC = memo(function Header() {
Expand All @@ -70,6 +77,7 @@ export const Header: FC = memo(function Header() {
<Link
component={RouterLink}
className={classes.link}
activeClassName={classes.activeLink}
color="inherit"
to={PAGE_PATH_APPLICATIONS}
>
Expand All @@ -78,6 +86,7 @@ export const Header: FC = memo(function Header() {
<Link
component={RouterLink}
className={classes.link}
activeClassName={classes.activeLink}
color="inherit"
to={PAGE_PATH_DEPLOYMENTS}
>
Expand All @@ -86,6 +95,7 @@ export const Header: FC = memo(function Header() {
<Link
component={RouterLink}
className={classes.link}
activeClassName={classes.activeLink}
color="inherit"
to={PAGE_PATH_INSIGHTS}
>
Expand All @@ -94,6 +104,7 @@ export const Header: FC = memo(function Header() {
<Link
component={RouterLink}
className={classes.link}
activeClassName={classes.activeLink}
color="inherit"
to={PAGE_PATH_SETTINGS}
>
Expand Down
8 changes: 6 additions & 2 deletions pkg/app/web/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EntityId } from "@reduxjs/toolkit";
import React, { FC, memo, useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { Route, Switch } from "react-router-dom";
import { Route, Switch, Redirect } from "react-router-dom";
import { Header } from "../components/header";
import { Toasts } from "../components/toasts";
import {
Expand Down Expand Up @@ -77,7 +77,11 @@ export const Pages: FC = memo(function Pages() {
<>
<Header />
<Switch>
<Route exact path={PAGE_PATH_TOP} component={ApplicationIndexPage} />
<Route
exact
path={PAGE_PATH_TOP}
component={() => <Redirect to={PAGE_PATH_APPLICATIONS} />}
/>
<Route exact path={PAGE_PATH_LOGIN} component={LoginPage} />
<Route
exact
Expand Down