diff --git a/apps/desktop/src/components/main/body/onboarding/index.tsx b/apps/desktop/src/components/main/body/onboarding/index.tsx index 9c1e8be010..bffbb36690 100644 --- a/apps/desktop/src/components/main/body/onboarding/index.tsx +++ b/apps/desktop/src/components/main/body/onboarding/index.tsx @@ -117,72 +117,79 @@ export function TabContentOnboarding({ return ( -
- - -
+
+

Welcome to Char

- - - - - - - - - - - - - - setIsMuted((prev) => !prev)} + className="p-1.5 rounded-full hover:bg-neutral-100 transition-colors" + aria-label={isMuted ? "Unmute" : "Mute"} > - - - - void finishOnboarding(handleFinish)} - > - - + {isMuted ? ( + + ) : ( + + )} + +
+ +
+
+ + + + + + + + + + + + + + + + + void finishOnboarding(handleFinish)} + > + + +
diff --git a/apps/desktop/src/components/onboarding/account/before-login.tsx b/apps/desktop/src/components/onboarding/account/before-login.tsx index 237ddf5970..f0e8aa4852 100644 --- a/apps/desktop/src/components/onboarding/account/before-login.tsx +++ b/apps/desktop/src/components/onboarding/account/before-login.tsx @@ -3,58 +3,32 @@ import { useEffect, useState } from "react"; import { useAuth } from "../../../auth"; import { OnboardingButton } from "../shared"; -export function BeforeLogin({ onContinue }: { onContinue: () => void }) { - return ( -
- - -
- ); -} - -function SigninButton() { - const auth = useAuth(); - - const triggered = useAutoTriggerSignin(); - - return ( - auth?.signIn()} disabled={triggered}> - {triggered ? "Click here to Sign in" : "Signing in on your browser..."} - - ); -} - -function ControlRegion(_: { handleContinue: () => void }) { +export function BeforeLogin() { const auth = useAuth(); + const autoSignInCompleted = useAutoTriggerSignin(); const [showCallbackUrlInput, setShowCallbackUrlInput] = useState(false); return (
- {showCallbackUrlInput ? : null} - -
- - - / - - {/* or - */} + {autoSignInCompleted + ? "Click here to Sign in" + : "Signing in on your browser..."} + + {autoSignInCompleted && ( + + )}
+ {showCallbackUrlInput && }
); } diff --git a/apps/desktop/src/components/onboarding/account/index.tsx b/apps/desktop/src/components/onboarding/account/index.tsx index cc19f24a2b..8d7b8aa468 100644 --- a/apps/desktop/src/components/onboarding/account/index.tsx +++ b/apps/desktop/src/components/onboarding/account/index.tsx @@ -9,5 +9,5 @@ export function LoginSection({ onContinue }: { onContinue: () => void }) { return ; } - return ; + return ; } diff --git a/apps/desktop/src/components/onboarding/final.tsx b/apps/desktop/src/components/onboarding/final.tsx index 28813dfcf7..5fb593c0e3 100644 --- a/apps/desktop/src/components/onboarding/final.tsx +++ b/apps/desktop/src/components/onboarding/final.tsx @@ -1,3 +1,5 @@ +import { Icon } from "@iconify-icon/react"; + import { commands as analyticsCommands } from "@hypr/plugin-analytics"; import { commands as openerCommands } from "@hypr/plugin-opener2"; import { commands as sfxCommands } from "@hypr/plugin-sfx"; @@ -6,29 +8,43 @@ import { commands } from "../../types/tauri.gen"; import { OnboardingButton } from "./shared"; const SOCIALS = [ - { label: "Discord", url: "https://discord.gg/CX8gTH2tj9" }, - { label: "GitHub", url: "https://github.com/fastrepl/hyprnote" }, - { label: "X", url: "https://x.com/getcharnotes" }, + { + label: "Discord", + icon: "simple-icons:discord", + size: 14, + url: "https://discord.gg/CX8gTH2tj9", + }, + { + label: "GitHub", + icon: "simple-icons:github", + size: 14, + url: "https://github.com/fastrepl/hyprnote", + }, + { + label: "X", + icon: "simple-icons:x", + size: 10, + url: "https://x.com/getcharnotes", + }, ] as const; export function FinalSection({ onContinue }: { onContinue: () => void }) { return (
-
-

- Join our community and stay updated: -

-
- {SOCIALS.map(({ label, url }) => ( +
+ Join our community and stay updated: + {SOCIALS.map(({ label, icon, size, url }) => { + return ( - ))} -
+ ); + })}
void finishOnboarding(onContinue)}> diff --git a/apps/desktop/src/components/onboarding/shared.tsx b/apps/desktop/src/components/onboarding/shared.tsx index 0abe4c0e7d..b65fb850dc 100644 --- a/apps/desktop/src/components/onboarding/shared.tsx +++ b/apps/desktop/src/components/onboarding/shared.tsx @@ -7,14 +7,17 @@ import { XCircleIcon, } from "lucide-react"; import { AnimatePresence, motion } from "motion/react"; -import type { ReactNode } from "react"; +import { type ReactNode, useEffect, useRef } from "react"; import { cn } from "@hypr/utils"; +const SCROLL_DELAY_MS = 350; + export type SectionStatus = "completed" | "active" | "upcoming"; export function OnboardingSection({ title, + completedTitle, description, status, onBack, @@ -22,34 +25,54 @@ export function OnboardingSection({ children, }: { title: string; + completedTitle?: string; description?: string; status: SectionStatus | null; onBack?: () => void; onNext?: () => void; children: ReactNode; }) { - if (!status) return null; + const sectionRef = useRef(null); const isActive = status === "active"; const isCompleted = status === "completed"; + useEffect(() => { + if (!isActive) return; + const timeout = setTimeout(() => { + sectionRef.current?.scrollIntoView({ behavior: "smooth", block: "start" }); + }, SCROLL_DELAY_MS); + return () => clearTimeout(timeout); + }, [isActive]); + + if (!status || status === "upcoming") return null; + return ( -
+
+ {isCompleted && ( + + )}
-

- {title} +

+ {isCompleted ? (completedTitle ?? title) : title}

- {isCompleted && ( - - )} {import.meta.env.DEV && isActive && (onBack || onNext) && (
{onBack && ( @@ -103,7 +126,7 @@ export function OnboardingButton( return (