From 897146ee12f77c9eb820b771ed2960f4c9846038 Mon Sep 17 00:00:00 2001 From: soheil khaledabadi Date: Thu, 17 Sep 2026 05:29:25 +0330 Subject: [PATCH] feat: let users save their national code from the profile page Wires up the previously-disabled "edit profile" button/modal to save national_id via POST /profile/national-id, so it's no longer only collectible through the inline field during a Shahkar-gated purchase. Co-Authored-By: Claude Sonnet 5 --- src/pages/profile/section/ProfileDetails.tsx | 20 +++-- .../section/components/ModalEditProfile.tsx | 79 ++++++++++++++++++- src/types/props.d.ts | 1 + 3 files changed, 89 insertions(+), 11 deletions(-) diff --git a/src/pages/profile/section/ProfileDetails.tsx b/src/pages/profile/section/ProfileDetails.tsx index 77f72bb..d325aa0 100644 --- a/src/pages/profile/section/ProfileDetails.tsx +++ b/src/pages/profile/section/ProfileDetails.tsx @@ -1,10 +1,12 @@ -import { MdLogout } from "react-icons/md"; +import { MdEdit, MdLogout } from "react-icons/md"; import Button from "../../../components/button"; import { useDispatch } from "react-redux"; import { setToken } from "../../../redux/slices/token"; import { AxiosError } from "axios"; import { LoaderIcon } from "react-hot-toast"; import { ProfileDetailsProps } from "../../../types/props"; +import { useState } from "react"; +import ModalEditProfile from "./components/ModalEditProfile"; const ProfileDetails = ({ data, @@ -14,7 +16,7 @@ const ProfileDetails = ({ }: ProfileDetailsProps) => { return (
- + { - // const [isOpen, setIsOpen] = useState(false); +const EditProfile = ({ nationalId }: { nationalId?: string | null }) => { + const [isOpen, setIsOpen] = useState(false); const dispatch = useDispatch(); return (
- {/* */} - {/* */} +