Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | import React from 'react';
import { Story } from '@storybook/react';
import PhotoChooser, { PhotoChooserProps } from '../components/PhotoChooser';
export default {
title: 'PhotoChooser',
component: PhotoChooser,
};
const Template: Story<PhotoChooserProps> = (args) => {
return <PhotoChooser {...args} />;
};
export const Default = Template.bind({});
Default.args = {
onPhotosChanged: (data) => data.length && window.alert('Photo selected!'),
multipleSelection: false,
uploadText: 'Upload a photo',
uploadDescription: 'Select any photo from your device',
photoSelectedText: 'Photo selected',
chooseFileText: 'Choose file',
replaceFileText: 'Replace file',
};
export const Multiple = Template.bind({});
Multiple.args = {
onPhotosChanged: (data) => data.length && window.alert(`${data.length} photos changed (added or deleted)`),
multipleSelection: true,
uploadText: 'Upload a photo',
uploadDescription: 'Select any photo from your device',
photoSelectedText: 'Photo selected',
chooseFileText: 'Choose file',
replaceFileText: 'Replace file',
error: { title: 'Select photos please', text: 'Error selecting' },
};
|