- 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:
2026-01-04 07:00:56 +03:00
parent 13cce2f12f
commit f294138d30
13 changed files with 233 additions and 105 deletions

View File

@@ -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>
</>