Skip to content

Commit 2a09acc

Browse files
committed
Tighten responsive shells and unify nav surfaces
1 parent 2d3e8c9 commit 2a09acc

6 files changed

Lines changed: 427 additions & 68 deletions

File tree

crates/http/src/views/pages/chat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl Render for Chat {
1818
fn render(&self) -> maud::Markup {
1919
let content = maud::html! {
2020
main
21-
class="container"
21+
class="container ui-chat-page"
2222
data-signals=({
2323
format!(
2424
"{{roomId: '{}', body: '', botBody: '', sseConnected: false}}",
@@ -33,7 +33,7 @@ impl Render for Chat {
3333
.build()
3434
})
3535

36-
section data-chat-surface {
36+
section class="ui-chat-page-surface" data-chat-surface {
3737
({
3838
chat::Connection::builder()
3939
.connected_signal(Text::from("$sseConnected"))

crates/http/src/views/pages/chat_moderation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use bon::Builder;
22
use maud::Render;
33

4+
use crate::paths::Route;
45
use crate::types::Text;
6+
use crate::views::page::{Layout, UserNav};
57
use crate::views::partials::{
68
CtaButton, CtaButtonType, CtaItem, CtaRow, CtaTone, ModerationAction,
79
};
8-
use crate::views::page::{Layout, UserNav};
9-
use crate::paths::Route;
1010

1111
#[derive(Builder)]
1212
pub struct ChatModeration {
@@ -18,7 +18,7 @@ pub struct ChatModeration {
1818
impl Render for ChatModeration {
1919
fn render(&self) -> maud::Markup {
2020
let content = maud::html! {
21-
main class="container" {
21+
main class="container ui-chat-page ui-chat-moderation-main" {
2222
header class="ui-chat-moderation-hero" data-chat-moderation-hero {
2323
div {
2424
h1 { "Chat moderation queue" }

crates/http/src/views/pages/login.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,36 @@ pub struct Login<'a> {
1414

1515
impl Render for Login<'_> {
1616
fn render(&self) -> maud::Markup {
17-
let next_query =
18-
self.next.map(|value| urlencoding::encode(value).to_string());
17+
let next_query = self
18+
.next
19+
.map(|value| urlencoding::encode(value).to_string());
1920
let content = maud::html! {
20-
main class="container" {
21-
article {
22-
header {
21+
main class="container ui-auth-main" {
22+
article class="ui-surface-card ui-auth-card" {
23+
header class="ui-auth-header" {
2324
h1 { "Sign in" }
25+
p class="ui-auth-summary" { "Use your email address to continue." }
2426
}
25-
p { "Use your email address to continue." }
2627

2728
@if let Some(message) = self.message {
28-
p role="alert" { (message) }
29+
p class="ui-demo-result ui-error-alert" role="alert" { (message) }
2930
}
3031

31-
form method="post" action=(Route::Login) {
32+
form class="ui-auth-form" method="post" action=(Route::Login) {
3233
@if let Some(next) = self.next {
3334
input type="hidden" name="next" value=(next);
3435
}
35-
label {
36-
"Email"
36+
label class="ui-auth-field" {
37+
span { "Email" }
3738
input type="email" name="email" required;
3839
}
39-
label {
40-
"Password"
40+
label class="ui-auth-field" {
41+
span { "Password" }
4142
input type="password" name="password" required;
4243
}
43-
button type="submit" { "Sign in" }
44+
button class="ui-auth-submit" type="submit" { "Sign in" }
4445
}
45-
p {
46+
p class="ui-auth-note" {
4647
"Need an account? "
4748
@if let Some(next) = next_query {
4849
a href=(format!("{}?next={}", Route::Register, next)) { "Create one" }

crates/http/src/views/pages/protected.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use bon::Builder;
22
use maud::Render;
33

4-
use crate::views::page::UserNav;
54
use crate::paths::Route;
65
use crate::types::Text;
6+
use crate::views::page::UserNav;
77

88
#[derive(Builder)]
99
pub struct Protected {
@@ -15,14 +15,14 @@ pub struct Protected {
1515
impl Render for Protected {
1616
fn render(&self) -> maud::Markup {
1717
let content = maud::html! {
18-
main class="container" {
19-
article {
20-
header {
18+
main class="container ui-auth-main ui-account-main" {
19+
article class="ui-surface-card ui-auth-card ui-account-card" {
20+
header class="ui-auth-header ui-account-header" {
2121
h1 { "Welcome, " (&self.username) }
2222
}
23-
p { "Signed in as " (&self.email) "." }
24-
form method="post" action=(Route::Logout) {
25-
button type="submit" { "Sign out" }
23+
p class="ui-auth-summary ui-account-summary" { "Signed in as " (&self.email) "." }
24+
form class="ui-account-actions" method="post" action=(Route::Logout) {
25+
button class="secondary ui-auth-submit" type="submit" { "Sign out" }
2626
}
2727
}
2828
}

crates/http/src/views/pages/register.rs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,41 @@ pub struct Register<'a> {
1414

1515
impl Render for Register<'_> {
1616
fn render(&self) -> maud::Markup {
17-
let next_query =
18-
self.next.map(|value| urlencoding::encode(value).to_string());
17+
let next_query = self
18+
.next
19+
.map(|value| urlencoding::encode(value).to_string());
1920
let content = maud::html! {
20-
main class="container" {
21-
article {
22-
header {
21+
main class="container ui-auth-main" {
22+
article class="ui-surface-card ui-auth-card" {
23+
header class="ui-auth-header" {
2324
h1 { "Create account" }
25+
p class="ui-auth-summary" { "Pick a username and password to get started." }
2426
}
25-
p { "Pick a username and password to get started." }
2627

2728
@if let Some(message) = self.message {
28-
p role="alert" { (message) }
29+
p class="ui-demo-result ui-error-alert" role="alert" { (message) }
2930
}
3031

31-
form method="post" action=(Route::Register) {
32+
form class="ui-auth-form" method="post" action=(Route::Register) {
3233
@if let Some(next) = self.next {
3334
input type="hidden" name="next" value=(next);
3435
}
35-
label {
36-
"Username"
36+
label class="ui-auth-field" {
37+
span { "Username" }
3738
input type="text" name="username" required;
3839
}
39-
label {
40-
"Email"
40+
label class="ui-auth-field" {
41+
span { "Email" }
4142
input type="email" name="email" required;
4243
}
43-
label {
44-
"Password"
44+
label class="ui-auth-field" {
45+
span { "Password" }
4546
input type="password" name="password" required;
4647
}
47-
button type="submit" { "Create account" }
48+
button class="ui-auth-submit" type="submit" { "Create account" }
4849
}
4950

50-
p {
51+
p class="ui-auth-note" {
5152
"Already have an account? "
5253
@if let Some(next) = next_query {
5354
a href=(format!("{}?next={}", Route::Login, next)) { "Sign in" }

0 commit comments

Comments
 (0)