diff --git a/audire/audire-landing/pages/contact-us.tsx b/audire/audire-landing/pages/contact-us.tsx index e56f12a..8b7efc9 100644 --- a/audire/audire-landing/pages/contact-us.tsx +++ b/audire/audire-landing/pages/contact-us.tsx @@ -26,9 +26,16 @@ function ContactUs() { const handleSubmit = (e: FormEvent) => { e.preventDefault(); - console.log(formData); + const isFormValid = Object.values(formData).every( + (value) => value.trim() !== '' + ); - setFormSubmitted(true); + if (isFormValid) { + console.log(formData); + setFormSubmitted(true); + } else { + alert('Please fill in all fields before submitting.'); + } }; return ( diff --git a/audire/audire-mobile-app/src/modules/profile/ConfirmDeleteAccountDialog.tsx b/audire/audire-mobile-app/src/modules/profile/ConfirmDeleteAccountDialog.tsx new file mode 100644 index 0000000..ff0c7ce --- /dev/null +++ b/audire/audire-mobile-app/src/modules/profile/ConfirmDeleteAccountDialog.tsx @@ -0,0 +1,75 @@ +import React, { ComponentProps, FC } from 'react'; +import { Linking } from 'react-native'; +import { + Heading, + Modal, + ModalBackdrop, + ModalContent, + ModalHeader, + ModalCloseButton, + ModalBody, + Text, + ModalFooter, + ButtonText, + Button, +} from '@gluestack-ui/themed'; + +type ConfirmDeleteAccountDialogProps = ComponentProps & { + isOpen: boolean; + onClose: () => void; +}; + +const ConfirmDeleteAccountDialog: FC = ( + props +) => { + const ref = React.useRef(null); + + const handleDeleteAccount = () => { + // Open the link in the browser + Linking.openURL('https://audirelearning.com/contact-us'); + }; + + return ( + + + + + + Delete your Account? + + + + + Are you sure want to Delete your Account? + + + + + + + + ); +}; + +export default ConfirmDeleteAccountDialog; diff --git a/audire/audire-mobile-app/src/modules/profile/ProfileView.tsx b/audire/audire-mobile-app/src/modules/profile/ProfileView.tsx index bf3d0f1..454e468 100644 --- a/audire/audire-mobile-app/src/modules/profile/ProfileView.tsx +++ b/audire/audire-mobile-app/src/modules/profile/ProfileView.tsx @@ -14,6 +14,8 @@ import { import { useActiveUser, useUpdateProfile } from '@learning-app/auth'; import FooterView from '../common/FooterView'; import { Icon, TrashIcon } from '@gluestack-ui/themed'; +import { TouchableOpacity } from 'react-native'; +import ConfirmDeleteAccountDialog from './ConfirmDeleteAccountDialog'; const ProfileView = () => { const { @@ -23,6 +25,7 @@ const ProfileView = () => { const { trigger, isMutating } = useUpdateProfile(); const [newFirstName, setNewFirstName] = useState(firstName || ''); const [newLastName, setNewLastName] = useState(lastName || ''); + const [showModal, setShowModal] = useState(false); const handleSaveClick = () => { trigger({ profileId, @@ -44,7 +47,28 @@ const ProfileView = () => { {firstName} +
+ + {showModal && ( + setShowModal(false)} + /> + )} +
{firstName} @@ -124,21 +148,26 @@ const ProfileView = () => {
+ + + - -
+
+ + {showModal && ( + setShowModal(false)} + /> + )}
+ );