Skip to content

Commit

Permalink
docs(home): add dynamic banner (#658)
Browse files Browse the repository at this point in the history
adds dynamic themed banner to home

task: none
  • Loading branch information
idea404 authored Mar 26, 2024
1 parent 511ccf4 commit 45c4c04
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/site/docs/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ slug: /
---

import TestnetCTA from '@site/src/components/TestnetCTA/TestnetCTA';
import ThemedBanner from '@site/src/components/ThemedBanner/ThemedBanner';

# Home
#

![omni banner](../static/img/omni-banner.png)
<ThemedBanner
lightSrc="/img/light-banner.png"
darkSrc="/img/dark-banner.png"
alt="Omni banner"
/>

#

### _Welcome to the documentation portal for all things Omni!_

Expand Down
12 changes: 12 additions & 0 deletions docs/site/src/components/ThemedBanner/ThemedBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import { useColorMode } from '@docusaurus/theme-common';


function ThemedImage({ lightSrc, darkSrc, alt }) {
const { colorMode } = useColorMode();
const src = colorMode === 'dark' ? darkSrc : lightSrc;

return <img src={src} alt={alt} />;
}

export default ThemedImage;
Binary file added docs/site/static/img/dark-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/site/static/img/light-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 45c4c04

Please sign in to comment.