Repository navigation
change the currency to EGP intead of $ and update the dashboard , liv… #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -211,7 +211,7 @@ function OrdersView() { | |||||
| <div className="flex justify-between items-end w-full mt-auto"> | ||||||
| <p className="text-[11px] font-bold text-[#1a1a1a] m-0">Today Sales</p> | ||||||
| <p className="text-[11px] font-semibold text-gray-400 m-0"> | ||||||
| (${metrics.dailyGoal.salesCurrent.toLocaleString()} / ${metrics.dailyGoal.salesTarget.toLocaleString()}) | ||||||
| ({metrics.dailyGoal.salesCurrent.toLocaleString()} / {metrics.dailyGoal.salesTarget.toLocaleString()} EGP) | ||||||
| </p> | ||||||
| </div> | ||||||
| </div> | ||||||
|
|
@@ -275,7 +275,7 @@ function OrdersView() { | |||||
| <td className="px-5 py-4 text-[13px] text-[#1a1a1a] font-medium">{order.time.replace(/ (AM|PM)/, "")}</td> | ||||||
| <td className="px-5 py-4 text-[13px] font-medium text-[#1a1a1a] max-w-[180px] truncate">{order.name}</td> | ||||||
| <td className="px-5 py-4 text-[13px] text-[#1a1a1a] font-medium">{order.items}</td> | ||||||
| <td className="px-5 py-4 text-[13px] font-bold text-orange-500">${order.total.toFixed(0)}</td> | ||||||
| <td className="px-5 py-4 text-[13px] font-bold text-orange-500">{order.total.toFixed(0)} EGP</td> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Inconsistent decimal precision for order totals. The table renders Proposed fix: align decimal precision-<td className="px-5 py-4 text-[13px] font-bold text-orange-500">{order.total.toFixed(0)} EGP</td>
+<td className="px-5 py-4 text-[13px] font-bold text-orange-500">{Number(order.total).toFixed(2)} EGP</td>📝 Committable suggestion
Suggested change
🧰 Tools🪛 ast-grep (0.44.1)[warning] 278-278: A list component should have a key to prevent re-rendering (list-component-needs-key) 🤖 Prompt for AI Agents |
||||||
| <td className="px-5 py-4 text-[13px] text-[#1a1a1a] font-medium">{order.customer}</td> | ||||||
| <td className="px-5 py-4"> | ||||||
| <StatusBadge status={order.status} /> | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,53 +1,75 @@ | ||
| import { | ||
| LineChart, Line, XAxis, YAxis, CartesianGrid, | ||
| Tooltip, Legend, ResponsiveContainer, | ||
| AreaChart, Area, XAxis, YAxis, CartesianGrid, | ||
| Tooltip, ResponsiveContainer, | ||
| } from "recharts"; | ||
| import TimeFilter from "./shared/TimeFilter"; | ||
|
|
||
| const CustomTooltip = ({ active, payload, label }) => { | ||
| if (active && payload && payload.length) { | ||
| const val = Number(payload[0].value || 0); | ||
| return ( | ||
| <div className="bg-[#1a1a1a] rounded-xl px-3.5 py-2.5 text-xs text-white shadow-lg"> | ||
| <p className="mb-1.5 font-semibold text-gray-400">{label}</p> | ||
| {payload.map((entry) => ( | ||
| <p key={entry.dataKey} className="my-0.5" style={{ color: entry.color }}> | ||
| {entry.name}: <strong>${entry.value}k</strong> | ||
| </p> | ||
| ))} | ||
| <p className="mb-1 font-semibold text-gray-400">{label}</p> | ||
| <p className="my-0" style={{ color: "#F97316" }}> | ||
| Revenue: <strong>{val.toLocaleString()} EGP</strong> | ||
| </p> | ||
| </div> | ||
| ); | ||
| } | ||
| return null; | ||
| }; | ||
|
|
||
| function RevenueChart({ data, totalRevenue = 0 }) { | ||
| const formattedTotal = `$${totalRevenue.toLocaleString()}`; | ||
| const formattedTotal = `${Number(totalRevenue || 0).toLocaleString()} EGP`; | ||
|
|
||
| return ( | ||
| <div className="bg-white rounded-3xl px-6 py-6 shadow-sm"> | ||
| <div className="flex items-start justify-between mb-2"> | ||
| <div className="flex items-start justify-between mb-4"> | ||
| <div className="flex flex-col gap-1"> | ||
| <p className="text-[13px] text-gray-500 font-medium m-0">Total Revenue</p> | ||
| <h3 className="text-[24px] font-bold text-[#1a1a1a] m-0">{formattedTotal}</h3> | ||
| </div> | ||
| <TimeFilter defaultValue="This Month" /> | ||
| </div> | ||
|
|
||
|
|
||
| <ResponsiveContainer width="100%" height={220}> | ||
| <LineChart data={data} margin={{ top: 10, right: 10, left: -20, bottom: 0 }}> | ||
| <AreaChart data={data} margin={{ top: 10, right: 10, left: -20, bottom: 0 }}> | ||
| <defs> | ||
| <linearGradient id="revenueGradient" x1="0" y1="0" x2="0" y2="1"> | ||
| <stop offset="5%" stopColor="#F97316" stopOpacity={0.18} /> | ||
| <stop offset="95%" stopColor="#F97316" stopOpacity={0} /> | ||
| </linearGradient> | ||
| </defs> | ||
| <CartesianGrid strokeDasharray="3 3" stroke="#F3F4F6" vertical={false} /> | ||
| <XAxis dataKey="month" axisLine={false} tickLine={false} tick={{ fontSize: 11, fill: "#9CA3AF" }} dy={10} /> | ||
| <YAxis axisLine={false} tickLine={false} tick={{ fontSize: 11, fill: "#9CA3AF" }} /> | ||
| <XAxis | ||
| dataKey="month" | ||
| axisLine={false} | ||
| tickLine={false} | ||
| tick={{ fontSize: 11, fill: "#9CA3AF" }} | ||
| dy={10} | ||
| /> | ||
| <YAxis | ||
| axisLine={false} | ||
| tickLine={false} | ||
| tick={{ fontSize: 11, fill: "#9CA3AF" }} | ||
| tickFormatter={(v) => v >= 1000 ? `${(v / 1000).toFixed(v % 1000 !== 0 ? 1 : 0)}k` : v} | ||
| /> | ||
| <Tooltip content={<CustomTooltip />} /> | ||
| <Legend verticalAlign="top" height={36} wrapperStyle={{ fontSize: "11px", color: "#6B7280" }} iconType="circle" iconSize={6} /> | ||
| <Line type="monotone" dataKey="income" name="Income" stroke="#F97316" strokeWidth={2.5} dot={false} activeDot={{ r: 5, fill: "#F97316" }} /> | ||
| <Line type="monotone" dataKey="revenue" name="Revenue" stroke="#10B981" strokeWidth={2.5} dot={false} activeDot={{ r: 5, fill: "#10B981" }} /> | ||
| <Line type="monotone" dataKey="expense" name="Expense" stroke="#111827" strokeWidth={2.5} dot={false} activeDot={{ r: 5, fill: "#111827" }} /> | ||
| </LineChart> | ||
| <Area | ||
| type="monotone" | ||
| dataKey="revenue" | ||
| name="Revenue" | ||
| stroke="#F97316" | ||
| strokeWidth={2.5} | ||
| fill="url(#revenueGradient)" | ||
| dot={false} | ||
| activeDot={{ r: 5, fill: "#F97316", strokeWidth: 2, stroke: "#fff" }} | ||
| /> | ||
| </AreaChart> | ||
| </ResponsiveContainer> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default RevenueChart; | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -39,7 +39,7 @@ export default function DishDetailsModal({ isOpen, onClose, dish }) { | |||||
| </p> | ||||||
| </div> | ||||||
| <div className="text-right shrink-0"> | ||||||
| <span className="block text-[22px] font-black text-[#38761d]">${dish.price}</span> | ||||||
| <span className="block text-[22px] font-black text-[#38761d]">{dish.price} EGP</span> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Apply numeric formatting to
Proposed fix-<span className="block text-[22px] font-black text-[`#38761d`]">{dish.price} EGP</span>
+<span className="block text-[22px] font-black text-[`#38761d`]">{Number(dish.price).toFixed(2)} EGP</span>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| </div> | ||||||
| </div> | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -111,7 +111,7 @@ export default function InactiveMenuModal({ isOpen, onClose, inactiveItems }) { | |||||
| <div className="flex items-center gap-2 text-[12px] font-medium text-gray-500"> | ||||||
| <span>{item.category}</span> | ||||||
| <span className="w-1 h-1 bg-gray-300 rounded-full"></span> | ||||||
| <span className="text-orange-500 font-bold">${item.price}</span> | ||||||
| <span className="text-orange-500 font-bold">{item.price} EGP</span> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Apply numeric formatting to Same as Proposed fix-<span className="text-orange-500 font-bold">{item.price} EGP</span>
+<span className="text-orange-500 font-bold">{Number(item.price).toFixed(2)} EGP</span>📝 Committable suggestion
Suggested change
🧰 Tools🪛 ast-grep (0.44.1)[warning] 110-114: A list component should have a key to prevent re-rendering {item.category} {item.price} EGP Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice. (list-component-needs-key) 🤖 Prompt for AI Agents |
||||||
| </div> | ||||||
| </div> | ||||||
| </div> | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -64,7 +64,7 @@ const OrderCard = ({ order }) => { | |||||
| className="text-sm font-bold whitespace-nowrap" | ||||||
| style={{ color: "#2e7d32" }} | ||||||
| > | ||||||
| {order.totalPrice}$ | ||||||
| {order.totalPrice} EGP | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Apply number formatting to
💚 Proposed fix- {order.totalPrice} EGP
+ {Number(order.totalPrice || 0).toFixed(2)} EGP📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| </span> | ||||||
| </div> | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Use
formatCurrencyinstead of inline EGP formatting.formatValuebypasses the sharedformatCurrencyutility and usestoLocaleString()which doesn't guarantee 2 decimal places (e.g., "1,234 EGP" vs "1,234.00 EGP"). This creates inconsistency across the app's price displays.♻️ Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents