From 347cf6650979dcce797afe619b0a26f42123f011 Mon Sep 17 00:00:00 2001 From: Narin Ratana Date: Tue, 6 Aug 2024 20:55:21 -0700 Subject: [PATCH] New story for offset example. Fix onHide --- .../components/Snackbar/Snackbar.stories.tsx | 35 ++++++++++++------- .../src/components/Snackbar/Snackbar.tsx | 2 +- .../components/Snackbar/SnackbarProvider.tsx | 1 - 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/packages/components/src/components/Snackbar/Snackbar.stories.tsx b/packages/components/src/components/Snackbar/Snackbar.stories.tsx index 1501c6b3..dcd2e070 100644 --- a/packages/components/src/components/Snackbar/Snackbar.stories.tsx +++ b/packages/components/src/components/Snackbar/Snackbar.stories.tsx @@ -35,41 +35,50 @@ export default meta type Story = StoryObj +const isWeb = Platform.OS !== 'web' + const mobileComponentRenderer = (props: SnackbarProps) => { - const { isError, messageA11y, onActionPressed } = props.data || {} + const { isError, messageA11y, onActionPressed, offset } = props.data || {} const { show } = useSnackbar() - const onPressSnackbarOffset = () => { - show(props.message as string, { - isError, - messageA11y, - onActionPressed, - offset: 500, - }) - } - const onPressSnackbar = () => { show(props.message as string, { isError, messageA11y, onActionPressed, + offset, }) } + return ( <> -