gift: working on UI ans styles

This commit is contained in:
2025-12-31 14:28:11 +03:00
parent 38c83d5143
commit 71e1d71c96
22 changed files with 720 additions and 93 deletions

View File

@@ -13,9 +13,8 @@ interface CartFooterProps {
export default function CartFooter({ form }: CartFooterProps) {
const { t } = useTranslation();
const { items } = useAppSelector(selectCart);
const { items, orderType } = useAppSelector(selectCart);
const { subdomain } = useParams();
const orderType = localStorage.getItem("orderType");
const navigate = useNavigate();
const handleCheckoutClick = async () => {
@@ -23,7 +22,11 @@ export default function CartFooter({ form }: CartFooterProps) {
else {
try {
await form.validateFields();
navigate(`/${subdomain}/checkout`);
if (orderType === OrderType.Gift) {
navigate(`/${subdomain}/e-gift-cards`);
} else {
navigate(`/${subdomain}/checkout`);
}
} catch (error) {
message.warning(t("cart.checkRequiredFields"));
console.log("Form validation failed:", error);
@@ -33,25 +36,6 @@ export default function CartFooter({ form }: CartFooterProps) {
return (
<Layout.Footer className={styles.cartFooter}>
<Link
to={`/${subdomain}/menu?${orderType ? `orderType=${orderType}` : ""}`}
style={{
width: "100%",
}}
>
<Button
style={{
borderRadius: 100,
height: 50,
borderColor: "black",
width: "100%",
fontSize: 16,
}}
>
{t("cart.addItem")}
</Button>
</Link>
<Button
style={{
backgroundColor: colors.primary,