fixes
- change refresh icon & apply refreshing logic - apply validation in action btn in menu - preserve on customer info state upon refresh
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import ProInputCard from "components/ProInputCard/ProInputCard.tsx";
|
||||
import ProPhoneInput from "components/ProPhoneInput";
|
||||
import { selectCart, updateCustomerName } from "features/order/orderSlice";
|
||||
import {
|
||||
selectCart,
|
||||
updateCustomerName,
|
||||
updatePhone,
|
||||
} from "features/order/orderSlice";
|
||||
import { OrderType } from "pages/checkout/hooks/types.ts";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAppDispatch, useAppSelector } from "redux/hooks";
|
||||
@@ -9,9 +13,12 @@ import styles from "./CustomerInformationCard.module.css";
|
||||
|
||||
export default function CustomerInformationCard() {
|
||||
const { t } = useTranslation();
|
||||
const { orderType } = useAppSelector(selectCart);
|
||||
const { orderType, customerName, phone } = useAppSelector(selectCart);
|
||||
const dispatch = useAppDispatch();
|
||||
const customerName = useAppSelector((state) => state.order.customerName);
|
||||
|
||||
const setPhone = (value: string) => {
|
||||
dispatch(updatePhone(value));
|
||||
};
|
||||
|
||||
return (
|
||||
orderType !== OrderType.Gift && (
|
||||
@@ -30,7 +37,7 @@ export default function CustomerInformationCard() {
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
<ProPhoneInput propName="phone" />
|
||||
<ProPhoneInput propName="phone" value={phone} onChange={setPhone} />
|
||||
</div>
|
||||
</ProInputCard>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user