add plateCar

This commit is contained in:
2025-11-12 23:34:09 +03:00
parent c1f2f1a6a6
commit df43d46ed2
3 changed files with 26 additions and 1 deletions

View File

@@ -1,9 +1,14 @@
import { Form, Input } from "antd";
import ProInputCard from "components/ProInputCard/ProInputCard.tsx";
import { updatePlateCar } from "features/order/orderSlice";
import { useTranslation } from "react-i18next";
import { useAppDispatch, useAppSelector } from "redux/hooks";
export default function CarPlateCard() {
const { t } = useTranslation();
const dispatch = useAppDispatch()
const {plateCar} = useAppSelector(state => state.order)
return (
<>
<ProInputCard
@@ -16,6 +21,10 @@ export default function CarPlateCard() {
size="large"
autoFocus={false}
style={{ padding: "7px 11px", height: 50, borderRadius: 888 }}
value={plateCar}
onChange={(e) => {
dispatch(updatePlateCar(e.target.value));
}}
/>
</Form.Item>
</ProInputCard>

View File

@@ -36,6 +36,7 @@ export default function useOrder() {
giftDetails,
location,
discount,
plateCar,
} = useAppSelector(selectCart);
const highestLoyaltyItem = useAppSelector(selectHighestPricedLoyaltyItem);
const { useLoyaltyPoints } = useAppSelector(selectCart);
@@ -83,6 +84,7 @@ export default function useOrder() {
uuid: user_uuid,
pickup_comments: "",
pickup_time: estimateTime,
car_plate: plateCar,
delivery_pickup_interval: "",
orderPrice: orderPrice,
use_loylaty: useLoyaltyPoints && highestLoyaltyItem ? 1 : 0,