2023-06-26 10:07:12 +00:00
|
|
|
"use client";
|
|
|
|
|
|
2023-02-13 13:46:56 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
|
import Link from "next/link";
|
2023-05-25 12:37:14 +00:00
|
|
|
import Image from "next/legacy/image";
|
2023-02-13 13:46:56 +00:00
|
|
|
import { AppBar, Grid, Box } from "@mui/material";
|
|
|
|
|
import { useTranslate } from "react-polyglot";
|
|
|
|
|
import LeafcutterLogo from "images/leafcutter-logo.png";
|
2023-08-25 07:11:33 +00:00
|
|
|
import { AccountButton } from "./AccountButton";
|
|
|
|
|
import { HelpButton } from "./HelpButton";
|
2024-06-05 08:52:41 +02:00
|
|
|
import { Tooltip } from "@link-stack/leafcutter-ui";
|
|
|
|
|
import { useLeafcutterContext } from "@link-stack/leafcutter-ui/components/LeafcutterProvider";
|
2023-02-13 13:46:56 +00:00
|
|
|
// import { LanguageSelect } from "./LanguageSelect";
|
|
|
|
|
|
|
|
|
|
export const TopNav: FC = () => {
|
|
|
|
|
const t = useTranslate();
|
|
|
|
|
const {
|
|
|
|
|
colors: { white, leafcutterElectricBlue, cdrLinkOrange },
|
|
|
|
|
typography: { h5, h6 },
|
2024-03-20 17:51:21 +01:00
|
|
|
} = useLeafcutterContext();
|
2023-02-13 13:46:56 +00:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<AppBar
|
|
|
|
|
position="fixed"
|
|
|
|
|
elevation={1}
|
|
|
|
|
sx={{
|
|
|
|
|
backgroundColor: white,
|
|
|
|
|
marginBottom: 180,
|
|
|
|
|
opacity: 0.95,
|
|
|
|
|
pt: 2,
|
|
|
|
|
pb: 2,
|
|
|
|
|
pr: 3,
|
|
|
|
|
pl: 6,
|
|
|
|
|
backdropFilter: "blur(10px)",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Grid
|
|
|
|
|
container
|
|
|
|
|
justifyContent="space-between"
|
|
|
|
|
alignItems="center"
|
|
|
|
|
alignContent="center"
|
|
|
|
|
direction="row"
|
|
|
|
|
wrap="nowrap"
|
|
|
|
|
spacing={4}
|
|
|
|
|
>
|
2023-08-25 07:11:33 +00:00
|
|
|
<Grid
|
|
|
|
|
item
|
|
|
|
|
container
|
|
|
|
|
direction="row"
|
|
|
|
|
justifyContent="flex-start"
|
|
|
|
|
alignItems="center"
|
|
|
|
|
alignContent="center"
|
|
|
|
|
spacing={1}
|
|
|
|
|
wrap="nowrap"
|
|
|
|
|
sx={{ cursor: "pointer" }}
|
|
|
|
|
>
|
|
|
|
|
<Grid item sx={{ pr: 1 }}>
|
|
|
|
|
<Image src={LeafcutterLogo} alt="" width={56} height={52} />
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item container direction="column" alignContent="flex-start">
|
|
|
|
|
<Grid item sx={{ mt: -1 }}>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
...h5,
|
|
|
|
|
color: leafcutterElectricBlue,
|
|
|
|
|
p: 0,
|
|
|
|
|
m: 0,
|
|
|
|
|
pt: 1,
|
|
|
|
|
textAlign: "left",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
Leafcutter
|
|
|
|
|
</Box>
|
2023-02-13 13:46:56 +00:00
|
|
|
</Grid>
|
2023-08-25 07:11:33 +00:00
|
|
|
<Grid item>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
...h6,
|
|
|
|
|
m: 0,
|
|
|
|
|
p: 0,
|
|
|
|
|
color: cdrLinkOrange,
|
|
|
|
|
textAlign: "left",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
A Project of Center for Digital Resilience
|
|
|
|
|
</Box>
|
2023-02-13 13:46:56 +00:00
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
2023-08-25 07:11:33 +00:00
|
|
|
</Grid>
|
|
|
|
|
|
2023-02-13 13:46:56 +00:00
|
|
|
<Grid item>
|
|
|
|
|
<HelpButton />
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
{/* <Tooltip
|
|
|
|
|
title={t("languageOptionsCardTitle")}
|
|
|
|
|
description={t("languageOptionsCardDescription")}
|
|
|
|
|
emoji="✍️"
|
|
|
|
|
tooltipID="language"
|
|
|
|
|
placement="bottom"
|
|
|
|
|
>
|
|
|
|
|
<Grid item>
|
|
|
|
|
<LanguageSelect />
|
|
|
|
|
</Grid>
|
|
|
|
|
</Tooltip> */}
|
|
|
|
|
<Tooltip
|
|
|
|
|
title={t("profileSettingsCardTitle")}
|
|
|
|
|
description={t("profileSettingsCardDescription")}
|
|
|
|
|
tooltipID="profile"
|
|
|
|
|
placement="bottom"
|
|
|
|
|
previousURL="/?tooltip=recentUpdates"
|
|
|
|
|
nextURL="/create?tooltip=searchCreate"
|
|
|
|
|
>
|
|
|
|
|
<Grid item>
|
|
|
|
|
<AccountButton />
|
|
|
|
|
</Grid>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</Grid>
|
|
|
|
|
</AppBar>
|
|
|
|
|
);
|
|
|
|
|
};
|