|
|
|
@ -44,12 +44,15 @@ export const Address = ({ |
|
|
|
|
getAddress, |
|
|
|
|
addressInfo, |
|
|
|
|
updateAddress, |
|
|
|
|
isDashboard, |
|
|
|
|
}) => { |
|
|
|
|
const [addressFields, setAddressFields] = useState({}); |
|
|
|
|
const [mapAddress, setMapAddress] = useState(null); |
|
|
|
|
const navigation = useNavigate(); |
|
|
|
|
useEffect(() => { |
|
|
|
|
setHeaderOptions(headerOptions); |
|
|
|
|
if (!isDashboard) { |
|
|
|
|
setHeaderOptions(headerOptions); |
|
|
|
|
} |
|
|
|
|
if (province.length <= 1) { |
|
|
|
|
getProvince(); |
|
|
|
|
} |
|
|
|
@ -464,11 +467,7 @@ export const Address = ({ |
|
|
|
|
? profileFields.cellphone || user.cellphone |
|
|
|
|
: addressFields?.cellphone |
|
|
|
|
} |
|
|
|
|
onChange={(name, value) => |
|
|
|
|
profilePage |
|
|
|
|
? setProfileFields({ ...profileFields, cellphone: value }) |
|
|
|
|
: onChange(name, value) |
|
|
|
|
} |
|
|
|
|
onChange={(name, value) => onChange(name, value)} |
|
|
|
|
align="text-right" |
|
|
|
|
direction="ltr" |
|
|
|
|
maxLength={11} |
|
|
|
@ -496,25 +495,6 @@ export const Address = ({ |
|
|
|
|
</> |
|
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
{profilePage && ( |
|
|
|
|
<Input |
|
|
|
|
width={isMobile ? "100%" : "50%"} |
|
|
|
|
label={window.t("کد ملی")} |
|
|
|
|
regex={(val) => onInput.phonenumber(val)} |
|
|
|
|
name="nationalId" |
|
|
|
|
onChange={(name, value) => |
|
|
|
|
setProfileFields({ ...profileFields, nationalId: value }) |
|
|
|
|
} |
|
|
|
|
value={profileFields.nationalId || user.nationalId} |
|
|
|
|
align="text-right" |
|
|
|
|
direction="ltr" |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
|
|
|
|
|
{!isMobile && <></>} |
|
|
|
|
|
|
|
|
|
{!isMobile && <></>} |
|
|
|
|
|
|
|
|
|
<Header |
|
|
|
|
label={window.t("شماره تماس")} |
|
|
|
|
text={window.t( |
|
|
|
@ -653,7 +633,7 @@ const mapStateToProps = (state) => ({ |
|
|
|
|
loading: state.userAddress.loading, |
|
|
|
|
user: state.user.status, |
|
|
|
|
cityLoading: state.publicApi.loading, |
|
|
|
|
isMobile: state.publicApi.isMobile, |
|
|
|
|
isMobile: state.config.device === "mobile", |
|
|
|
|
isDark: state.publicApi.isDark, |
|
|
|
|
profileFields: state.user.profileFields, |
|
|
|
|
addressInfo: state.userAddress.info, |
|
|
|
|