From f4e72cc83c431285dee454b6201377871dbed09a Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Mon, 22 Apr 2024 22:07:48 +0100 Subject: [GIFs] Add error boundary to GIF picker (#3643) * error boundary on gif picker * add dialog.close for web users * fix size of dialog on web * Safer coercion --------- Co-authored-by: Dan Abramov --- src/components/dialogs/GifSelect.tsx | 37 +++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'src/components/dialogs/GifSelect.tsx') diff --git a/src/components/dialogs/GifSelect.tsx b/src/components/dialogs/GifSelect.tsx index baff31168..ad4fbeade 100644 --- a/src/components/dialogs/GifSelect.tsx +++ b/src/components/dialogs/GifSelect.tsx @@ -13,6 +13,8 @@ import { useSetExternalEmbedPref, } from '#/state/preferences' import {Gif, useGifphySearch, useGiphyTrending} from '#/state/queries/giphy' +import {ErrorScreen} from '#/view/com/util/error/ErrorScreen' +import {ErrorBoundary} from '#/view/com/util/ErrorBoundary' import {atoms as a, useBreakpoints, useTheme} from '#/alf' import * as Dialog from '#/components/Dialog' import * as TextField from '#/components/forms/TextField' @@ -54,13 +56,18 @@ export function GifSelectDialog({ break } + const renderErrorBoundary = useCallback( + (error: any) => , + [], + ) + return ( - {content} + {content} ) } @@ -357,3 +364,31 @@ function GiphyConsentPrompt({control}: {control: Dialog.DialogControlProps}) { ) } + +function DialogError({details}: {details?: string}) { + const {_} = useLingui() + const control = Dialog.useDialogContext() + + return ( + + + + + + ) +} -- cgit 1.4.1