Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adjust card story #6

Merged
merged 1 commit into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.