diff --git a/src/App.scss b/src/App.scss index eaa7d9b0..fbf0a796 100644 --- a/src/App.scss +++ b/src/App.scss @@ -38,4 +38,9 @@ @import "./assets/styles/tables.scss"; @import "./assets/styles/cards.scss"; @import "./assets/styles/trackOrder.scss"; -@import './assets/styles/trackOrder.scss'; +@import "./assets/styles/adminDashboard.scss"; +@import "./assets/styles/users.scss"; +@import "./assets/styles/liveChat.scss"; +@import "./assets//styles/UserProfile.scss"; +@import "./assets/styles/SellerSideProduct.scss"; +@import "./assets/styles/SellerDeleteItem.scss" diff --git a/src/assets/styles/SellerDeleteItem.scss b/src/assets/styles/SellerDeleteItem.scss new file mode 100644 index 00000000..72494282 --- /dev/null +++ b/src/assets/styles/SellerDeleteItem.scss @@ -0,0 +1,67 @@ +@import "./Colors"; + +.confirm-dialog { + margin-left: 27rem; + border-radius: 2.2rem; + margin-top: 9rem; + width: 80%; + height: 87vh; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; + font-size: 1.6rem; + + .confirm-dialog-content { + background-color: white; + padding: 20px; + border-radius: 8px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + text-align: center; + + .modal-header { + font-size: 1.8rem; + font-weight: bold; + margin-bottom: 1.5; + display: flex; + flex-direction: column; + align-items: center; + + .icon__delete { + color: $red-color; + font-size: 3rem; + } + } + p{ + padding: 1rem 0; + i{ + text-transform: uppercase; + font-weight: bold; + } + } + .modal-footer{ + float: right; + button { + margin: 0 10px; + padding: .7rem 3rem; + border: none; + border-radius: 1rem; + font-family: $text-family; + } + .delete-btn{ + background: $red-middle-color; + color: $red-color; + } + .cancel-btn{ + background: lighten($fifth-color, 19%); + color: $fifth-color; + } + } + } +} \ No newline at end of file diff --git a/src/assets/styles/UserProfile.scss b/src/assets/styles/UserProfile.scss index a6182e8e..a3dcde94 100644 --- a/src/assets/styles/UserProfile.scss +++ b/src/assets/styles/UserProfile.scss @@ -230,7 +230,8 @@ .error { color: red !important; - padding: 0 !important; + padding-left: 2rem !important; + margin-left: -2rem; background: none; font-size: 2rem; } diff --git a/src/components/product/ConfirmModal.tsx b/src/components/product/ConfirmModal.tsx new file mode 100644 index 00000000..a5111f22 --- /dev/null +++ b/src/components/product/ConfirmModal.tsx @@ -0,0 +1,32 @@ +/* eslint-disable */ +import React from 'react'; +import DeleteIcon from '@mui/icons-material/Delete'; + +interface ConfirmModalProps { + isOpen: boolean; + title: string; + message: string; + onConfirm: () => void; + onCancel: () => void; +} + +const ConfirmModal: React.FC = ({ isOpen, title, message, onConfirm, onCancel }) => { + if (!isOpen) return null; + + return ( +
+
+
+ {title} +
+

+

+ + +
+
+
+ ); +}; + +export default ConfirmModal; diff --git a/src/components/user/PasswordUpdate.tsx b/src/components/user/PasswordUpdate.tsx index 949595e5..11baed0a 100644 --- a/src/components/user/PasswordUpdate.tsx +++ b/src/components/user/PasswordUpdate.tsx @@ -8,6 +8,9 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faEye, faEyeSlash } from '@fortawesome/free-solid-svg-icons'; import { toast } from "react-toastify"; import { TailSpin } from 'react-loader-spinner'; +import { logout } from '../../store/features/auth/authSlice'; +import { disconnect } from '../../utils/socket/socket'; +import { useNavigate } from 'react-router-dom'; const passwordSchema = Yup.object({ oldPassword: Yup.string().required('Old password is required'), @@ -19,13 +22,13 @@ const passwordSchema = Yup.object({ .oneOf([Yup.ref('newPassword')], 'Passwords must match'), }); -const PasswordUpdate = ({ message, isError,isSuccess }) => { +const PasswordUpdate = ({ message, isError, isSuccess }) => { const dispatch = useAppDispatch(); const [showPassword, setShowPassword] = useState(false); const [showConfirmPassword, setShowConfirmPassword] = useState(false); const [showConfirmNewPassword, setShowConfirmNewPassword] = useState(false) const [loading, setLoading] = useState(false); - const [success, setSuccess] = useState(null); + const navigate = useNavigate() const newPasswordVisibility = () => { setShowPassword(!showPassword); @@ -46,13 +49,23 @@ const PasswordUpdate = ({ message, isError,isSuccess }) => { }, validationSchema: passwordSchema, onSubmit: async (values) => { - setLoading(true); try{ + setTimeout(()=>{ + setLoading(true) + },200) dispatch(updatePassword(values)); }catch(err){ console.log(err) }finally{ setLoading(false) + toast.success("Password updated Successfully you will be logged out in few second ") + setTimeout(()=>{ + dispatch(logout()) + disconnect() + },4000) + setTimeout(()=>{ + navigate("/login") + }, 5500) } }, @@ -75,7 +88,7 @@ const PasswordUpdate = ({ message, isError,isSuccess }) => {
- +
{
- +
{ {formik.errors.newPassword &&
{formik.errors.newPassword}
}
- +
{ +const ProfileDetails = ({ user, isSuccess, isError, message }) => { const dispatch = useAppDispatch(); const inputRef = useRef(null); const [profileImage, setProfileImage] = useState(null); + const [loading, setLoading] = useState(false) useEffect(() => { dispatch(fetchUserProfile()); @@ -74,8 +75,14 @@ const ProfileDetails = ({ user,isLoading, isSuccess, isError, message }) => { formData.append("language", values.language); formData.append("birthDate", values.birthDate); - const response: any = await dispatch(updateUserProfile(formData)); - // if(response && response.payload && response.payload.status && response.paylad.message) toast.success(response.payload.message); + setTimeout(()=>{ + setLoading(true) + },2000) + await dispatch(updateUserProfile(formData)) + .finally(()=>{ + setLoading(false) + }); + } }); @@ -113,7 +120,7 @@ const ProfileDetails = ({ user,isLoading, isSuccess, isError, message }) => {

MY PROFILE DETAILS