Skip to content

Commit

Permalink
feat: dark mode logo
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Jun 26, 2024
1 parent d789faa commit d9c1bf0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/theme/Footer/Copyright/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Copyright from "@theme-original/Footer/Copyright";
import type CopyrightType from "@theme/Footer/Copyright";
import type { WrapperProps } from "@docusaurus/types";
import styles from "./index.module.css";
import socialLinks from "../../../../config/social-links.json";
import socialLinks from "@site/config/social-links.json";
import Logo from "@site/src/theme/logo";

type Props = WrapperProps<typeof CopyrightType>;

Expand All @@ -12,7 +13,9 @@ export default function CopyrightWrapper(props: Props): JSX.Element {
<>
<div className={styles.wrap}>
<div className={styles.copyright}>
<img className={styles.logo} src="/img/Logo.aelf.svg" />
<div className={styles.logo}>
<Logo />
</div>
<Copyright {...props} />
</div>
<div className={styles.social}>
Expand Down
3 changes: 2 additions & 1 deletion src/theme/Footer/Links/MultiColumn/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import LinkItem from "@theme/Footer/LinkItem";
import type { Props } from "@theme/Footer/Links/MultiColumn";
import Logo from "@site/src/theme/logo";

type ColumnType = Props["columns"][number];
type ColumnItemType = ColumnType["items"][number];
Expand Down Expand Up @@ -39,7 +40,7 @@ export default function FooterLinksMultiColumn({
return (
<div className="row footer__links">
<div className="col footer__col mobile-hidden">
<img src="/img/Logo.aelf.svg" />
<Logo />
</div>
{columns.map((column, i) => (
<Column key={i} column={column} />
Expand Down
18 changes: 18 additions & 0 deletions src/theme/logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import ThemedImage from "@theme/ThemedImage";
import useBaseUrl from "@docusaurus/useBaseUrl";

/**
* Reference: https://docusaurus.io/docs/markdown-features/assets#themed-images
*/
export default function Logo(): JSX.Element {
return (
<ThemedImage
alt="aelf"
sources={{
light: useBaseUrl("/img/Logo.aelf.svg"),
dark: useBaseUrl("/img/Logo.aelf.white.svg"),
}}
/>
);
}

0 comments on commit d9c1bf0

Please sign in to comment.