Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions apps/nowait-admin/src/pages/AdminOrders/OrderCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import ArrowRight from "../../assets/arrow_back.svg?react";
import { useState } from "react";
import { PaymentCheckModal, CookedModal } from "./OrderPageModal";
import type { MenuNamesAndQuantities } from "../../types/order";
import { getTableBackgroundColor } from "../../utils/tableColors";

interface PaymentCardProps {
orderId: number;
Expand Down Expand Up @@ -40,7 +41,10 @@ const PaymentCard = ({
onClick={onClick}
>
<div className="flex flex-row items-center">
<div className="flex rounded-full bg-navy-50 w-9 h-9 items-center justify-center text-title-18-semibold text-white-100">
<div
className="flex rounded-full w-9 h-9 items-center justify-center text-title-18-semibold text-white-100"
style={{ backgroundColor: getTableBackgroundColor(tableNumber) }}
>
{tableNumber}
</div>

Expand Down Expand Up @@ -135,7 +139,10 @@ const PaymentDetail = ({
</div>

<div className="flex flex-row mt-6 gap-2.5">
<div className="flex rounded-full bg-navy-50 w-9 h-9 items-center justify-center text-title-18-semibold text-white-100">
<div
className="flex rounded-full w-9 h-9 items-center justify-center text-title-18-semibold text-white-100"
style={{ backgroundColor: getTableBackgroundColor(tableNumber) }}
>
{tableNumber}
</div>
<div className="flex text-title-18-semibold text-black-90 items-center">
Expand Down Expand Up @@ -238,7 +245,10 @@ const CookCard = ({ tableNumber, menuNamesAndQuantities }: CookCardProps) => {
}`}
>
<div className="flex flex-row gap-2.5">
<div className="flex bg-[#6C707A] w-9 h-9 items-center justify-center rounded-full text-title-18-semibold text-white-100">
<div
className="flex w-9 h-9 items-center justify-center rounded-full text-title-18-semibold text-white-100"
style={{ backgroundColor: getTableBackgroundColor(tableNumber) }}
>
{tableNumber}
</div>
<div className="flex flex-col gap-3.5 text-16-semibold text-black-80">
Expand Down
6 changes: 5 additions & 1 deletion apps/nowait-admin/src/pages/AdminOrders/OrderPageModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useUpdateOrderStatus } from "../../hooks/useUpdateOrderStatus";
import { getTableBackgroundColor } from "../../utils/tableColors";

// Payment Check Modal
interface PaymentCheckModalProps {
Expand Down Expand Up @@ -54,7 +55,10 @@ const PaymentCheckModal = ({
</div>

<div className="flex flex-row mt-7.5 bg-black-15 rounded-[14px] px-3.5 py-3.5 w-70 gap-2.5">
<div className="flex rounded-full bg-navy-50 w-9 h-9 items-center justify-center text-title-18-semibold text-white-100">
<div
className="flex rounded-full w-9 h-9 items-center justify-center text-title-18-semibold text-white-100"
style={{ backgroundColor: getTableBackgroundColor(tableNumber) }}
>
{tableNumber}
</div>
<div className="flex flex-col">
Expand Down
42 changes: 42 additions & 0 deletions apps/nowait-admin/src/utils/tableColors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// 테이블 번호별 색상 정의 (1번-30번)
const tableColors = [
"#576376",
"#CEB4F0",
"#A5B8D6",
"#84A6AD",
"#788FB6",
"#99a3b4",
"#6C707A",
"#898BBC",
"#95C8BC",
"#B4B4B4",
"#3C485C",
"#A27FCF",
"#849CC3",
"#5F8992",
"#5472A3",
"#6B7C99",
"#4B4F59",
"#6B6D9B",
"#6FA99B",
"#929292",
"#3C485C",
"#875FBB",
"#6484B7",
"#4C6E75",
"#3F5A86",
"#52637F",
"#3E4045",
"#4C4E75",
"#507F74",
"#767676",
];

export const getTableBackgroundColor = (tableNumber: number): string => {
// 1-30번 범위 체크
if (tableNumber < 1 || tableNumber > 30) {
return "#6C707A"; // 범위 외 색상
}

return tableColors[tableNumber - 1];
};