diff --git a/apps/mobile/src/components/Gallery/DeleteGalleryBottomSheet.tsx b/apps/mobile/src/components/Gallery/DeleteGalleryBottomSheet.tsx new file mode 100644 index 0000000000..3458435190 --- /dev/null +++ b/apps/mobile/src/components/Gallery/DeleteGalleryBottomSheet.tsx @@ -0,0 +1,73 @@ +import { useCallback } from 'react'; +import { View } from 'react-native'; +import { graphql, useFragment } from 'react-relay'; +import useDeleteGallery from 'shared/hooks/useDeleteGallery'; + +import { Button } from '~/components/Button'; +import { Typography } from '~/components/Typography'; +import { useBottomSheetModalActions } from '~/contexts/BottomSheetModalContext'; +import { DeleteGalleryBottomSheet$key } from '~/generated/DeleteGalleryBottomSheet.graphql'; +import { contexts } from '~/shared/analytics/constants'; + +type Props = { + galleryRef: DeleteGalleryBottomSheet$key; +}; + +export default function DeleteGalleryBottomSheet({ galleryRef }: Props) { + const gallery = useFragment( + graphql` + fragment DeleteGalleryBottomSheet on Gallery { + dbid + } + `, + galleryRef + ); + const deleteGallery = useDeleteGallery(); + const { hideBottomSheetModal } = useBottomSheetModalActions(); + + const handleBack = useCallback(() => { + hideBottomSheetModal(); + }, [hideBottomSheetModal]); + + const handleDelete = useCallback(() => { + deleteGallery(gallery.dbid); + hideBottomSheetModal(); + }, [deleteGallery, gallery, hideBottomSheetModal]); + + return ( + + + + Delete gallery + + + Are you sure you want to delete this gallery? + + + + +