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