diff --git a/components/pages/grocery/GroceryList.tsx b/components/pages/grocery/GroceryList.tsx index be9f166..0fe5186 100644 --- a/components/pages/grocery/GroceryList.tsx +++ b/components/pages/grocery/GroceryList.tsx @@ -74,7 +74,7 @@ const GroceryList = ({onInputFocus}: {onInputFocus: (y: number) => void}) => { }, [groceries]); return ( - + void; + onFirstYes: () => void; + onConfirm: () => void; +} + +const DeleteProfileDialogs: React.FC = ({ + visible, + onDismiss, + onFirstYes, + onConfirm, +}) => { + const [confirmationDialog, setConfirmationDialog] = useState(false); + return ( + <> + + + + + + Are you sure? + + + This action will permanently delete all your data, you won't be able + to recover it! + + + + + setConfirmationDialog(false)} + containerStyle={styles.dialog} + > + + + We're sorry to see you go, are you really sure you want to delete + everything? + + + + + ); +}; + +// Empty stylesheet for future styles +const styles = StyleSheet.create({ + confirmBtn: { + backgroundColor: "#FF5449", + }, + cancelBtn: { + backgroundColor: "white", + }, + dialog: { + backgroundColor: "white", + paddingHorizontal: 25, + paddingTop: 25, + paddingBottom: 17, + borderRadius: 20, + }, + title: { + fontFamily: "Manrope_600SemiBold", + fontSize: 22, + marginBottom: 5, + }, + text: { + fontFamily: "PlusJakartaSans_400Regular", + fontSize: 16, + marginBottom: 0, + }, +}); + +export default DeleteProfileDialogs; diff --git a/components/pages/settings/user_settings_views/MyProfile.tsx b/components/pages/settings/user_settings_views/MyProfile.tsx index 869c619..5a8f9a7 100644 --- a/components/pages/settings/user_settings_views/MyProfile.tsx +++ b/components/pages/settings/user_settings_views/MyProfile.tsx @@ -3,6 +3,7 @@ import { StyleSheet, TouchableOpacity } from "react-native"; import { ScrollView } from "react-native-gesture-handler"; import * as ImagePicker from "expo-image-picker"; import { + Button, Colors, Image, Picker, @@ -18,6 +19,7 @@ import { useAuthContext } from "@/contexts/AuthContext"; import { useUpdateUserData } from "@/hooks/firebase/useUpdateUserData"; import { useChangeProfilePicture } from "@/hooks/firebase/useChangeProfilePicture"; import { colorMap } from "@/constants/colorMap"; +import DeleteProfileDialogs from "../user_components/DeleteProfileDialogs"; const MyProfile = () => { const { user, profileData } = useAuthContext(); @@ -32,6 +34,15 @@ const MyProfile = () => { string | ImagePicker.ImagePickerAsset | null >(profileData?.pfp || null); + const [showDeleteDialog, setShowDeleteDialog] = useState(false); + + const handleHideDeleteDialog = () => { + setShowDeleteDialog(false); + }; + const handleShowDeleteDialog = () => { + setShowDeleteDialog(true); + }; + const { mutateAsync: updateUserData } = useUpdateUserData(); const { mutateAsync: changeProfilePicture } = useChangeProfilePicture(); const isFirstRender = useRef(true); @@ -93,7 +104,7 @@ const MyProfile = () => { : profileImage; return ( - + Your Profile @@ -205,6 +216,22 @@ const MyProfile = () => { +