-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
271 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import type {Meta, StoryObj} from '@storybook/react'; | ||
import {Typography} from './Typography'; | ||
import {withThemeProvider} from '../../../../.storybook/decorators'; | ||
import {ScrollView, View} from 'react-native'; | ||
import {ThemeParam} from '../../../utils/theme'; | ||
|
||
const meta = { | ||
title: 'Typography', | ||
component: Typography.Title, | ||
decorators: [ | ||
(Story, context) => | ||
withThemeProvider( | ||
Story, | ||
context, | ||
(context.args.theme as any) || undefined, | ||
), | ||
], | ||
} satisfies Meta<typeof Typography.Title>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const AllTypography: Story = { | ||
render: (args) => ( | ||
<ScrollView contentContainerStyle={{padding: 16}}> | ||
{Object.entries(Typography).map(([key, Component]) => ( | ||
<View key={key} style={{marginBottom: 16}}> | ||
<Component {...args}> | ||
{key} {args.children} | ||
</Component> | ||
</View> | ||
))} | ||
</ScrollView> | ||
), | ||
args: { | ||
children: 'Hello world', | ||
}, | ||
}; | ||
|
||
export const CustomTitle: Story = { | ||
args: { | ||
children: 'Custom Color', | ||
// @ts-ignore | ||
theme: { | ||
light: { | ||
text: { | ||
basic: 'blue', | ||
}, | ||
}, | ||
dark: { | ||
text: { | ||
basic: 'skyblue', | ||
}, | ||
}, | ||
} as ThemeParam, | ||
}, | ||
}; |
Oops, something went wrong.