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> { pub fn header() -> View<G> {
view! { view! {
div(class="menu") { 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> { pub fn tabbed_view(state: TabState<G>) -> View<G> {
cloned!((state) => view! { cloned!((state) => view! {
div(class="nav-header no-print") { 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); state.route.set(AppRoutes::Plan);
})) { "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); state.route.set(AppRoutes::Inventory);
})) { "Inventory" } })) { "Inventory" }
" | " " | "
a(on:click=cloned!((state) => move |_| { a(href="#", class="no-print", on:click=cloned!((state) => move |_| {
state.route.set(AppRoutes::Cook); state.route.set(AppRoutes::Cook);
})) { "Cook" } })) { "Cook" }
} }

View File

@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use crate::app_state::AppRoutes;
use crate::components::{shopping_list::*, tabs::*}; use crate::components::{shopping_list::*, tabs::*};
use crate::pages::PageState; use crate::pages::PageState;
@ -23,11 +24,17 @@ pub struct InventoryPageProps {
#[component(InventoryPage<G>)] #[component(InventoryPage<G>)]
pub fn inventory_page(props: InventoryPageProps) -> View<G> { pub fn inventory_page(props: InventoryPageProps) -> View<G> {
let route_signal = props.page_state.route.clone();
view! { view! {
TabbedView(TabState { TabbedView(TabState {
route: props.page_state.route.clone(), route: props.page_state.route.clone(),
inner: view! { inner: view! {
ShoppingList() 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. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use crate::app_state::AppRoutes;
use crate::components::{recipe_selector::*, tabs::*}; use crate::components::{recipe_selector::*, tabs::*};
use crate::pages::PageState; use crate::pages::PageState;
@ -23,11 +24,17 @@ pub struct PlanPageProps {
#[component(PlanPage<G>)] #[component(PlanPage<G>)]
pub fn plan_page(props: PlanPageProps) -> View<G> { pub fn plan_page(props: PlanPageProps) -> View<G> {
let route_signal = props.page_state.route.clone();
view! { view! {
TabbedView(TabState { TabbedView(TabState {
route: props.page_state.route.clone(), route: props.page_state.route.clone(),
inner: view! { inner: view! {
RecipeSelector() RecipeSelector()
div {
a(href="#", on:click=move |_| {
route_signal.set(AppRoutes::Inventory);
}) { "Next" }
}
}, },
}) })
} }