remove extra bottom sheet in checkout page make all them inside the page iteslef
This commit is contained in:
43
src/components/InputCard.tsx
Normal file
43
src/components/InputCard.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import { Form, Input } from "antd";
|
||||
import ProInputCard from "components/ProInputCard/ProInputCard.tsx";
|
||||
import { updateOrder } from "features/order/orderSlice";
|
||||
import { useAppDispatch } from "redux/hooks";
|
||||
|
||||
interface InputCardProps {
|
||||
title: string;
|
||||
name: string;
|
||||
placeholder: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export default function InputCard({
|
||||
title,
|
||||
name,
|
||||
placeholder,
|
||||
value,
|
||||
}: InputCardProps) {
|
||||
const dispatch = useAppDispatch();
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
dispatch(updateOrder({ [name]: e.target.value }));
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<ProInputCard title={title} dividerStyle={{ margin: "5px 0 0 0" }}>
|
||||
<Form.Item
|
||||
label={title}
|
||||
name={name}
|
||||
style={{ position: "relative", top: -5 }}
|
||||
>
|
||||
<Input
|
||||
placeholder={placeholder}
|
||||
size="large"
|
||||
autoFocus={false}
|
||||
style={{ padding: "7px 11px", height: 50, borderRadius: 888 }}
|
||||
value={value}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</Form.Item>
|
||||
</ProInputCard>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user