YouMightAlsoLike: enhnace UI + styles

This commit is contained in:
2026-01-01 12:14:02 +03:00
parent 3b0b8ceab6
commit a6abb089d2
9 changed files with 177 additions and 147 deletions

View File

@@ -55,7 +55,7 @@ interface CartState {
giftDetails: GiftDetailsType | null;
coupon: string;
tip: string;
tables: string[];
table: string;
estimateTime: Date;
estimateTimeDate: Date;
estimateTimeTime: string;
@@ -152,7 +152,7 @@ const initialState: CartState = {
giftDetails: getFromLocalStorage(CART_STORAGE_KEYS.GIFT_DETAILS, null),
coupon: getFromLocalStorage(CART_STORAGE_KEYS.COUPON, ""),
tip: getFromLocalStorage(CART_STORAGE_KEYS.TIP, ""),
tables: getFromLocalStorage(CART_STORAGE_KEYS.TABLES, []),
table: getFromLocalStorage(CART_STORAGE_KEYS.TABLES, ""),
estimateTime: new Date(
getFromLocalStorage(
CART_STORAGE_KEYS.ESTIMATE_TIME,
@@ -198,7 +198,7 @@ const initialState: CartState = {
pickupDate: getFromLocalStorage(CART_STORAGE_KEYS.PICKUP_DATE, ""),
pickupTime: getFromLocalStorage(CART_STORAGE_KEYS.PICKUP_TIME, ""),
pickupType: getFromLocalStorage(CART_STORAGE_KEYS.PICKUP_TYPE, ""),
estimateWay: getFromLocalStorage(CART_STORAGE_KEYS.ESTIMATE_WAY, "now"),
estimateWay: getFromLocalStorage(CART_STORAGE_KEYS.ESTIMATE_WAY, ""),
order: getFromLocalStorage(CART_STORAGE_KEYS.ORDER, null),
splitBillAmount: 0,
customerName: "",
@@ -352,7 +352,7 @@ const orderSlice = createSlice({
state.phone = "";
state.coupon = "";
state.tip = "";
state.tables = [];
state.table = "";
state.location = null;
state.roomDetails = null;
state.officeDetails = null;
@@ -410,19 +410,19 @@ const orderSlice = createSlice({
localStorage.setItem(CART_STORAGE_KEYS.TIP, JSON.stringify(state.tip));
}
},
updateTables(state, action: PayloadAction<string[]>) {
state.tables = action.payload;
updateTables(state, action: PayloadAction<string>) {
state.table = action.payload;
// Sync to localStorage
if (typeof window !== "undefined") {
localStorage.setItem(
CART_STORAGE_KEYS.TABLES,
JSON.stringify(state.tables),
JSON.stringify(state.table),
);
}
},
removeTable(state) {
state.tables = [];
state.table = "";
// Sync to localStorage
if (typeof window !== "undefined") {
@@ -681,7 +681,10 @@ const orderSlice = createSlice({
updateEstimateWay(state, action: PayloadAction<string>) {
state.estimateWay = action.payload;
if (typeof window !== "undefined") {
localStorage.setItem(CART_STORAGE_KEYS.ESTIMATE_WAY, JSON.stringify(state.estimateWay));
localStorage.setItem(
CART_STORAGE_KEYS.ESTIMATE_WAY,
JSON.stringify(state.estimateWay),
);
}
},
updateOrder(state, action: PayloadAction<any>) {