From a5f63964972ac56391447ea696d6ad1c222bd3f1 Mon Sep 17 00:00:00 2001 From: Spxg Date: Sun, 18 May 2025 21:25:08 +0800 Subject: [PATCH] Add github button --- src/app/button_set.rs | 9 +++++++++ src/app/header.rs | 13 +++++++++++-- src/app/icon.rs | 14 ++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/app/button_set.rs b/src/app/button_set.rs index e7d3bb9..6fcf9f3 100644 --- a/src/app/button_set.rs +++ b/src/app/button_set.rs @@ -85,3 +85,12 @@ where } } + +#[component] +pub fn LinkButton(href: String, children: Children) -> impl IntoView { + view! { + + {children()} + + } +} diff --git a/src/app/header.rs b/src/app/header.rs index 37ec2b5..f968f7f 100644 --- a/src/app/header.rs +++ b/src/app/header.rs @@ -10,10 +10,10 @@ use crate::{ app::{ ImportProgress, advanced_options_menu::AdvancedOptionsMenu, - button_set::{Button, ButtonSet, IconButton, Rule}, + button_set::{Button, ButtonSet, IconButton, LinkButton, Rule}, config_menu::ConfigMenu, context_menu::ContextMenu, - icon::{build_icon, config_icon, expandable_icon, more_options_icon}, + icon::{build_icon, config_icon, expandable_icon, github_icon, more_options_icon}, output::change_focus, pop_button::PopButton, state::{Focus, GlobalState, GlobalStateStoreFields}, @@ -58,6 +58,10 @@ pub fn Header() -> impl IntoView { + + + +
@@ -368,3 +372,8 @@ fn ShareButton() -> impl IntoView { view! { } } + +#[component] +fn GithubButton() -> impl IntoView { + view! { {github_icon()} } +} diff --git a/src/app/icon.rs b/src/app/icon.rs index 4c2fb47..edd56ab 100644 --- a/src/app/icon.rs +++ b/src/app/icon.rs @@ -93,3 +93,17 @@ pub fn more_options_icon() -> AnyView { }.into_any() } + +pub fn github_icon() -> AnyView { + view! { + + + + }.into_any() +}