diff --git a/Storybook/components/Dialog/Dialog.stories.tsx b/Storybook/components/Dialog/Dialog.stories.tsx index 8d1e85a8..2cb6681c 100644 --- a/Storybook/components/Dialog/Dialog.stories.tsx +++ b/Storybook/components/Dialog/Dialog.stories.tsx @@ -3,6 +3,7 @@ import React from 'react'; import { StyleSheet, View } from 'react-native'; import { Body, Dialog, useTheme } from 'smartway-react-native-ui'; +import { IconsName } from '../config/IconList'; type DialogPropsAndCustomArgs = React.ComponentProps & { haveSecondButton?: boolean; @@ -15,6 +16,8 @@ export default { variant: 'left', haveSecondButton: false, title: 'Headline', + name: undefined, + color: 'red', }, argTypes: { variant: { @@ -24,11 +27,17 @@ export default { haveSecondButton: { control: { type: 'boolean' }, }, + name: { control: { type: 'select' }, options: IconsName }, + color: { control: { type: 'color' } }, }, decorators: [ (Story) => { const styles = StyleSheet.create({ - container: { alignItems: 'center', justifyContent: 'center', flex: 1 }, + container: { + alignItems: 'center', + justifyContent: 'center', + flex: 1, + }, }); return ( @@ -70,17 +79,23 @@ const InsideDialog = ({ variantBody }: { variantBody?: 'left' | 'center' }) => { }, }); return ( - - A dialog is a type of modal window that appears in front of app content to provide - critical information. This is a dialog content example. + + A dialog is a type of modal window that appears in front of app + content to provide critical information. This is a dialog content + example. ); }; export const Default: Story = { render: (args) => { + const iconprops = args.name !== undefined && { + name: args.name, + color: args.color ?? undefined, + }; return ( void; @@ -72,8 +80,14 @@ export const Dialog = (props: DialogProps) => { dismissable={props.dismissable} style={styles.dialog} > + {props.icon && ( + + )} - + {props.title} @@ -81,7 +95,7 @@ export const Dialog = (props: DialogProps) => { {props.actions.cancel && ( )}