Skip to content

Commit

Permalink
refine(layout/header): only enable download nav for zh doc (#479)
Browse files Browse the repository at this point in the history
* fix(layout): fix typo

* refine(layout/header): only enable download nav for zh doc
  • Loading branch information
Yuiham authored Apr 26, 2024
1 parent b7ea268 commit 2e722cc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 35 deletions.
67 changes: 34 additions & 33 deletions src/components/Layout/HeaderNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,31 +96,30 @@ export default function HeaderNavStack(props: { buildType?: BuildType }) {
)}

{["zh", "en"].includes(language) && (
<NavItem
label={t("navbar.asktug")}
to={generateAskTugUrl(language)}
/>
<NavItem label={t("navbar.asktug")} to={generateAskTugUrl(language)} />
)}

<NavItem
label={t("navbar.contactUs")}
to={generateContactURL(language)}
/>

<NavItem
// label={<Trans i18nKey="navbar.download" />}
to={generateDownloadURL(language)}
alt="download"
startIcon={
<DownloadIcon
fontSize="inherit"
color="inherit"
sx={{
paddingTop: "0.5rem",
}}
/>
}
/>
{language === "zh" && (
<NavItem
// label={<Trans i18nKey="navbar.download" />}
to={generateDownloadURL(language)}
alt="download"
startIcon={
<DownloadIcon
fontSize="inherit"
color="inherit"
sx={{
paddingTop: "0.5rem",
}}
/>
}
/>
)}
</Stack>
);
}
Expand Down Expand Up @@ -323,21 +322,23 @@ export function HeaderNavStackMobile(props: { buildType?: BuildType }) {
</MenuItem>
)}

<MenuItem onClick={handleClose} disableRipple>
<LinkComponent
to={generateDownloadURL(language)}
style={{ width: "100%" }}
onClick={() =>
gtmTrack(GTMEvent.ClickHeadNav, {
item_name: t("navbar.download"),
})
}
>
<Typography variant="body1" component="div" color="website.f1">
<Trans i18nKey="navbar.download" />
</Typography>
</LinkComponent>
</MenuItem>
{language === "zh" && (
<MenuItem onClick={handleClose} disableRipple>
<LinkComponent
to={generateDownloadURL(language)}
style={{ width: "100%" }}
onClick={() =>
gtmTrack(GTMEvent.ClickHeadNav, {
item_name: t("navbar.download"),
})
}
>
<Typography variant="body1" component="div" color="website.f1">
<Trans i18nKey="navbar.download" />
</Typography>
</LinkComponent>
</MenuItem>
)}

{["zh", "en"].includes(language) && (
<MenuItem onClick={handleClose} disableRipple>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Layout/MDXContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MDXRenderer } from "gatsby-plugin-mdx";
import Container from "@mui/material/Container";
import Box from "@mui/material/Box";

import * as MDXConponents from "components/MDXComponents";
import * as MDXComponents from "components/MDXComponents";
import {
CustomNotice,
MachineTranslationNotice,
Expand Down Expand Up @@ -76,7 +76,7 @@ export default function MDXContent(props: {
)}
<MDXProvider
components={{
...MDXConponents,
...MDXComponents,
Link,
pre: Pre,
}}
Expand Down

0 comments on commit 2e722cc

Please sign in to comment.