forge
Explore
Log in

Don't you dare go Hollow

forge

Clone
★ 0

0 watching0 forksRustAGPL-3.07.1 MiB490f099Tahinli7 hours ago322 commits

commit_line.rs21 lines, 829 bytesHistoryRawDownload
1//! A commit subject on one line, shared by every list that shows subjects one per row: the commit
2//! list, compare, branches, the tree's last-commit cells, blame and the CI runs. It shows the
3//! subject as written, like GitHub. The full subject is the `title` attribute.
4
5use topcoat::Result;
6use topcoat::context::Cx;
7use topcoat::view::{View, component, view};
8
9use crate::render::emoji::emojify;
10
11/// One subject on one line as it was written, header included, truncated by CSS. The full subject
12/// is the `title` attribute.
13#[component]
14pub async fn commit_line(cx: &Cx, subject: String) -> Result<impl View> {
15 let text = emojify(&subject).into_owned();
16 Ok(view! {
17 <span class="commit-line" title=(text.as_str())>
18 <span class="commit-line-text">(text.as_str())</span>
19 </span>
20 })
21}