Skip to content

Commit

Permalink
feat: Clickable cards
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Sep 1, 2024
1 parent f93ea30 commit 58df300
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
30 changes: 16 additions & 14 deletions src/components/project_card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@ const STARGAZERS_PROPERTY_PATTERN: &str = "\"stargazers_count\":";
#[component]
pub fn ProjectCard(project: &'static Project<'static>, insert_stars: bool) -> Element {
rsx!(
div { class: "text-white p-4 border-2 border-blue-1 rounded-lg drop-shadow-sm hover:bg-blue-1 duration-75",
table { class: "text-left [&_th]:pr-4",
tr {
th { "πŸ‘€ Name" }
td { "{project.name}" }
Link { to: "{project.repository_url}",
div { class: "text-white p-4 border-2 border-blue-1 rounded-lg drop-shadow-sm hover:bg-blue-1 duration-75",
table { class: "text-left [&_th]:pr-4",
tr {
th { "πŸ‘€ Name" }
td { "{project.name}" }
}
tr {
th { "πŸ“œ Description" }
td { "{project.description}" }
}
tr {
th { "πŸ’Ύ Repository" }
td { "{project.repository_name}" }
}
Stars { project, insert_stars }
}
tr {
th { "πŸ“œ Description" }
td { "{project.description}" }
}
tr {
th { "πŸ’Ύ Repository" }
td { Link { class: "underline", to: "{project.repository_url}", "{project.repository_name}" } }
}
Stars { project, insert_stars }
}
}
)
Expand Down
5 changes: 4 additions & 1 deletion src/our_projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ macro_rules! our_project {
"https://github.com/dioxus-community/",
$repository_name
)),
repository_name: ::std::borrow::Cow::Borrowed($repository_name),
repository_name: ::std::borrow::Cow::Borrowed(concat!(
"dioxus-community/",
$repository_name
)),
star_count: None,
category: $category,
}
Expand Down

0 comments on commit 58df300

Please sign in to comment.