Files
Ely-GPUI-Components/examples/gallery/pages/account/mod.rs
T
ZacharyZhang-NY c9e3400a71 Account · Sign in: log in, sign up, providers, a link by email, a second factor
LoginForm takes an email and a password, keeps one signed in on a box,
and signs in on Enter once the address reads and a password is typed;
a failed try says why above Sign in. SignupForm ticks a new password's
rules as they hold and waits for all of them and the terms.
OAuthButtons offer each provider, one spinning while the rest rest.
MagicLinkForm and ForgotPassword send a link to an address and, once
sent, say where it went and offer it again. TwoFactorInput takes a
six-digit code at once and, after one fails, clears the boxes through
forms::PinInput's new attempt, keeping its focus. The Account chapter
splits into sign-in, profile and access, and billing and team.
2026-09-27 13:12:49 -04:00

47 lines
1.3 KiB
Rust

use gpui::{AnyElement, App, Window, div, prelude::*};
mod sign_in;
use super::Page;
use crate::script::Step;
pub const PAGE: Page = Page {
number: 36,
slug: "account",
title: "Account",
summary: "Signing in and up, a link by email, a second factor, and the account once inside.",
render,
script: SCRIPT,
};
const SCRIPT: &[Step] = &[
Step::DownAt("account-login", 150.0, 280.0),
Step::UpAt("account-login", 150.0, 280.0),
Step::Type("ada@example.com"),
Step::Key("tab"),
Step::Type("hunter22"),
Step::Key("enter"),
Step::Wait(200),
Step::Shot("sign-in-failed"),
Step::DownAt("account-magic", 150.0, 150.0),
Step::UpAt("account-magic", 150.0, 150.0),
Step::Type("ada@example.com"),
Step::Key("enter"),
Step::Wait(200),
Step::Shot("link-sent"),
Step::DownAt("account-factor", 120.0, 110.0),
Step::UpAt("account-factor", 120.0, 110.0),
Step::Type("123456"),
Step::Wait(200),
Step::Shot("code-failed"),
];
fn render(window: &mut Window, cx: &mut App) -> AnyElement {
div()
.child(sign_in::sign_in(window, cx))
.child(sign_in::sign_up(window, cx))
.child(sign_in::by_email(window, cx))
.child(sign_in::second_factor(window, cx))
.into_any_element()
}