Skip to content

Commit

Permalink
Upgrade and use Dark Mode nav (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs authored Sep 6, 2024
1 parent 07fb891 commit 81abbf4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 9 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@leafygreen-ui/palette": "^3.4.4",
"@mdb/consistent-nav": "^2.0.3-rc.15",
"@mdb/consistent-nav": "^2.2.0",
"@mdb/flora": "^1.5.6",
"@mdx-js/react": "^1.6.22",
"@redocly/openapi-core": "^1.0.0-beta.104",
Expand Down
17 changes: 16 additions & 1 deletion src/components/Redoc/Redoc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,22 @@ export class Redoc extends React.Component<RedocProps> {
<OptionsProvider value={options}>
<GlobalCss />
<StyledHeader>
<UnifiedNav position="relative" property={{ name: 'DOCS', searchParams: [] }} />
<UnifiedNav
position="relative"
property={{ name: 'DOCS', searchParams: [] }}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
darkMode={false}
className="nav-light"
/>
<UnifiedNav
position="relative"
property={{ name: 'DOCS', searchParams: [] }}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
darkMode={true}
className="nav-dark"
/>
</StyledHeader>
<RedocWrap className="redoc-wrap">
<StickyResponsiveSidebar menu={menu} className="menu-content">
Expand Down
16 changes: 16 additions & 0 deletions src/globalStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,20 @@ export const globalStyles = `
--callbacks-title-outline: #3e647c;
--callbacks-details-bg: ${palette.gray.dark3};
}
.nav-dark {
display: none;
}
.nav-light {
display: initial;
}
.dark-theme .nav-dark {
display: initial;
}
.dark-theme .nav-light {
display: none;
}
`;

0 comments on commit 81abbf4

Please sign in to comment.