update antd & fix rtl styles
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
"@reduxjs/toolkit": "^2.2.6",
|
"@reduxjs/toolkit": "^2.2.6",
|
||||||
"@types/google-libphonenumber": "^7.4.30",
|
"@types/google-libphonenumber": "^7.4.30",
|
||||||
"@types/node": "^20.14.11",
|
"@types/node": "^20.14.11",
|
||||||
"antd": "^5.27.4",
|
"antd": "^6.1.1",
|
||||||
"dayjs": "^1.11.11",
|
"dayjs": "^1.11.11",
|
||||||
"google-libphonenumber": "^3.2.43",
|
"google-libphonenumber": "^3.2.43",
|
||||||
"i18next": "^23.15.1",
|
"i18next": "^23.15.1",
|
||||||
|
|||||||
@@ -5,15 +5,16 @@ interface BackIconType {
|
|||||||
className?: string;
|
className?: string;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
iconColor?: string;
|
iconColor?: string;
|
||||||
|
iconSize?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BackIcon = ({ className, onClick, iconColor }: BackIconType) => {
|
const BackIcon = ({ className, onClick, iconColor, iconSize }: BackIconType) => {
|
||||||
const { themeName } = useAppSelector((state) => state.theme);
|
const { themeName } = useAppSelector((state) => state.theme);
|
||||||
const color = iconColor || (themeName === "dark" ? "white" : ProGray1);
|
const color = iconColor || (themeName === "dark" ? "white" : ProGray1);
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
width="16"
|
width={iconSize || 16}
|
||||||
height="16"
|
height={iconSize || 16}
|
||||||
viewBox="0 0 16 16"
|
viewBox="0 0 16 16"
|
||||||
fill="none"
|
fill="none"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import ProText from "components/ProText";
|
|||||||
|
|
||||||
export function AddToCartButton({ item }: { item: Product }) {
|
export function AddToCartButton({ item }: { item: Product }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { isRTL } = useAppSelector((state) => state.locale);
|
||||||
const { subdomain } = useParams();
|
const { subdomain } = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
@@ -162,7 +162,7 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
height: 45,
|
height: 45,
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: -5,
|
bottom: -5,
|
||||||
right: -4,
|
[isRTL ? "left" : "right"]: -4,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -199,7 +199,7 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
height: 28,
|
height: 28,
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: 9,
|
bottom: 9,
|
||||||
right: 70,
|
[isRTL ? "left" : "right"]: 70,
|
||||||
minWidth: 28,
|
minWidth: 28,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -207,7 +207,7 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
style={{
|
style={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: 17,
|
bottom: 17,
|
||||||
right: 50,
|
[isRTL ? "left" : "right"]: 50,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: 700,
|
fontWeight: 700,
|
||||||
fontStyle: "Bold",
|
fontStyle: "Bold",
|
||||||
@@ -232,7 +232,7 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
height: 28,
|
height: 28,
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: 9,
|
bottom: 9,
|
||||||
right: 10,
|
[isRTL ? "left" : "right"]: 10,
|
||||||
minWidth: 28,
|
minWidth: 28,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -246,7 +246,7 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
height: 48,
|
height: 48,
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: -11,
|
bottom: -11,
|
||||||
right: -2,
|
[isRTL ? "left" : " right"]: -2,
|
||||||
backgroundColor: "var(--background)",
|
backgroundColor: "var(--background)",
|
||||||
borderRadius: "50%",
|
borderRadius: "50%",
|
||||||
}}
|
}}
|
||||||
@@ -274,7 +274,7 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
height: 36,
|
height: 36,
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: 6,
|
bottom: 6,
|
||||||
right: 6,
|
[isRTL ? "left" : "right"]: 6,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/* Badge positioning for RTL */
|
||||||
|
:global(.ant-app-rtl) .cartBadge :global(.ant-badge-count) {
|
||||||
|
right: auto !important;
|
||||||
|
left: -2px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.ant-app-ltr) .cartBadge :global(.ant-badge-count) {
|
||||||
|
right: -2px !important;
|
||||||
|
left: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { Link, useParams } from "react-router-dom";
|
import { Link, useParams } from "react-router-dom";
|
||||||
import { useAppSelector } from "redux/hooks";
|
import { useAppSelector } from "redux/hooks";
|
||||||
import { colors, ProBlack2 } from "ThemeConstants";
|
import { colors, ProBlack2 } from "ThemeConstants";
|
||||||
|
import styles from "./MenuFooter.module.css";
|
||||||
|
|
||||||
export function MenuFooter() {
|
export function MenuFooter() {
|
||||||
const items = useAppSelector(selectCartItems);
|
const items = useAppSelector(selectCartItems);
|
||||||
@@ -72,14 +73,14 @@ export function MenuFooter() {
|
|||||||
<Badge
|
<Badge
|
||||||
count={totalItems}
|
count={totalItems}
|
||||||
size="default"
|
size="default"
|
||||||
offset={ isRTL ? [-2, 18] : [2, 18]}
|
offset={isRTL ? [-2, 18] : [2, 18]}
|
||||||
|
className={styles.cartBadge}
|
||||||
style={{
|
style={{
|
||||||
borderColor: colors.primary,
|
borderColor: colors.primary,
|
||||||
color: "white",
|
color: "white",
|
||||||
fontSize: isMobile ? 10 : 12,
|
fontSize: isMobile ? 10 : 12,
|
||||||
width: isMobile ? 10 : 12,
|
width: isMobile ? 10 : 12,
|
||||||
}}
|
}}
|
||||||
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ export default function ProductCard({ item }: Props) {
|
|||||||
style={{
|
style={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: 12,
|
bottom: 12,
|
||||||
left: 12,
|
[isRTL ? "right" : "left"]: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{item.original_price !== item.price && (
|
{item.original_price !== item.price && (
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import styles from "./menu.module.css";
|
|||||||
import NextIcon from "components/Icons/NextIcon";
|
import NextIcon from "components/Icons/NextIcon";
|
||||||
import { OpeningTimesBottomSheet } from "components/CustomBottomSheet/OpeningTimesBottomSheet";
|
import { OpeningTimesBottomSheet } from "components/CustomBottomSheet/OpeningTimesBottomSheet";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import BackIcon from "components/Icons/BackIcon";
|
||||||
|
|
||||||
function MenuPage() {
|
function MenuPage() {
|
||||||
const { subdomain } = useParams();
|
const { subdomain } = useParams();
|
||||||
@@ -126,10 +127,17 @@ function MenuPage() {
|
|||||||
: styles.closeButton
|
: styles.closeButton
|
||||||
}
|
}
|
||||||
icon={
|
icon={
|
||||||
|
!isRTL ? (
|
||||||
<NextIcon
|
<NextIcon
|
||||||
iconColor={restaurant?.isOpened ? "#278655" : "#DD4143"}
|
iconColor={restaurant?.isOpened ? "#278655" : "#DD4143"}
|
||||||
iconSize={9}
|
iconSize={9}
|
||||||
/>
|
/>
|
||||||
|
) : (
|
||||||
|
<BackIcon
|
||||||
|
iconColor={restaurant?.isOpened ? "#278655" : "#DD4143"}
|
||||||
|
iconSize={9}
|
||||||
|
/>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
iconPosition="end"
|
iconPosition="end"
|
||||||
onClick={() => setIsOpeningTimesOpen(true)}
|
onClick={() => setIsOpeningTimesOpen(true)}
|
||||||
|
|||||||
Reference in New Issue
Block a user