Skip to content

Commit 9a63d0f

Browse files
authored
feat: Add "Home" button to signup page (#235)
1 parent a8c1894 commit 9a63d0f

3 files changed

Lines changed: 30 additions & 2 deletions

File tree

apps/web-dashboard/src/components/AuthShell.jsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ function AuthShell({
88
alternateTo,
99
alternateText,
1010
children,
11+
onModeClick,
1112
}) {
1213
return (
1314
<div className="auth-shell">
@@ -17,7 +18,18 @@ function AuthShell({
1718
<div className="auth-shell__content">
1819
<div className="auth-form-card">
1920
<div className="auth-form-card__header">
20-
<span className="auth-form-card__mode">{modeLabel}</span>
21+
{onModeClick ? (
22+
<button
23+
type="button"
24+
className="auth-form-card__mode auth-form-card__mode--clickable"
25+
onClick={onModeClick}
26+
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: 0 }}
27+
>
28+
{modeLabel}
29+
</button>
30+
) : (
31+
<span className="auth-form-card__mode">{modeLabel}</span>
32+
)}
2133
{title ? <h1>{title}</h1> : null}
2234
{subtitle ? <p>{subtitle}</p> : null}
2335
</div>

apps/web-dashboard/src/index.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,21 @@ select option {
861861
text-transform: uppercase;
862862
}
863863

864+
.auth-form-card__mode--clickable {
865+
cursor: pointer;
866+
transition: all 0.2s ease;
867+
}
868+
869+
.auth-form-card__mode--clickable:hover {
870+
background: var(--color-auth-mode-bg);
871+
color: var(--color-primary);
872+
text-decoration: underline;
873+
}
874+
875+
.auth-form-card__mode--clickable:active {
876+
opacity: 0.8;
877+
}
878+
864879
.auth-form-card__header h1 {
865880
margin-bottom: 0.4rem;
866881
color: var(--color-auth-heading);

apps/web-dashboard/src/pages/Signup.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,13 @@ function Signup() {
9696

9797
return (
9898
<AuthShell
99-
modeLabel="Create account"
99+
modeLabel="← Home / Create Account"
100100
title=""
101101
subtitle=""
102102
alternateText="Already have access?"
103103
alternateLabel="Sign in instead"
104104
alternateTo="/login"
105+
onModeClick={() => navigate('/')}
105106
>
106107
<form className="auth-form" onSubmit={handleSubmit}>
107108
<button

0 commit comments

Comments
 (0)