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