From 0a1a985de6e9a53896d2ba17e26d042009b3e1b4 Mon Sep 17 00:00:00 2001 From: rohan09-raj Date: Thu, 18 Aug 2022 16:12:35 +0530 Subject: Condtional update handling --- client/src/components/BackButton/BackButton.jsx | 23 +++++++++ .../components/BackButton/BackButton.module.css | 20 ++++++++ client/src/components/UpdateInput/UpdateInput.jsx | 54 ++++++++++++++-------- 3 files changed, 77 insertions(+), 20 deletions(-) create mode 100644 client/src/components/BackButton/BackButton.jsx create mode 100644 client/src/components/BackButton/BackButton.module.css (limited to 'client/src/components') diff --git a/client/src/components/BackButton/BackButton.jsx b/client/src/components/BackButton/BackButton.jsx new file mode 100644 index 0000000..c02681b --- /dev/null +++ b/client/src/components/BackButton/BackButton.jsx @@ -0,0 +1,23 @@ +import React from 'react' +import styles from './BackButton.module.css' + +const BackButton = ({ onClick, onChange }) => { + return ( + <> + + + ) +} + +export default BackButton diff --git a/client/src/components/BackButton/BackButton.module.css b/client/src/components/BackButton/BackButton.module.css new file mode 100644 index 0000000..cc9b51c --- /dev/null +++ b/client/src/components/BackButton/BackButton.module.css @@ -0,0 +1,20 @@ +.submit { + position: absolute; + top: 100px; + left: 150px; + background: transparent; + border: none; + border-radius: 50%; + transition: 0.2s all; + cursor: pointer; +} + +.submit:active { + transform: scale(0.98); + box-shadow: 3px 2px 22px 1px var(--color-shadow); +} + +.submit__image { + height: 75px; + width: 75px; +} diff --git a/client/src/components/UpdateInput/UpdateInput.jsx b/client/src/components/UpdateInput/UpdateInput.jsx index 8fa3ba1..1cbfcbd 100644 --- a/client/src/components/UpdateInput/UpdateInput.jsx +++ b/client/src/components/UpdateInput/UpdateInput.jsx @@ -2,7 +2,22 @@ import React from 'react' import styles from './UpdateInput.module.css' import EditButton from '../EditButton/EditButton' -const UpdateInput = ({ label, id, value, type, name, onChange, placeholder, maxLength, pattern, minLength, onInvalid, onValid, readOnly }) => { +const UpdateInput = ({ + label, + id, + value, + defaultValue, + type, + name, + onChange, + placeholder, + maxLength, + pattern, + minLength, + onInvalid, + onValid, + readOnly +}) => { const [editable, setEditable] = React.useState(true) const handleEdit = () => { @@ -14,25 +29,24 @@ const UpdateInput = ({ label, id, value, type, name, onChange, placeholder, maxL
- - + +
-- cgit From d391caf122fcdf7ff4a9e227748b9a10242b15d6 Mon Sep 17 00:00:00 2001 From: rohan09-raj Date: Thu, 18 Aug 2022 19:25:08 +0530 Subject: added assets and modal --- client/public/assets/audios/document-english.mp3 | Bin 0 -> 7008 bytes client/public/assets/audios/document-hindi.mp3 | Bin 0 -> 9792 bytes .../public/assets/audios/fingerprint-english.mp3 | Bin 0 -> 8544 bytes client/public/assets/audios/fingerprint-hindi.mp3 | Bin 0 -> 13632 bytes client/public/assets/audios/iris-english.mp3 | Bin 0 -> 12672 bytes client/public/assets/audios/iris-hindi.mp3 | Bin 0 -> 13824 bytes client/public/assets/audios/photograph-english.mp3 | Bin 0 -> 14400 bytes client/public/assets/audios/photograph-hindi.mp3 | Bin 0 -> 16896 bytes client/src/components/Modal/Modal.jsx | 42 +++++++++++++++++++++ client/src/pages/Home/Home.jsx | 2 + client/src/pages/Update/Agreement/Agreement.jsx | 2 +- 11 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 client/public/assets/audios/document-english.mp3 create mode 100644 client/public/assets/audios/document-hindi.mp3 create mode 100644 client/public/assets/audios/fingerprint-english.mp3 create mode 100644 client/public/assets/audios/fingerprint-hindi.mp3 create mode 100644 client/public/assets/audios/iris-english.mp3 create mode 100644 client/public/assets/audios/iris-hindi.mp3 create mode 100644 client/public/assets/audios/photograph-english.mp3 create mode 100644 client/public/assets/audios/photograph-hindi.mp3 create mode 100644 client/src/components/Modal/Modal.jsx (limited to 'client/src/components') diff --git a/client/public/assets/audios/document-english.mp3 b/client/public/assets/audios/document-english.mp3 new file mode 100644 index 0000000..7782d06 Binary files /dev/null and b/client/public/assets/audios/document-english.mp3 differ diff --git a/client/public/assets/audios/document-hindi.mp3 b/client/public/assets/audios/document-hindi.mp3 new file mode 100644 index 0000000..74d7631 Binary files /dev/null and b/client/public/assets/audios/document-hindi.mp3 differ diff --git a/client/public/assets/audios/fingerprint-english.mp3 b/client/public/assets/audios/fingerprint-english.mp3 new file mode 100644 index 0000000..4bf56cb Binary files /dev/null and b/client/public/assets/audios/fingerprint-english.mp3 differ diff --git a/client/public/assets/audios/fingerprint-hindi.mp3 b/client/public/assets/audios/fingerprint-hindi.mp3 new file mode 100644 index 0000000..64b3c9e Binary files /dev/null and b/client/public/assets/audios/fingerprint-hindi.mp3 differ diff --git a/client/public/assets/audios/iris-english.mp3 b/client/public/assets/audios/iris-english.mp3 new file mode 100644 index 0000000..a7a9b38 Binary files /dev/null and b/client/public/assets/audios/iris-english.mp3 differ diff --git a/client/public/assets/audios/iris-hindi.mp3 b/client/public/assets/audios/iris-hindi.mp3 new file mode 100644 index 0000000..c8336b8 Binary files /dev/null and b/client/public/assets/audios/iris-hindi.mp3 differ diff --git a/client/public/assets/audios/photograph-english.mp3 b/client/public/assets/audios/photograph-english.mp3 new file mode 100644 index 0000000..a534ddf Binary files /dev/null and b/client/public/assets/audios/photograph-english.mp3 differ diff --git a/client/public/assets/audios/photograph-hindi.mp3 b/client/public/assets/audios/photograph-hindi.mp3 new file mode 100644 index 0000000..378c736 Binary files /dev/null and b/client/public/assets/audios/photograph-hindi.mp3 differ diff --git a/client/src/components/Modal/Modal.jsx b/client/src/components/Modal/Modal.jsx new file mode 100644 index 0000000..312d01e --- /dev/null +++ b/client/src/components/Modal/Modal.jsx @@ -0,0 +1,42 @@ +import React from 'react' +import { Modal, Typography, Box, Button } from '@mui/material' + +const PopUpModal = () => { + const style = { + position: 'absolute', + top: '50%', + left: '50%', + transform: 'translate(-50%, -50%)', + width: 1000, + bgcolor: 'background.paper', + borderRadius: '10px', + boxShadow: 24, + p: 4 + } + const [open, setOpen] = React.useState(false) + const handleOpen = () => setOpen(true) + const handleClose = () => setOpen(false) + + return ( + <> + + + + + Text in a modal + + + Duis mollis, est non commodo luctus, nisi erat porttitor ligula. + + + + + ) +} + +export default PopUpModal diff --git a/client/src/pages/Home/Home.jsx b/client/src/pages/Home/Home.jsx index 354b2e9..4539120 100644 --- a/client/src/pages/Home/Home.jsx +++ b/client/src/pages/Home/Home.jsx @@ -4,6 +4,7 @@ import { Link } from 'react-router-dom' import Card from '../../components/Card/Card' import Header from '../../components/Header/Header' import LanguageSelect from '../../components/LanguageSelect/LanguageSelect' +import PopUpModal from '../../components/Modal/Modal' import styles from './Home.module.css' const Home = ({ page, setPage }) => { @@ -11,6 +12,7 @@ const Home = ({ page, setPage }) => { return ( <>
+
diff --git a/client/src/pages/Update/Agreement/Agreement.jsx b/client/src/pages/Update/Agreement/Agreement.jsx index 91dade7..804561b 100644 --- a/client/src/pages/Update/Agreement/Agreement.jsx +++ b/client/src/pages/Update/Agreement/Agreement.jsx @@ -13,7 +13,7 @@ import { updateUser } from '../../../services/apiservice' const Agreement = () => { const { userData } = userContext() - const updateUse = useMutation(() => updateUser(userData._id, ...userData)) + const updateUse = useMutation(() => updateUser(userData._id, { ...userData })) const { t } = useTranslation() return ( -- cgit