ProPhoneInput: fix validation and value
This commit is contained in:
@@ -1,23 +1,19 @@
|
||||
import ProInputCard from "components/ProInputCard/ProInputCard.tsx";
|
||||
import ProPhoneInput from "components/ProPhoneInput";
|
||||
import { selectCart, updatePhone } from "features/order/orderSlice";
|
||||
import { selectCart } from "features/order/orderSlice";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAppDispatch, useAppSelector } from "redux/hooks";
|
||||
import { useAppSelector } from "redux/hooks";
|
||||
import { OrderType } from "pages/checkout/hooks/types.ts";
|
||||
|
||||
export default function PhoneCard() {
|
||||
const { t } = useTranslation();
|
||||
const dispatch = useAppDispatch();
|
||||
const { phone, orderType } = useAppSelector(selectCart);
|
||||
const { orderType } = useAppSelector(selectCart);
|
||||
|
||||
return (
|
||||
orderType !== OrderType.Gift && (
|
||||
<>
|
||||
<ProInputCard title={t("checkout.phoneNumber")}>
|
||||
<ProPhoneInput
|
||||
phone={phone}
|
||||
setPhone={(phone) => dispatch(updatePhone(phone))}
|
||||
/>
|
||||
<ProPhoneInput />
|
||||
</ProInputCard>
|
||||
</>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user