product: fix "special request" save
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { Button, Input } from "antd";
|
import { Button, Input } from "antd";
|
||||||
import { ProBottomSheet } from "components/ProBottomSheet/ProBottomSheet.tsx";
|
import { ProBottomSheet } from "components/ProBottomSheet/ProBottomSheet.tsx";
|
||||||
import { useEffect, useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
@@ -21,10 +21,6 @@ export function BottomSheet({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [value, setValue] = useState(initialValue);
|
const [value, setValue] = useState(initialValue);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setValue(initialValue);
|
|
||||||
}, [initialValue]);
|
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
onSave(value);
|
onSave(value);
|
||||||
onClose();
|
onClose();
|
||||||
|
|||||||
@@ -126,11 +126,9 @@ export default function ProductFooter({
|
|||||||
width: "100%",
|
width: "100%",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Form.Item
|
<Form.Item style={{ position: "relative", top: -5, width: "100%" }}>
|
||||||
name="specialRequest"
|
|
||||||
style={{ position: "relative", top: -5, width: "100%" }}
|
|
||||||
>
|
|
||||||
<Input
|
<Input
|
||||||
|
value={specialRequest}
|
||||||
placeholder={t("cart.specialRequest")}
|
placeholder={t("cart.specialRequest")}
|
||||||
size="large"
|
size="large"
|
||||||
autoFocus={false}
|
autoFocus={false}
|
||||||
@@ -190,7 +188,7 @@ export default function ProductFooter({
|
|||||||
</div>
|
</div>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
{!isDesktop && (
|
{!isDesktop && isSpecialRequestOpen && (
|
||||||
<BottomSheet
|
<BottomSheet
|
||||||
isOpen={isSpecialRequestOpen}
|
isOpen={isSpecialRequestOpen}
|
||||||
onClose={handleSpecialRequestClose}
|
onClose={handleSpecialRequestClose}
|
||||||
|
|||||||
Reference in New Issue
Block a user