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
8 changes: 7 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { PlanningPage } from "./pages/planning/page";
import { LoginPage } from "./pages/secondary/login";
import { AgendaPage } from "./pages/secondary/agenda";
import { WelcomePage } from "./pages/secondary/welcome";
import { LogsPage } from "./pages/secondary/logs";
import * as Sentry from "@sentry/react";
import { InitialGetter } from "./contexts/initialGetter";

Expand Down Expand Up @@ -84,6 +85,7 @@ function AppRoutes() {
path="/associations"
element={<AssociationsPage />}
/>
<Route path="/logs" element={<LogsPage />} />
<Route path="/agenda" element={<AgendaPage />} />
</Route>
</Routes>
Expand All @@ -92,14 +94,18 @@ function AppRoutes() {
}

function App() {
const baseUrl = import.meta.env.BASE_URL ?? "/";
const routerBaseName =
baseUrl === "/" ? undefined : baseUrl.replace(/\/$/, "");

return (
<ThemeProvider defaultTheme="light">
<BackgroundProvider defaultBackground="particles">
<ToastContextProvider>
<ModalContextProvider>
<Toaster richColors position="top-center" />
<InitialGetter>
<BrowserRouter>
<BrowserRouter basename={routerBaseName}>
<ReactQueryProvider>
<CurrentYearProvider>
<AppRoutes />
Expand Down
22 changes: 19 additions & 3 deletions src/components/bottom-navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils/cn";
import { useNavigate, useLocation } from "react-router";
import { useTranslation } from "react-i18next";
import { useTheme } from "@/components/theme-provider";

export default function BottomNavigation() {
const navigate = useNavigate();
const { t } = useTranslation();
const location = useLocation();
const pathname = location.pathname;
const { theme } = useTheme();
const hoverWhite = theme === "dark" || theme === "oled";
const hoverTextClass = hoverWhite
? "group-hover:text-white"
: "group-hover:text-mauria-purple";

const items = [
{
Expand Down Expand Up @@ -70,7 +76,7 @@ export default function BottomNavigation() {
"group flex h-auto flex-1 flex-col items-center gap-1 rounded-full px-4 pb-2 pt-2 text-[0.7rem] font-medium transition-colors hover:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 [&_svg]:size-7 min-w-0",
isActive
? "text-mauria-purple dark:text-white oled:text-gray-100"
: "text-gray-400 dark:text-gray-500 oled:text-gray-500 group-hover:text-mauria-purple dark:group-hover:text-white oled:group-hover:text-gray-200"
: "text-gray-400 dark:text-gray-500 oled:text-gray-500"
)}
onClick={() => navigate(item.path)}
aria-current={isActive ? "page" : undefined}
Expand All @@ -84,9 +90,19 @@ export default function BottomNavigation() {
: "bg-transparent group-hover:bg-mauria-purple/10 dark:group-hover:bg-white/10 oled:group-hover:bg-white/10"
)}
/>
<item.icon className="relative z-10" />
<item.icon
className={cn(
"relative z-10 transition-colors",
hoverTextClass
)}
/>
</span>
<span className="leading-none text-inherit">
<span
className={cn(
"leading-none text-inherit transition-colors",
hoverTextClass
)}
>
{item.label}
</span>
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/drawer-event-task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export function DrawerEventTask({
</DrawerTrigger>
)}

<DrawerContent>
<DrawerContent className="bg-mauria-card shadow-2xl">
<DrawerHeader>
<DrawerTitle>{drawerTitle}</DrawerTitle>
</DrawerHeader>
Expand Down
51 changes: 43 additions & 8 deletions src/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@

import { useEffect, useState, type CSSProperties } from "react";
import {
Rainbow,
Cherry,
Moon,
Sun,
MoonStar,
TreePine,
Waves,
Menu,
HeartHandshake,
BadgeX,
Expand Down Expand Up @@ -83,6 +87,10 @@ export default function Sidebar() {
light: { Icon: Sun, label: t("sidebar.themeParameter.light") },
dark: { Icon: Moon, label: t("sidebar.themeParameter.dark") },
oled: { Icon: MoonStar, label: t("sidebar.themeParameter.oled") },
cherry: { Icon: Cherry, label: t("sidebar.themeParameter.cherry") },
ocean: { Icon: Waves, label: t("sidebar.themeParameter.ocean") },
forest: { Icon: TreePine, label: t("sidebar.themeParameter.forest") },
pride: { Icon: Rainbow, label: t("sidebar.themeParameter.pride") },
} as const;

const { Icon: ThemeIcon, label: themeLabel } =
Expand Down Expand Up @@ -120,6 +128,22 @@ export default function Sidebar() {
value: "oled",
label: t("sidebar.themeParameter.oled"),
},
{
value: "cherry",
label: t("sidebar.themeParameter.cherry"),
},
{
value: "ocean",
label: t("sidebar.themeParameter.ocean"),
},
{
value: "forest",
label: t("sidebar.themeParameter.forest"),
},
{
value: "pride",
label: t("sidebar.themeParameter.pride"),
},
],
},
{
Expand Down Expand Up @@ -210,7 +234,7 @@ export default function Sidebar() {
<Button
variant="ghost"
size="icon"
className="text-white [&_svg]:size-7!"
className="text-white [&_svg]:size-7! hover:bg-white/15 hover:text-white"
>
<Menu />
<span className="sr-only">{t("sidebar.openMenu")}</span>
Expand Down Expand Up @@ -282,7 +306,7 @@ export default function Sidebar() {
<Button
variant="ghost"
size="sm"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7 hover:bg-mauria-purple/10 dark:hover:bg-white/10 oled:hover:bg-white/10"
onClick={() => handleNavigate("/associations")}
>
<HeartHandshake className="h-5 w-5" />
Expand All @@ -295,7 +319,7 @@ export default function Sidebar() {
<Button
variant="ghost"
size="sm"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7 hover:bg-mauria-purple/10 dark:hover:bg-white/10 oled:hover:bg-white/10"
onClick={() => window.open(aurionURL, "_blank")}
>
<ThumbsDown className="h-5 w-5" />
Expand All @@ -308,7 +332,7 @@ export default function Sidebar() {
<Button
variant="ghost"
size="sm"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7 hover:bg-mauria-purple/10 dark:hover:bg-white/10 oled:hover:bg-white/10"
onClick={() =>
window.open(juniaLearningURL, "_blank")
}
Expand All @@ -323,7 +347,7 @@ export default function Sidebar() {
<Button
variant="ghost"
size="sm"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7 hover:bg-mauria-purple/10 dark:hover:bg-white/10 oled:hover:bg-white/10"
onClick={() => window.open(printURL, "_blank")}
>
<Printer className="h-5 w-5" />
Expand All @@ -340,7 +364,7 @@ export default function Sidebar() {
<Button
variant="ghost"
size="sm"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7 hover:bg-mauria-purple/10 dark:hover:bg-white/10 oled:hover:bg-white/10"
onClick={() => window.open(contactURL, "_blank")}
>
<MailQuestionMark className="h-5 w-5" />
Expand All @@ -353,7 +377,7 @@ export default function Sidebar() {
<Button
variant="ghost"
size="sm"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7 text-red-500 oled:text-gray-200"
className="group w-full justify-start gap-3 px-0 h-10 [&_svg]:size-7 text-red-500 oled:text-gray-200 hover:bg-mauria-purple/10 dark:hover:bg-white/10 oled:hover:bg-white/10"
onClick={signOut}
>
<BadgeX className="h-5 w-5" />
Expand Down Expand Up @@ -390,7 +414,18 @@ export default function Sidebar() {
onClick={handleModeBeta}
>
<span className="text-xs text-muted-foreground">
<span className="">mode Beta</span>
<span className="">beta</span>
</span>
</Button>
<span className="ml-1">—</span>
<Button
variant="link"
size="sm"
className="p-0 ml-2"
onClick={() => handleNavigate("/logs")}
>
<span className="text-xs text-muted-foreground">
<span className="">logs</span>
</span>
</Button>
</div>
Expand Down
12 changes: 10 additions & 2 deletions src/components/theme-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type React from "react";

import { createContext, useContext, useEffect, useState } from "react";

type Theme = "dark" | "light" | "oled";
type Theme = "dark" | "light" | "oled" | "cherry" | "pride" | "ocean" | "forest";

type ThemeProviderProps = {
children: React.ReactNode;
Expand All @@ -30,7 +30,15 @@ export function ThemeProvider({

useEffect(() => {
const root = window.document.documentElement;
root.classList.remove("light", "dark", "oled");
root.classList.remove(
"light",
"dark",
"oled",
"cherry",
"pride",
"ocean",
"forest"
);
root.classList.add(theme);
saveToStorage("theme", theme);
}, [theme]);
Expand Down
24 changes: 22 additions & 2 deletions src/components/theme-toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
"use client";

import { Moon, MoonStar, Sun } from "lucide-react";
import { Cherry, Moon, MoonStar, Rainbow, Sun, TreePine, Waves } from "lucide-react";
import { useTheme } from "@/components/theme-provider";
import { Button } from "@/components/ui/button";

export function ThemeToggle() {
const { theme, setTheme } = useTheme();

const themeCycle: typeof theme[] = ["light", "dark", "oled"];
const themeCycle: typeof theme[] = [
"light",
"cherry",
"ocean",
"forest",
"pride",
"dark",
"oled",
];
const nextTheme = () => {
const currentIndex = themeCycle.indexOf(theme);
const nextIndex = (currentIndex + 1) % themeCycle.length;
Expand All @@ -31,6 +39,18 @@ export function ThemeToggle() {
{theme === "oled" && (
<MoonStar className="h-[1.2rem] w-[1.2rem] text-white" />
)}
{theme === "cherry" && (
<Cherry className="h-[1.2rem] w-[1.2rem] text-white" />
)}
{theme === "ocean" && (
<Waves className="h-[1.2rem] w-[1.2rem] text-white" />
)}
{theme === "forest" && (
<TreePine className="h-[1.2rem] w-[1.2rem] text-white" />
)}
{theme === "pride" && (
<Rainbow className="h-[1.2rem] w-[1.2rem] text-white" />
)}
</Button>
);
}
5 changes: 4 additions & 1 deletion src/components/ui/shadcn-io/grid-pattern/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface GridPatternProps {
squares?: Array<[number, number]>;
strokeDasharray?: string;
className?: string;
style?: React.CSSProperties;
[key: string]: unknown;
}

Expand All @@ -22,6 +23,7 @@ export function GridPattern({
strokeDasharray = "0",
squares,
className,
style,
...props
}: GridPatternProps) {
const id = React.useId();
Expand All @@ -30,9 +32,10 @@ export function GridPattern({
<svg
aria-hidden="true"
className={cn(
"pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30",
"pointer-events-none absolute inset-0 h-full w-full fill-current/30 stroke-current/30",
className
)}
style={{ color: "hsl(var(--mauria-border))", ...style }}
{...props}
>
<defs>
Expand Down
6 changes: 4 additions & 2 deletions src/components/ui/sonner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ const Toaster = ({
...props
}: ToasterProps) => {
const { theme = "system" } = useTheme();
const sonnerTheme: ToasterProps["theme"] =
theme === "dark" || theme === "oled" ? "dark" : "light";

const mergedToastOptions: ToasterProps["toastOptions"] = {
...toastOptions,
classNames: {
...toastOptions?.classNames,
toast: mergeClassName(
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
"group toast bg-background text-foreground border border-border shadow-lg",
toastOptions?.classNames?.toast
),
description: mergeClassName(
Expand All @@ -61,7 +63,7 @@ const Toaster = ({

return (
<Sonner
theme={theme as ToasterProps["theme"]}
theme={sonnerTheme}
className="toaster group"
toastOptions={mergedToastOptions}
offset={resolveOffset(offset)}
Expand Down
Loading