Skip to content

Commit

Permalink
chore: update docs image
Browse files Browse the repository at this point in the history
[skip-native]
  • Loading branch information
jordmccord committed Oct 31, 2024
1 parent 243098b commit d3d3fc1
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 3 deletions.
15 changes: 15 additions & 0 deletions apps/native-ui-storybook/docs/components/DynamicImage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { useColorMode } from '@utilitywarehouse/native-ui';
import React, { FC } from 'react';

interface DynamicImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
lightSrc: React.ImgHTMLAttributes<HTMLImageElement>['src'];
darkSrc: React.ImgHTMLAttributes<HTMLImageElement>['src'];
}

const DynamicImage: FC<DynamicImageProps> = ({ lightSrc, darkSrc, ...props }) => {
const colorMode = useColorMode();

return <img src={colorMode === 'light' ? lightSrc : darkSrc} {...props} />;
};

export default DynamicImage;
1 change: 1 addition & 0 deletions apps/native-ui-storybook/docs/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export { default as ScrollWrap } from './ScrollWrap';
export { default as VariantTitle } from './VariantTitle';
export { default as AllComponents } from './AllComponents';
export { default as DocComponentWrap } from './DocComponentWrap';
export { default as DynamicImage } from './DynamicImage';
Binary file not shown.
19 changes: 16 additions & 3 deletions apps/native-ui-storybook/docs/native-ui/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
import { Meta } from '@storybook/blocks';
import { version } from '../../../../packages/native-ui/package.json';
import img from './gardening.png';
import img from './phone-light.png';
import imgDark from './phone-dark.png';
import { DynamicImage } from '../components';
import { Box } from '@utilitywarehouse/native-ui/lab';

<Meta title="Native UI / Introduction" />

<img src={img} alt="UW Design Systems Gardeners" title="UW Design Systems Gardeners" width="600" />
<Box alignItems='center'>
<DynamicImage
width={500}
height="auto"
alt="UW Design Systems - Native UI"
title="UW - Native UI"
darkSrc={imgDark}
lightSrc={img}
/>

# UW - Native UI

React component library for building Native UIs at UW.
React Native component library for building UIs at UW.

</Box>

Current version: v{version}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 d3d3fc1

Please sign in to comment.