diff --git a/src/components/AppBar/AppBarComponent.tsx b/src/components/AppBar/AppBarComponent.tsx index 36fe16f35a..8564ba195b 100644 --- a/src/components/AppBar/AppBarComponent.tsx +++ b/src/components/AppBar/AppBarComponent.tsx @@ -7,6 +7,7 @@ import { appBarHeight } from "components/AppBar/AppBarTypes"; import Logo from "components/AppBar/Logo"; import NavigationButtons from "components/AppBar/NavigationButtons"; import ProjectButtons from "components/AppBar/ProjectButtons"; +import UserGuideButton from "components/AppBar/UserGuideButton"; import UserMenu from "components/AppBar/UserMenu"; import { topBarHeight } from "components/LandingPage/TopBar"; import DownloadButton from "components/ProjectExport/DownloadButton"; @@ -41,6 +42,7 @@ export default function AppBarComponent(): ReactElement { + diff --git a/src/components/AppBar/NavigationButtons.tsx b/src/components/AppBar/NavigationButtons.tsx index 2d01ce31c3..5017200c9a 100644 --- a/src/components/AppBar/NavigationButtons.tsx +++ b/src/components/AppBar/NavigationButtons.tsx @@ -1,4 +1,5 @@ -import { Button } from "@mui/material"; +import { PlaylistAdd, Rule } from "@mui/icons-material"; +import { Button, Hidden, Tooltip, Typography } from "@mui/material"; import { ReactElement } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; @@ -15,21 +16,23 @@ import { useWindowSize } from "utilities/useWindowSize"; export const dataEntryButtonId = "data-entry"; export const dataCleanupButtonId = "data-cleanup"; -const navButtonMaxWidthProportion = 0.12; +const navButtonMaxWidthProportion = 0.2; -/** A button that redirects to the home page */ +/** Buttons for navigating to Data Entry and Data Cleanup */ export default function NavigationButtons(props: TabProps): ReactElement { return ( <> } targetPath={Path.DataEntry} textId="appBar.dataEntry" /> } targetPath={Path.Goals} textId="appBar.dataCleanup" /> @@ -39,6 +42,7 @@ export default function NavigationButtons(props: TabProps): ReactElement { interface NavButtonProps extends TabProps { buttonId: string; + icon: ReactElement; targetPath: Path; textId: string; } @@ -60,10 +64,16 @@ function NavButton(props: NavButtonProps): ReactElement { maxHeight: appBarHeight, maxWidth: navButtonMaxWidthProportion * windowWidth, minHeight: buttonMinHeight, + minWidth: 0, width: "fit-content", }} > - {t(props.textId)} + {props.icon} + + + {t(props.textId)} + + ); } diff --git a/src/components/AppBar/ProjectButtons.tsx b/src/components/AppBar/ProjectButtons.tsx index 275009cc2b..0661cc04d0 100644 --- a/src/components/AppBar/ProjectButtons.tsx +++ b/src/components/AppBar/ProjectButtons.tsx @@ -21,10 +21,9 @@ export const projButtonId = "project-settings"; export const statButtonId = "project-statistics"; const enum projNameLength { - sm = 15, - md = 25, - lg = 45, - xl = 75, + md = 17, + lg = 34, + xl = 51, } export async function getHasStatsPermission(): Promise { @@ -52,14 +51,14 @@ export default function ProjectButtons(props: TabProps): ReactElement { {hasStatsPermission && ( diff --git a/src/components/AppBar/UserGuideButton.tsx b/src/components/AppBar/UserGuideButton.tsx new file mode 100644 index 0000000000..1e6cb45919 --- /dev/null +++ b/src/components/AppBar/UserGuideButton.tsx @@ -0,0 +1,30 @@ +import { Info } from "@mui/icons-material"; +import { Button, Tooltip } from "@mui/material"; +import { ReactElement } from "react"; +import { useTranslation } from "react-i18next"; + +import { buttonMinHeight } from "components/AppBar/AppBarTypes"; +import { themeColors } from "types/theme"; +import { openUserGuide } from "utilities/pathUtilities"; + +export default function UserGuideButton(): ReactElement { + const { t } = useTranslation(); + + return ( + + + + ); +} diff --git a/src/components/AppBar/UserMenu.tsx b/src/components/AppBar/UserMenu.tsx index a091f587ac..1a256d6db5 100644 --- a/src/components/AppBar/UserMenu.tsx +++ b/src/components/AppBar/UserMenu.tsx @@ -1,6 +1,6 @@ import { ExitToApp, - Help, + Info, Person, SettingsApplications, } from "@mui/icons-material"; @@ -33,9 +33,8 @@ import { openUserGuide } from "utilities/pathUtilities"; const idAffix = "user-menu"; const enum usernameLength { - md = 13, - lg = 19, - xl = 25, + lg = 12, + xl = 24, } export async function getIsAdmin(): Promise { @@ -70,26 +69,23 @@ export default function UserMenu(props: TabProps): ReactElement { @@ -177,7 +173,7 @@ export function UserMenuList(props: UserMenuListProps): ReactElement { props.onSelect(); }} > - + {t("userMenu.userGuide")} @@ -193,8 +189,8 @@ export function UserMenuList(props: UserMenuListProps): ReactElement { {combineAppRelease}