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
446 changes: 374 additions & 72 deletions .oxlintrc.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default defineConfig([
"src/components/ui",
"!src/components/ui/theme-provider.tsx",
"!src/components/ui/carousel.tsx",
"!src/components/ui/data-table.tsx"
"!src/components/ui/data-table.tsx",
]),

{
Expand Down Expand Up @@ -47,6 +47,7 @@ export default defineConfig([
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
parser: tseslint.parser,
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
tsconfigRootDir: import.meta.dirname,
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"eslint-plugin-react-jsx": "^5.12.0",
"eslint-plugin-react-naming-convention": "^5.12.0",
"eslint-plugin-react-x": "^5.12.0",
"eslint-plugin-sonarjs": "^4.1.0",
"globals": "^17.7.0",
"oxfmt": "^0.58.0",
"oxlint": "^1.73.0",
Expand All @@ -68,8 +69,7 @@
"shadcn": "^4.13.0",
"tailwindcss": "^4.3.2",
"tw-animate-css": "^1.4.0",
"@typescript/native": "npm:typescript@^7.0.2",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript": "^6.0.3",
"typescript-eslint": "^8.62.1",
"vite": "^8.1.3"
}
Expand Down
1,020 changes: 309 additions & 711 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/app/check-in-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { cn } from "@/lib/utils";
/// Constants

const API_BASE_URL =
(import.meta.env.VITE_API_URL as string | undefined) || "http://localhost:8000";
(import.meta.env.VITE_API_URL as string | undefined) ?? "http://localhost:8000";

const STATUS_GREEN = "text-[#15a66e] bg-[#15a66e]/15 dark:text-[#3fd68c] dark:bg-[#3fd68c]/15";
const STATUS_MUTED = "text-muted-foreground bg-muted";
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
type CarouselOptions = UseCarouselParameters[0]
type CarouselPlugin = UseCarouselParameters[1]

type CarouselProps = {
interface CarouselProps {
opts?: CarouselOptions
orientation?: "horizontal" | "vertical"
plugins?: CarouselPlugin
Expand Down
10 changes: 5 additions & 5 deletions src/components/ui/theme-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ import { createContext, use, useCallback, useEffect, useMemo, useState } from "r

type Theme = "dark" | "light" | "system";

type ThemeProviderProps = {
interface ThemeProviderProps {
children: React.ReactNode;
defaultTheme?: Theme;
storageKey?: string;
};
}

type ThemeProviderState = {
interface ThemeProviderState {
setTheme: (theme: Theme) => void;
theme: Theme;
};
}

const initialState: ThemeProviderState = {
theme: "system",
setTheme: () => { /* noop */ },
setTheme: () => {},
};

const ThemeProviderContext = createContext(initialState);
Expand Down
18 changes: 12 additions & 6 deletions src/routes/dashboard/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const ROSTER_STATUS = {
} satisfies Record<RosterStatus, { className: string; icon: LucideIcon; label: string }>;

const API_BASE_URL =
(import.meta.env.VITE_API_URL as string | undefined) || "http://localhost:8000";
(import.meta.env.VITE_API_URL as string | undefined) ?? "http://localhost:8000";
const PACIFIC_TZ = "America/Los_Angeles";
const EVENTS_VIEWS: EventView[] = ["calendar", "grid", "list"];

Expand Down Expand Up @@ -452,11 +452,17 @@ function DashboardEvents() {

const code = (codeQuery.data?.code ?? "").slice(0, 8);
const copyCode = useCallback(() => {
void navigator.clipboard.writeText(code);
setCopied(true);
setTimeout(() => {
setCopied(false);
}, 1800);
navigator.clipboard
.writeText(code)
.then(() => {
setCopied(true);
setTimeout(() => {
setCopied(false);
}, 1800);
})
.catch(() => {
toast.error("Couldn't copy the code.");
});
}, [code]);

const dashboardEvents = useMemo<DashboardEvent[]>(
Expand Down
2 changes: 1 addition & 1 deletion src/routes/dashboard/events_.past.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const Route = createFileRoute("/dashboard/events_/past")({
/// Constants

const API_BASE_URL =
(import.meta.env.VITE_API_URL as string | undefined) || "http://localhost:8000";
(import.meta.env.VITE_API_URL as string | undefined) ?? "http://localhost:8000";
const PAST_VIEWS: EventView[] = ["list", "grid"];

const SHARED_QUERY_OPTIONS = {
Expand Down
24 changes: 19 additions & 5 deletions src/routes/dashboard/manage/projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@
type ManageStatus = "all" | "active" | "archived";
type DetailTab = "details" | "team";
type InviteAction = "accept" | "decline" | "revoke";
type RespondVars = { action: InviteAction; invite: ProjectInvite };
type InviteVars = { member: ProjectMember; projectId: string };
type SaveVars = { creating: boolean; project: FullProject };
type Editor = { creating: boolean; founded_at: string; id: string };
type RowHandler = (event: MouseEvent<HTMLElement>) => void;

interface ProjectPageParams {
Expand All @@ -127,6 +123,24 @@
onGallery: RowHandler;
}

interface RespondVars {
action: InviteAction;
invite: ProjectInvite;
}
interface InviteVars {
member: ProjectMember;
projectId: string;
}
interface SaveVars {
creating: boolean;
project: FullProject;
}
interface Editor {
creating: boolean;
founded_at: string;
id: string;
}

declare module "@tanstack/react-table" {
interface TableMeta<TData extends RowData> {
manage?: ManageProjectsMeta;
Expand Down Expand Up @@ -790,7 +804,7 @@
/// Editor field handlers

const handleSubmit = useCallback(() => {
form.handleSubmit().catch(() => {});
void form.handleSubmit();

Check failure on line 807 in src/routes/dashboard/manage/projects.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this use of the "void" operator.

See more on https://sonarcloud.io/project/issues?id=UCMercedACM_Chapter-Website&issues=AZ9ak4mxhOlX9D3Ppp9J&open=AZ9ak4mxhOlX9D3Ppp9J&pullRequest=809
}, [form]);
const handleText = useCallback(
(event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/dashboard/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const MANAGE_ROLES: Role[] = ["root", "admin", "manager"];
export const ROLES_BY_RANK: Role[] = ["root", "admin", "manager", "leads"];

const API_BASE_URL =
(import.meta.env.VITE_API_URL as string | undefined) || "http://localhost:8000";
(import.meta.env.VITE_API_URL as string | undefined) ?? "http://localhost:8000";

const SIDEBAR_STYLE = {
"--sidebar-width": "16.5rem",
Expand Down
2 changes: 1 addition & 1 deletion src/routes/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const EVENT_CALENDARS: Record<string, CalendarType> = Object.fromEntries(
);

const API_BASE_URL =
(import.meta.env.VITE_API_URL as string | undefined) || "http://localhost:8000";
(import.meta.env.VITE_API_URL as string | undefined) ?? "http://localhost:8000";

const EVENTS_PAGE_SIZE = 50;
const PACIFIC_TZ = "America/Los_Angeles";
Expand Down
2 changes: 0 additions & 2 deletions src/routes/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ function Login() {
<div className="flex flex-col gap-1.5">
<div className="flex items-center justify-between">
<Label htmlFor="password">Password</Label>
{/* TODO: wire to the Ory recovery flow (/recovery route, not built yet). */}
<Button
type="button"
variant="link"
Expand Down Expand Up @@ -191,7 +190,6 @@ function Login() {
<span className="h-px flex-1 bg-border" />
</div>

{/* TODO: Wire up Google Oauth2 and SSO (if needed)*/}
<div className="flex flex-col gap-3">
<Button type="button" variant="outline" size="lg" className="w-full font-semibold">
<SiGoogle />
Expand Down
1 change: 0 additions & 1 deletion src/routes/register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ function Register() {
<span className="h-px flex-1 bg-border" />
</div>

{/* TODO: Wire up Google Oauth2 and SSO (if needed)*/}
<div className="flex flex-col gap-3">
<Button type="button" variant="outline" size="lg" className="w-full font-semibold">
<SiGoogle />
Expand Down
Loading