use ProPhoneInput
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { Form, Input } from "antd";
|
|
||||||
import ProInputCard from "components/ProInputCard/ProInputCard.tsx";
|
import ProInputCard from "components/ProInputCard/ProInputCard.tsx";
|
||||||
|
import ProPhoneInput from "components/ProPhoneInput";
|
||||||
import { selectCart, updatePhone } from "features/order/orderSlice";
|
import { selectCart, updatePhone } from "features/order/orderSlice";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useAppDispatch, useAppSelector } from "redux/hooks";
|
import { useAppDispatch, useAppSelector } from "redux/hooks";
|
||||||
@@ -13,22 +13,10 @@ export default function PhoneCard() {
|
|||||||
orderType !== "gift" && (
|
orderType !== "gift" && (
|
||||||
<>
|
<>
|
||||||
<ProInputCard title={t("checkout.phoneNumber")}>
|
<ProInputCard title={t("checkout.phoneNumber")}>
|
||||||
<Form.Item
|
<ProPhoneInput
|
||||||
name="phone"
|
phone={phone}
|
||||||
required
|
setPhone={(phone) => dispatch(updatePhone(phone))}
|
||||||
rules={[
|
/>
|
||||||
{ required: true, message: t("checkout.pleaseEnterPhoneNumber") },
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Input
|
|
||||||
placeholder={t("checkout.phoneNumber")}
|
|
||||||
size="large"
|
|
||||||
autoFocus={false}
|
|
||||||
style={{ padding: "7px 11px", height: 50, borderRadius: 888 }}
|
|
||||||
value={phone}
|
|
||||||
onChange={(e) => dispatch(updatePhone(e.target.value))}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
</ProInputCard>
|
</ProInputCard>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user