From 2a980d76fb10b7374234bd6325bef14285e591f8 Mon Sep 17 00:00:00 2001 From: oynikishin Date: Tue, 26 Nov 2024 11:57:10 +0300 Subject: [PATCH] feat(Popup)!: fix FilePreview local storybook for test --- .../__stories__/FilePreview.stories.tsx | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/src/components/FilePreview/__stories__/FilePreview.stories.tsx b/src/components/FilePreview/__stories__/FilePreview.stories.tsx index bd2caf7c19..aea550e359 100644 --- a/src/components/FilePreview/__stories__/FilePreview.stories.tsx +++ b/src/components/FilePreview/__stories__/FilePreview.stories.tsx @@ -102,6 +102,14 @@ const CollageTemplate: StoryFn = () => { export const Collage = CollageTemplate.bind({}); +const noClickableTemplateActions = [ + { + icon: , + onClick: () => action('Are you sure you want to delete the file?'), + title: 'Close', + }, +]; + const NoClickableTemplate: StoryFn> = (args) => { return ( @@ -109,25 +117,13 @@ const NoClickableTemplate: StoryFn> = (args) = , - onClick: () => action('Are you sure you want to delete the file?'), - title: 'Close', - }, - ]} + actions={noClickableTemplateActions} /> action('onClick')} - actions={[ - { - icon: , - onClick: () => action('Are you sure you want to delete the file?'), - title: 'Close', - }, - ]} + actions={noClickableTemplateActions} /> ); @@ -135,6 +131,17 @@ const NoClickableTemplate: StoryFn> = (args) = export const NoClickable = NoClickableTemplate.bind({}); +const withoutActionTooltipTemplateActions = [ + { + icon: , + onClick: () => action('onClose'), + title: 'Close', + tooltipExtraProps: { + disabled: true, + }, + }, +]; + const WithoutActionTooltipTemplate: StoryFn> = (args) => { return ( @@ -142,16 +149,7 @@ const WithoutActionTooltipTemplate: StoryFn> = {...args} file={{name: 'Clicable without tooltip', type: 'text/docs'} as File} onClick={() => action('onClick')} - actions={[ - { - icon: , - onClick: () => action('onClose'), - title: 'Close', - tooltipExtraProps: { - disabled: true, - }, - }, - ]} + actions={withoutActionTooltipTemplateActions} /> );