Added dark theme to admin portal. Fixes #7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ use leptos::prelude::*;
|
||||
use crate::backend::data::{ApiResponse, ReservationState, ResSumWithItems};
|
||||
use crate::backend::reservation::{month_chart, reservations_in_month, year_chart, years};
|
||||
use crate::components::modal_box::{DialogOpener, ModalBody, ModalDialog};
|
||||
use crate::components::theme::Theme;
|
||||
use crate::components::user_menu::MenuOpener;
|
||||
use crate::locales::{loc_date, show_day, trl};
|
||||
use crate::pages::new_reservations::CancelDialog;
|
||||
@@ -71,11 +72,12 @@ fn booking_detail(reservation: ReadSignal<ResSumWithItems>, opener: DialogOpener
|
||||
|
||||
#[component]
|
||||
pub fn bookings() -> impl IntoView {
|
||||
let year_chart = Resource::new_blocking(||(), |_| year_chart());
|
||||
let theme = use_context::<Theme>().expect("No theme");
|
||||
let year_chart = Resource::new_blocking(move || theme.is_dark(), |dark| year_chart(dark));
|
||||
let years = Resource::new_blocking(||(), |_| years());
|
||||
let year = RwSignal::new(Local::now().year());
|
||||
let month = RwSignal::new(Local::now().month());
|
||||
let chart = Resource::new_blocking(move || year.get(),move |y| month_chart(y));
|
||||
let chart = Resource::new_blocking(move || (year.get(), theme.is_dark()), move |(y, dark)| month_chart(y, dark));
|
||||
let detail_dlg = DialogOpener::new();
|
||||
let reservations = Resource::new_blocking(move || (year.get(), month.get(), detail_dlg.visible()), move |p| reservations_in_month(p.0, p.1));
|
||||
let all_months: Vec<u32> = vec![1,2,3,4,5,6,7,8,9,10,11,12];
|
||||
@@ -84,7 +86,7 @@ pub fn bookings() -> impl IntoView {
|
||||
view! {
|
||||
<h1>{trl("Booking overview")}</h1>
|
||||
<BookingDetail reservation=res_detail.read_only() opener=detail_dlg />
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light mb-5">
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light filter-bar mb-5">
|
||||
<div class="container-fluid">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
|
||||
Reference in New Issue
Block a user