From dec0fc8d6d5c866d94edfd9eeb8a7e0fb598d0f9 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Thu, 22 Dec 2022 14:43:30 -0500 Subject: [PATCH] Move github link to the footer. --- web/src/components/footer.rs | 26 ++++++++++++++++++++++++++ web/src/components/mod.rs | 2 ++ web/src/web.rs | 3 ++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 web/src/components/footer.rs diff --git a/web/src/components/footer.rs b/web/src/components/footer.rs new file mode 100644 index 0000000..7d522ac --- /dev/null +++ b/web/src/components/footer.rs @@ -0,0 +1,26 @@ +// Copyright 2022 Jeremy Wall +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use sycamore::prelude::*; + +#[component] +pub fn Footer(cx: Scope) -> View { + view! {cx, + nav(class="no-print") { + ul { + li { a(href="https://github.com/zaphar/kitchen") { "On Github" } } + } + } + } +} diff --git a/web/src/components/mod.rs b/web/src/components/mod.rs index f5c58d6..c800294 100644 --- a/web/src/components/mod.rs +++ b/web/src/components/mod.rs @@ -13,6 +13,7 @@ // limitations under the License. pub mod add_recipe; pub mod categories; +pub mod footer; pub mod header; pub mod recipe; pub mod recipe_list; @@ -23,6 +24,7 @@ pub mod tabs; pub use add_recipe::*; pub use categories::*; +pub use footer::*; pub use header::*; pub use recipe::*; pub use recipe_list::*; diff --git a/web/src/web.rs b/web/src/web.rs index c31dbc7..6f3625b 100644 --- a/web/src/web.rs +++ b/web/src/web.rs @@ -14,7 +14,7 @@ use sycamore::{futures::spawn_local_scoped, prelude::*}; use tracing::{error, info, instrument}; -use crate::components::Header; +use crate::components::{Footer, Header}; use crate::{api, routing::Handler as RouteHandler}; #[instrument] @@ -39,6 +39,7 @@ pub fn UI(cx: Scope) -> View { div(class="app") { Header { } RouteHandler() + Footer { } } }); }