Add a parameter to the Wallpaper widget to show the app version

This commit is contained in:
2024-04-22 14:44:51 +02:00
parent 7170332205
commit 6172167ea8
3 changed files with 9 additions and 4 deletions

View File

@@ -5,7 +5,10 @@ const GIT_VERSION: &str = git_version!();
turf::style_sheet!("src/ui/components/wallpaper.scss");
pub fn Wallpaper() -> Element {
#[component]
pub fn Wallpaper(display_version: Option<bool>) -> Element {
let version = display_version.map(|flag| if flag { Some(GIT_VERSION) } else { None });
rsx! {
style { {STYLE_SHEET} },
div {
@@ -17,7 +20,7 @@ pub fn Wallpaper() -> Element {
div {
class: ClassName::WALLPAPER_VERSION,
{GIT_VERSION},
{version},
}
}
}