Skip to content

Commit aeb15a5

Browse files
committed
feat: a few ui changes
1 parent 2aeddcc commit aeb15a5

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

apps/twig/src/renderer/components/TorchGlow.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ import { useEffect, useState } from "react";
44

55
interface TorchGlowProps {
66
containerRef: React.RefObject<HTMLElement | null>;
7+
alwaysShow?: boolean;
78
}
89

9-
export function TorchGlow({ containerRef }: TorchGlowProps) {
10+
export function TorchGlow({
11+
containerRef,
12+
alwaysShow = false,
13+
}: TorchGlowProps) {
1014
const isDarkMode = useThemeStore((state) => state.isDarkMode);
1115
const cursorGlow = useSettingsStore((state) => state.cursorGlow);
1216
const [mousePos, setMousePos] = useState<{ x: number; y: number } | null>(
@@ -43,8 +47,9 @@ export function TorchGlow({ containerRef }: TorchGlowProps) {
4347
};
4448
}, [containerRef]);
4549

46-
// Only show in dark mode when hovering and cursor glow is enabled
47-
if (!isDarkMode || !cursorGlow || !isHovering || !mousePos) return null;
50+
// Only show in dark mode when hovering and cursor glow is enabled (unless alwaysShow)
51+
const shouldShow = alwaysShow || (isDarkMode && cursorGlow);
52+
if (!shouldShow || !isHovering || !mousePos) return null;
4853

4954
return (
5055
<>

apps/twig/src/renderer/features/auth/components/AuthScreen.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { DraggableTitleBar } from "@components/DraggableTitleBar";
2+
import { TorchGlow } from "@components/TorchGlow";
23
import { useAuthStore } from "@features/auth/stores/authStore";
34
import { Box, Button, Flex, Text } from "@radix-ui/themes";
45
import caveHero from "@renderer/assets/images/cave-hero.jpg";
56
import twigLogo from "@renderer/assets/images/twig-logo.svg";
67
import { trpcVanilla } from "@renderer/trpc/client";
78
import type { CloudRegion } from "@shared/types/oauth";
89
import { useMutation } from "@tanstack/react-query";
9-
import { useState } from "react";
10+
import { useRef, useState } from "react";
1011
import { LoginForm } from "./LoginForm";
1112
import { SignupForm } from "./SignupForm";
1213

@@ -41,6 +42,7 @@ export const getErrorMessage = (error: unknown) => {
4142
type AuthMode = "login" | "signup";
4243

4344
export function AuthScreen() {
45+
const caveBackgroundRef = useRef<HTMLDivElement>(null);
4446
const [region, setRegion] = useState<CloudRegion>("us");
4547
const [authMode, setAuthMode] = useState<AuthMode>("login");
4648
const { loginWithOAuth, signupWithOAuth } = useAuthStore();
@@ -89,8 +91,13 @@ export function AuthScreen() {
8991
const errorMessage = getErrorMessage(error);
9092

9193
return (
92-
<Flex height="100vh" style={{ position: "relative" }}>
94+
<Flex
95+
ref={caveBackgroundRef}
96+
height="100vh"
97+
style={{ position: "relative" }}
98+
>
9399
<DraggableTitleBar />
100+
<TorchGlow containerRef={caveBackgroundRef} alwaysShow />
94101
{/* Full-screen cave painting background */}
95102
<div
96103
style={{
@@ -112,7 +119,7 @@ export function AuthScreen() {
112119
zIndex: 1,
113120
}}
114121
>
115-
<Flex direction="column" gap="6" style={{ maxWidth: "320px" }}>
122+
<Flex direction="column" gap="6" style={{ width: "320px" }}>
116123
<Flex direction="column" gap="4">
117124
<img
118125
src={twigLogo}

0 commit comments

Comments
 (0)