gift: working on UI ans styles
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user