Skip to content

Commit

Permalink
feat: adjust card story (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyhw authored Nov 11, 2021
1 parent b47c859 commit 1303714
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
16 changes: 9 additions & 7 deletions stories/libraries/Paper/Card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ import React from 'react';
import { ComponentMeta, ComponentStoryObj } from '@storybook/react';
import { Provider as PaperProvider, DefaultTheme } from 'react-native-paper';
import { Card } from './Card';
import { View } from 'react-native';

export default {
component: Card,
decorators: [
(Story) => (
<PaperProvider theme={DefaultTheme}>
<Story />
</PaperProvider>
),
],

render: (args) => (
<PaperProvider theme={DefaultTheme}>
<View style={{ width: 480 }}>
<Card {...args} />
</View>
</PaperProvider>
),
} as ComponentMeta<typeof Card>;

export const Basic: ComponentStoryObj<typeof Card> = {
Expand Down
5 changes: 4 additions & 1 deletion stories/libraries/Paper/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export const Card = ({ title, content, onCancel, onConfirm }: CardProps) => (
<PaperCard.Content>
<Paragraph>{content}</Paragraph>
</PaperCard.Content>
<PaperCard.Cover source={{ uri: 'https://picsum.photos/700' }} />
<PaperCard.Cover
source={{ uri: require('./picture.png') }}
resizeMethod='scale'
/>
<PaperCard.Actions>
<Button onPress={onCancel}>Cancel</Button>
<Button onPress={onConfirm}>Ok</Button>
Expand Down
Binary file added stories/libraries/Paper/picture.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 1303714

Please sign in to comment.