Skip to content

Commit 15d4623

Browse files
committed
chore: style the reactions better
1 parent 916a8be commit 15d4623

File tree

2 files changed

+40
-24
lines changed

2 files changed

+40
-24
lines changed

crates/rostra-web-ui/assets/style.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ img {
431431
max-width: 50rem;
432432
}
433433

434+
434435
.m-postOverview__userImage {
435436
margin: 2pt;
436437
}
@@ -516,10 +517,21 @@ emoji-picker {
516517

517518
.m-postOverview__buttonBar {
518519
display: flex;
519-
justify-content: flex-end;
520+
justify-content: space-between;
520521
gap: 5pt;
521522
}
522523

524+
525+
.m-postOverview__reactions {
526+
display: flex;
527+
gap: .5rem;
528+
}
529+
530+
.m-postOverview__buttons {
531+
display: flex;
532+
gap: .5rem;
533+
}
534+
523535
.m-postOverview__commentsButtonIcon {
524536
background: url('/assets/icons/comment.svg') center/contain no-repeat;
525537
}

crates/rostra-web-ui/src/routes/timeline.rs

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -589,32 +589,36 @@ impl UiState {
589589
let button_bar = html! {
590590
@if let Some(ext_event_id) = external_event_id {
591591
div ."m-postOverview__buttonBar" {
592-
(reactions_html)
593-
@if let Some(reply_count) = reply_count {
594-
@if reply_count > 0 {
595-
button ."m-postOverview__commentsButton u-button"
596-
hx-get={"/ui/comments/"(ext_event_id.event_id().to_short())}
597-
hx-target="next .m-postOverview__comments"
598-
hx-swap="outerHTML"
599-
{
600-
span ."m-postOverview__commentsButtonIcon u-buttonIcon" width="1rem" height="1rem" {}
601-
@if reply_count == 1 {
602-
("1 Reply".to_string())
603-
} @else {
604-
(format!("{} Replies", reply_count))
592+
div .m-postOverview__reactions {
593+
(reactions_html)
594+
}
595+
div ."m-postOverview__buttons" {
596+
@if let Some(reply_count) = reply_count {
597+
@if reply_count > 0 {
598+
button ."m-postOverview__commentsButton u-button"
599+
hx-get={"/ui/comments/"(ext_event_id.event_id().to_short())}
600+
hx-target="next .m-postOverview__comments"
601+
hx-swap="outerHTML"
602+
{
603+
span ."m-postOverview__commentsButtonIcon u-buttonIcon" width="1rem" height="1rem" {}
604+
@if reply_count == 1 {
605+
("1 Reply".to_string())
606+
} @else {
607+
(format!("{} Replies", reply_count))
608+
}
605609
}
606610
}
607-
}
608611

609-
}
610-
button ."m-postOverview__replyToButton u-button"
611-
disabled[ro.to_disabled()]
612-
hx-get={"/ui/post/reply_to?reply_to="(ext_event_id)}
613-
hx-target=".m-newPostForm__replyToLine"
614-
hx-swap="outerHTML"
615-
{
616-
span ."m-postOverview__replyToButtonIcon u-buttonIcon" width="1rem" height="1rem" {}
617-
"Reply"
612+
}
613+
button ."m-postOverview__replyToButton u-button"
614+
disabled[ro.to_disabled()]
615+
hx-get={"/ui/post/reply_to?reply_to="(ext_event_id)}
616+
hx-target=".m-newPostForm__replyToLine"
617+
hx-swap="outerHTML"
618+
{
619+
span ."m-postOverview__replyToButtonIcon u-buttonIcon" width="1rem" height="1rem" {}
620+
"Reply"
621+
}
618622
}
619623
}
620624
}

0 commit comments

Comments
 (0)