Update site colors and add order notification badge
Updates primary color to navy, adjusts icon tile shadows, and adds a real-time notification badge for incoming orders to the home page. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: dde9ba68-1907-4b4b-928d-4ea5bca215a7 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/UggHvbd Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
--card-foreground: 222 47% 11%;
|
||||
--popover: 0 0% 100%;
|
||||
--popover-foreground: 222 47% 11%;
|
||||
--primary: 217 91% 60%; /* #3B82F6 */
|
||||
--primary: 218 70% 15%; /* #0B1E3F */
|
||||
--primary-foreground: 0 0% 100%;
|
||||
--secondary: 173 80% 40%; /* teal-500 */
|
||||
--secondary-foreground: 0 0% 100%;
|
||||
@@ -81,16 +81,16 @@
|
||||
--destructive-foreground: 0 0% 100%;
|
||||
--border: 214 32% 91%; /* #E2E8F0 */
|
||||
--input: 214 32% 91%;
|
||||
--ring: 217 91% 60%;
|
||||
--ring: 218 70% 15%;
|
||||
|
||||
--sidebar: 0 0% 100%;
|
||||
--sidebar-foreground: 222 47% 11%;
|
||||
--sidebar-border: 214 32% 91%;
|
||||
--sidebar-primary: 217 91% 60%;
|
||||
--sidebar-primary: 218 70% 15%;
|
||||
--sidebar-primary-foreground: 0 0% 100%;
|
||||
--sidebar-accent: 210 40% 96%;
|
||||
--sidebar-accent-foreground: 222 47% 11%;
|
||||
--sidebar-ring: 217 91% 60%;
|
||||
--sidebar-ring: 218 70% 15%;
|
||||
|
||||
/*
|
||||
* Site-wide default font. DIN Next LT Arabic ships locally via
|
||||
@@ -178,12 +178,12 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 6px 18px rgba(59, 130, 246, 0.18);
|
||||
box-shadow: 0 6px 18px rgba(11, 30, 63, 0.18);
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
.icon-tile:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 10px 24px rgba(59, 130, 246, 0.22);
|
||||
box-shadow: 0 10px 24px rgba(11, 30, 63, 0.22);
|
||||
}
|
||||
.icon-tile-blue { background: linear-gradient(135deg, #60A5FA, #3B82F6); }
|
||||
.icon-tile-purple { background: linear-gradient(135deg, #C084FC, #8B5CF6); }
|
||||
|
||||
@@ -8,6 +8,8 @@ import {
|
||||
getGetHomeStatsQueryKey,
|
||||
useListNotifications,
|
||||
getListNotificationsQueryKey,
|
||||
useListIncomingServiceOrders,
|
||||
getListIncomingServiceOrdersQueryKey,
|
||||
useLogout,
|
||||
useUpdateLanguage,
|
||||
useUpdateMyAppOrder,
|
||||
@@ -391,6 +393,18 @@ export default function HomePage() {
|
||||
const { data: stats } = useGetHomeStats({ query: { queryKey: getGetHomeStatsQueryKey() } });
|
||||
const { data: notifications } = useListNotifications({ query: { queryKey: getListNotificationsQueryKey() } });
|
||||
|
||||
const isAdmin = user?.roles?.includes("admin") ?? false;
|
||||
const canReceiveOrders =
|
||||
isAdmin || (user?.roles?.includes("order_receiver") ?? false);
|
||||
const { data: incomingOrders } = useListIncomingServiceOrders({
|
||||
query: {
|
||||
queryKey: getListIncomingServiceOrdersQueryKey(),
|
||||
enabled: canReceiveOrders,
|
||||
},
|
||||
});
|
||||
const pendingOrdersCount =
|
||||
incomingOrders?.filter((o) => o.status === "pending" && !o.assignedTo).length ?? 0;
|
||||
|
||||
const logout = useLogout();
|
||||
const updateLanguage = useUpdateLanguage();
|
||||
|
||||
@@ -409,10 +423,6 @@ export default function HomePage() {
|
||||
? (user?.displayNameAr ?? user?.username ?? "")
|
||||
: (user?.displayNameEn ?? user?.username ?? "");
|
||||
|
||||
const isAdmin = user?.roles?.includes("admin") ?? false;
|
||||
const canReceiveOrders =
|
||||
isAdmin || (user?.roles?.includes("order_receiver") ?? false);
|
||||
|
||||
const handleLogout = () => {
|
||||
logout.mutate(undefined, {
|
||||
onSuccess: () => {
|
||||
@@ -496,9 +506,14 @@ export default function HomePage() {
|
||||
<button
|
||||
onClick={() => setLocation("/orders/incoming")}
|
||||
aria-label={t("incomingOrders.linkLabel")}
|
||||
className="p-1.5 md:p-2.5 rounded-lg md:rounded-xl hover:bg-foreground/5 text-muted-foreground hover:text-foreground transition-colors"
|
||||
className="relative p-1.5 md:p-2.5 rounded-lg md:rounded-xl hover:bg-foreground/5 text-muted-foreground hover:text-foreground transition-colors"
|
||||
>
|
||||
<Inbox className="w-[18px] h-[18px] md:w-6 md:h-6" />
|
||||
{pendingOrdersCount > 0 && (
|
||||
<span aria-hidden="true" className="absolute -top-0.5 -right-0.5 bg-destructive text-destructive-foreground text-[10px] md:text-xs rounded-full min-w-[16px] md:min-w-[20px] h-4 md:h-5 px-1 flex items-center justify-center font-bold tabular-nums">
|
||||
{pendingOrdersCount > 9 ? "9+" : pendingOrdersCount}
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
@@ -507,7 +522,7 @@ export default function HomePage() {
|
||||
>
|
||||
<Bell className="w-[18px] h-[18px] md:w-6 md:h-6" />
|
||||
{unreadCount > 0 && (
|
||||
<span className="absolute -top-0.5 -right-0.5 bg-destructive text-destructive-foreground text-[10px] md:text-xs rounded-full min-w-[16px] md:min-w-[20px] h-4 md:h-5 px-1 flex items-center justify-center font-bold tabular-nums">
|
||||
<span aria-hidden="true" className="absolute -top-0.5 -right-0.5 bg-destructive text-destructive-foreground text-[10px] md:text-xs rounded-full min-w-[16px] md:min-w-[20px] h-4 md:h-5 px-1 flex items-center justify-center font-bold tabular-nums">
|
||||
{unreadCount > 9 ? "9+" : unreadCount}
|
||||
</span>
|
||||
)}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user