Skip to content
Merged
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
62 changes: 35 additions & 27 deletions apps/desktop/src/onboarding/account/before-login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,29 @@ export function BeforeLogin({ onContinue }: { onContinue: () => void }) {
>
Sign in
</OnboardingButton>
{didClickSignIn && (
{didClickSignIn ? (
<button
type="button"
className="text-sm text-neutral-500 underline hover:text-neutral-600"
onClick={() => setShowCallbackUrlInput(true)}
>
Something not working?
</button>
) : (
<button
type="button"
onClick={() => {
void analyticsCommands.event({
event: "onboarding_login_skipped",
});
onContinue();
}}
className="text-sm text-neutral-500/70 transition-colors hover:text-neutral-700"
>
Skip for now
</button>
)}
</div>
<button
type="button"
onClick={() => {
void analyticsCommands.event({ event: "onboarding_login_skipped" });
onContinue();
}}
className="text-sm text-neutral-500/70 transition-colors hover:text-neutral-700"
>
Skip for now
</button>
</div>
{showCallbackUrlInput && <CallbackUrlInput />}
</div>
Expand All @@ -55,22 +58,27 @@ function CallbackUrlInput() {
const [callbackUrl, setCallbackUrl] = useState("");

return (
<div className="relative flex items-center overflow-hidden rounded-full border border-neutral-200 transition-all duration-200 focus-within:border-neutral-400">
<input
type="text"
className="flex-1 bg-white px-4 py-3 font-mono text-xs outline-hidden"
placeholder="Paste browser url here, after you've signed in. (Like: http://char.com/callback/auth/?flow=desktop&scheme=hyprnote&access_token=<V>&refresh_token=<V>)"
value={callbackUrl}
onChange={(e) => setCallbackUrl(e.target.value)}
/>
<button
type="button"
onClick={() => auth?.handleAuthCallback(callbackUrl)}
disabled={!callbackUrl}
className="absolute right-0.5 rounded-full bg-neutral-600 px-4 py-2 text-sm text-white transition-all enabled:hover:scale-[1.02] enabled:active:scale-[0.98] disabled:opacity-50"
>
Submit
</button>
<div className="flex flex-col gap-2">
<div className="relative flex items-center overflow-hidden rounded-full border border-neutral-200 transition-all duration-200 focus-within:border-neutral-400">
<input
type="text"
className="flex-1 bg-white px-4 py-3 font-mono text-xs outline-hidden"
placeholder="http://char.com/callback/auth/?flow=desktop&scheme=hyprnote&access_token=<V>&refresh_token=<V>"
value={callbackUrl}
onChange={(e) => setCallbackUrl(e.target.value)}
/>
<button
type="button"
onClick={() => auth?.handleAuthCallback(callbackUrl)}
disabled={!callbackUrl}
className="absolute right-0.5 rounded-full bg-neutral-600 px-4 py-2 text-sm text-white transition-all enabled:hover:scale-[1.02] enabled:active:scale-[0.98] disabled:opacity-50"
>
Submit
</button>
</div>
<p className="px-4 text-xs text-neutral-500">
Paste the browser URL here after you sign in.
</p>
</div>
);
}
Loading