Skip to content

Commit 53b6c41

Browse files
committed
feat(auth): enforce light theme for authentication pages
1 parent de41000 commit 53b6c41

File tree

4 files changed

+34
-24
lines changed

4 files changed

+34
-24
lines changed

apps/collabydraw/app/(auth-layout)/layout.tsx

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,30 @@ export default function AuthLayout({
77
children: React.ReactNode;
88
}) {
99
return (
10-
<div className="min-h-screen relative h-fit w-full overflow-hidden bg-yellow-lighter dark:bg-white">
11-
<S1 />
12-
<S2 />
13-
<S3 />
14-
<div className="h-fit min-h-screen w-full relative p-10 lg:p-12 overflow-hidden flex flex-col items-center justify-center">
15-
<div className="relative z-10">
16-
<Link href="/" className="Logo flex items-center select-none is-normal is-plain underline-none text-current">
17-
<div className=""><LogoSvg /></div>
18-
<div className="md:flex hidden">
19-
<h1 className="brand-title ExcalidrawLogo-text">CollabyDraw</h1>
20-
</div>
21-
</Link>
22-
</div>
23-
<div className="my-12 flex w-full grow flex-col items-center justify-center">
24-
<div className="w-full max-w-6xl">
25-
<div className="relative mx-auto w-full max-w-[30rem] lg:mx-0 lg:max-w-none">
26-
{children}
10+
<>
11+
<div className="collabydraw min-h-screen relative h-fit w-full overflow-hidden bg-yellow-lighter">
12+
<S1 />
13+
<S2 />
14+
<S3 />
15+
<div className="h-fit min-h-screen w-full relative p-10 lg:p-12 overflow-hidden flex flex-col items-center justify-center">
16+
<div className="relative z-10">
17+
<Link href="/" className="Logo flex items-center select-none is-normal is-plain underline-none text-current">
18+
<div className=""><LogoSvg /></div>
19+
<div className="md:flex hidden">
20+
<h1 className="brand-title ExcalidrawLogo-text font-excalifont">CollabyDraw</h1>
21+
</div>
22+
</Link>
23+
</div>
24+
<div className="my-12 flex w-full grow flex-col items-center justify-center">
25+
<div className="w-full max-w-6xl">
26+
<div className="relative mx-auto w-full max-w-[30rem] lg:mx-0 lg:max-w-none">
27+
{children}
28+
</div>
2729
</div>
2830
</div>
2931
</div>
3032
</div>
31-
</div>
33+
</>
3234
);
3335
};
3436

apps/collabydraw/components/theme-provider.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
"use client";
22

33
import { ThemeProvider as NextThemesProvider } from "next-themes";
4+
import { usePathname } from "next/navigation";
45
import { ReactNode, useEffect, useState } from "react";
56

67
export function ThemeProvider({ children }: { children: ReactNode }) {
78
const [mounted, setMounted] = useState(false);
9+
const pathname = usePathname();
10+
11+
const isAuthPath = pathname.startsWith('/auth/')
812

913
useEffect(() => {
1014
setMounted(true);
@@ -14,6 +18,10 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
1418
return <>{children}</>;
1519
}
1620

21+
if (isAuthPath) {
22+
return <>{children}</>
23+
}
24+
1725
return (
1826
<NextThemesProvider
1927
attribute="class"

apps/collabydraw/components/welcome-screen.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ export function MainMenuWelcome() {
99
<path fillRule="evenodd" clipRule="evenodd" d="m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z" fill="currentColor"></path>
1010
<path d="M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272" stroke="currentColor" strokeWidth="2" strokeLinecap="round"></path>
1111
</svg>
12-
<div className="welcome-screen-decor-hint__label">Export, preferences, languages, ...</div>
12+
<div className="welcome-screen-decor-hint__label font-excalifont">Export, preferences, languages, ...</div>
1313
</div>
1414
)
1515
}
1616

1717
export function ToolMenuWelcome() {
1818
return (
19-
<div className="excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--toolbar">
19+
<div className="excalifont z-[4] welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--toolbar">
2020
<div className="welcome-screen-decor-hint__label">Pick a tool &amp; Start drawing!</div>
2121
<svg aria-hidden="true" focusable="false" role="img" viewBox="0 0 38 78" className="" fill="none">
2222
<path d="M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5" stroke="currentColor" strokeWidth="2" strokeLinecap="round"></path>
@@ -30,15 +30,15 @@ export function ToolMenuWelcome() {
3030
export function HomeWelcome() {
3131
return (
3232
<>
33-
<div className="welcome-screen-center">
33+
<div className="welcome-screen-center z-[4]">
3434
<div className="welcome-screen-center__logo excalifont welcome-screen-decor">
3535
<div className="ExcalidrawLogo is-small">
3636
<svg viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" className="ExcalidrawLogo-icon">
3737
<path d="M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z" fill="currentColor"></path></svg>
38-
<h1 className="brand-title ExcalidrawLogo-text">CollabyDraw</h1>
38+
<h1 className="brand-title ExcalidrawLogo-text font-excalifont">CollabyDraw</h1>
3939
</div>
4040
</div>
41-
<div className="welcome-screen-center__heading welcome-screen-decor excalifont">All your data is saved locally in your browser.</div>
41+
<div className="welcome-screen-center__heading welcome-screen-decor font-excalifont">All your data is saved locally in your browser.</div>
4242
<div className="welcome-screen-menu">
4343
<button type="button" className="welcome-screen-menu-item ">
4444
<div className="welcome-screen-menu-item__icon">

apps/collabydraw/draw/Game.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ export class Game {
7575
this.canvas.height = document.body.clientHeight;
7676
this.onScaleChangeCallback = onScaleChangeCallback;
7777
this.roomName = roomName;
78+
this.selectionManager = new SelectionManager(this.ctx, canvas);
7879
this.init();
7980
this.initMouseHandler();
8081
this.isStandalone = isStandalone;
81-
this.selectionManager = new SelectionManager(this.ctx, canvas);
8282
// Add persistence callback
8383
this.selectionManager.setOnUpdate(() => {
8484
if (this.isStandalone) {

0 commit comments

Comments
 (0)