Minor UI improvements.

This commit is contained in:
Jeremy Wall 2022-03-15 18:22:48 -04:00
parent d00bb0f68b
commit b63c3b615d
4 changed files with 18 additions and 4 deletions

View File

@ -18,7 +18,7 @@ use sycamore::prelude::*;
pub fn header() -> View<G> {
view! {
div(class="menu") {
span { a(href="/ui/") { "Meal Plan" }}
h1 { "Meal Plan" }
}
}
}

View File

@ -25,15 +25,15 @@ pub struct TabState<G: GenericNode> {
pub fn tabbed_view(state: TabState<G>) -> View<G> {
cloned!((state) => view! {
div(class="nav-header no-print") {
a(class="no-print", on:click=cloned!((state) => move |_| {
a(href="#", class="no-print", on:click=cloned!((state) => move |_| {
state.route.set(AppRoutes::Plan);
})) { "Plan" }
" | "
a(class="no-print", on:click=cloned!((state) => move |_| {
a(href="#", class="no-print", on:click=cloned!((state) => move |_| {
state.route.set(AppRoutes::Inventory);
})) { "Inventory" }
" | "
a(on:click=cloned!((state) => move |_| {
a(href="#", class="no-print", on:click=cloned!((state) => move |_| {
state.route.set(AppRoutes::Cook);
})) { "Cook" }
}

View File

@ -11,6 +11,7 @@
// 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 crate::app_state::AppRoutes;
use crate::components::{shopping_list::*, tabs::*};
use crate::pages::PageState;
@ -23,11 +24,17 @@ pub struct InventoryPageProps {
#[component(InventoryPage<G>)]
pub fn inventory_page(props: InventoryPageProps) -> View<G> {
let route_signal = props.page_state.route.clone();
view! {
TabbedView(TabState {
route: props.page_state.route.clone(),
inner: view! {
ShoppingList()
div {
a(href="#", on:click=move |_| {
route_signal.set(AppRoutes::Cook);
}) { "Next" }
}
},
})
}

View File

@ -11,6 +11,7 @@
// 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 crate::app_state::AppRoutes;
use crate::components::{recipe_selector::*, tabs::*};
use crate::pages::PageState;
@ -23,11 +24,17 @@ pub struct PlanPageProps {
#[component(PlanPage<G>)]
pub fn plan_page(props: PlanPageProps) -> View<G> {
let route_signal = props.page_state.route.clone();
view! {
TabbedView(TabState {
route: props.page_state.route.clone(),
inner: view! {
RecipeSelector()
div {
a(href="#", on:click=move |_| {
route_signal.set(AppRoutes::Inventory);
}) { "Next" }
}
},
})
}