feat: wider screen UI responsivity #137
@@ -48,7 +48,7 @@ pub(crate) fn App() -> Element {
|
|||||||
document::Link { rel: "manifest", href: MANIFEST, crossorigin: "use-credentials" }
|
document::Link { rel: "manifest", href: MANIFEST, crossorigin: "use-credentials" }
|
||||||
|
|
||||||
div {
|
div {
|
||||||
class: "min-h-screen py-4 flex flex-col text-gray-300 bg-gray-900",
|
class: "min-h-screen flex flex-col text-gray-300 bg-gray-900",
|
||||||
Router::<Route> {}
|
Router::<Route> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use crate::components::navigation::Navigation;
|
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
|
use crate::components::navigation;
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub(crate) fn BottomPanel() -> Element {
|
pub(crate) fn BottomPanel() -> Element {
|
||||||
let navigation_expanded = use_signal(|| false);
|
let navigation_expanded = use_signal(|| false);
|
||||||
@@ -10,12 +11,12 @@ pub(crate) fn BottomPanel() -> Element {
|
|||||||
class: format!(
|
class: format!(
|
||||||
"flex flex-col pointer-events-auto bg-gray-800 transition-[height] duration-[500ms] ease-[cubic-bezier(0.79,0.14,0.15,0.86)] overflow-y-scroll {}",
|
"flex flex-col pointer-events-auto bg-gray-800 transition-[height] duration-[500ms] ease-[cubic-bezier(0.79,0.14,0.15,0.86)] overflow-y-scroll {}",
|
||||||
if navigation_expanded() {
|
if navigation_expanded() {
|
||||||
"h-[130px]"
|
"h-[132px]"
|
||||||
} else {
|
} else {
|
||||||
"h-[66px]"
|
"h-[66px]"
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
Navigation {
|
navigation::Bottom {
|
||||||
is_expanded: navigation_expanded,
|
is_expanded: navigation_expanded,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ pub(crate) fn CategoryCalendarTaskList() -> Element {
|
|||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
div {
|
div {
|
||||||
class: "pt-4 flex flex-col gap-8",
|
class: "pt-3 flex flex-col gap-8",
|
||||||
for date_current in today_date.iter_days().take(CALENDAR_LENGTH_DAYS) {
|
for date_current in today_date.iter_days().take(CALENDAR_LENGTH_DAYS) {
|
||||||
div {
|
div {
|
||||||
class: "flex flex-col gap-4",
|
class: "flex flex-col gap-4",
|
||||||
div {
|
div {
|
||||||
class: "px-7 flex flex-row items-center gap-2 text-gray-500 font-bold",
|
class: "px-7 sm:px-8 flex flex-row items-center gap-2 text-gray-500 font-bold",
|
||||||
div {
|
div {
|
||||||
class: "pt-1",
|
class: "pt-1",
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ pub(crate) fn CategoryTodayTaskList() -> Element {
|
|||||||
div {
|
div {
|
||||||
class: "flex flex-col gap-4",
|
class: "flex flex-col gap-4",
|
||||||
div {
|
div {
|
||||||
class: "px-7 flex flex-row items-center gap-2 text-gray-500 font-bold",
|
class: "px-7 sm:px-8 flex flex-row items-center gap-2 text-gray-500 font-bold",
|
||||||
Icon {
|
Icon {
|
||||||
class: "mx-1.5",
|
class: "mx-1.5",
|
||||||
icon: FaWater
|
icon: FaWater
|
||||||
@@ -70,7 +70,7 @@ pub(crate) fn CategoryTodayTaskList() -> Element {
|
|||||||
div {
|
div {
|
||||||
class: "flex flex-col gap-4",
|
class: "flex flex-col gap-4",
|
||||||
div {
|
div {
|
||||||
class: "px-7 flex flex-row items-center gap-2 text-gray-500 font-bold",
|
class: "px-7 sm:px-8 flex flex-row items-center gap-2 text-gray-500 font-bold",
|
||||||
Icon {
|
Icon {
|
||||||
class: "mx-1.25",
|
class: "mx-1.25",
|
||||||
height: 22,
|
height: 22,
|
||||||
@@ -90,7 +90,7 @@ pub(crate) fn CategoryTodayTaskList() -> Element {
|
|||||||
div {
|
div {
|
||||||
class: "flex flex-col gap-4",
|
class: "flex flex-col gap-4",
|
||||||
div {
|
div {
|
||||||
class: "px-7 flex flex-row items-center gap-2 text-gray-500 font-bold",
|
class: "px-7 sm:px-8 flex flex-row items-center gap-2 text-gray-500 font-bold",
|
||||||
Icon {
|
Icon {
|
||||||
class: "mx-1.25",
|
class: "mx-1.25",
|
||||||
height: 22,
|
height: 22,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ pub(crate) fn CreateButton() -> Element {
|
|||||||
let current_route = use_route();
|
let current_route = use_route();
|
||||||
rsx! {
|
rsx! {
|
||||||
ButtonPrimary {
|
ButtonPrimary {
|
||||||
class: "pointer-events-auto m-4 self-end *:rounded-full! *:p-4",
|
class: "pointer-events-auto sm:self-auto *:rounded-full! *:p-4",
|
||||||
onclick: move |_| {
|
onclick: move |_| {
|
||||||
*TASK_BEING_EDITED.write() = None;
|
*TASK_BEING_EDITED.write() = None;
|
||||||
*PROJECT_BEING_EDITED.write() = None;
|
*PROJECT_BEING_EDITED.write() = None;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ pub(crate) mod error_boundary_message;
|
|||||||
pub(crate) mod input;
|
pub(crate) mod input;
|
||||||
pub(crate) mod input_label;
|
pub(crate) mod input_label;
|
||||||
pub(crate) mod navigation;
|
pub(crate) mod navigation;
|
||||||
pub(crate) mod navigation_item;
|
|
||||||
pub(crate) mod project_form;
|
pub(crate) mod project_form;
|
||||||
pub(crate) mod project_list;
|
pub(crate) mod project_list;
|
||||||
pub(crate) mod project_select;
|
pub(crate) mod project_select;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::components::navigation_item::NavigationItem;
|
|
||||||
use crate::route::Route;
|
use crate::route::Route;
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use dioxus_free_icons::Icon;
|
use dioxus_free_icons::Icon;
|
||||||
@@ -9,13 +8,13 @@ use dioxus_free_icons::icons::fa_solid_icons::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub(crate) fn Navigation(is_expanded: Signal<bool>) -> Element {
|
pub(crate) fn Bottom(is_expanded: Signal<bool>) -> Element {
|
||||||
rsx! {
|
rsx! {
|
||||||
div {
|
div {
|
||||||
class: "grid grid-cols-5 justify-stretch",
|
class: "grid grid-cols-5 justify-stretch",
|
||||||
button {
|
button {
|
||||||
class: format!(
|
class: format!(
|
||||||
"py-2 flex flex-row justify-center items-center cursor-pointer",
|
"py-2 flex flex-row justify-center items-center sm:hidden cursor-pointer",
|
||||||
),
|
),
|
||||||
onclick: move |_| is_expanded.set(!is_expanded()),
|
onclick: move |_| is_expanded.set(!is_expanded()),
|
||||||
div {
|
div {
|
||||||
@@ -30,41 +29,41 @@ pub(crate) fn Navigation(is_expanded: Signal<bool>) -> Element {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
NavigationItem {
|
super::Item {
|
||||||
route: Route::CategoryNextStepsPage,
|
route: Route::CategoryNextStepsPage,
|
||||||
icon: FaSignsPost
|
icon: FaSignsPost
|
||||||
},
|
},
|
||||||
NavigationItem {
|
super::Item {
|
||||||
route: Route::CategoryCalendarPage,
|
route: Route::CategoryCalendarPage,
|
||||||
icon: FaCalendarDays
|
icon: FaCalendarDays
|
||||||
},
|
},
|
||||||
NavigationItem {
|
super::Item {
|
||||||
route: Route::CategoryTodayPage,
|
route: Route::CategoryTodayPage,
|
||||||
icon: FaCalendarDay
|
icon: FaCalendarDay
|
||||||
},
|
},
|
||||||
NavigationItem {
|
super::Item {
|
||||||
route: Route::CategoryInboxPage,
|
route: Route::CategoryInboxPage,
|
||||||
icon: FaInbox
|
icon: FaInbox
|
||||||
},
|
},
|
||||||
{if is_expanded() {
|
{if is_expanded() {
|
||||||
rsx! {
|
rsx! {
|
||||||
NavigationItem {
|
super::Item {
|
||||||
route: Route::ProjectsPage,
|
route: Route::ProjectsPage,
|
||||||
icon: FaList
|
icon: FaList
|
||||||
},
|
},
|
||||||
NavigationItem {
|
super::Item {
|
||||||
route: Route::CategoryTrashPage,
|
route: Route::CategoryTrashPage,
|
||||||
icon: FaTrashCan
|
icon: FaTrashCan
|
||||||
},
|
},
|
||||||
NavigationItem {
|
super::Item {
|
||||||
route: Route::CategoryDonePage,
|
route: Route::CategoryDonePage,
|
||||||
icon: FaVolcano
|
icon: FaVolcano
|
||||||
},
|
},
|
||||||
NavigationItem {
|
super::Item {
|
||||||
route: Route::CategorySomedayMaybePage,
|
route: Route::CategorySomedayMaybePage,
|
||||||
icon: FaLightbulb
|
icon: FaLightbulb
|
||||||
},
|
},
|
||||||
NavigationItem {
|
super::Item {
|
||||||
route: Route::CategoryWaitingForPage,
|
route: Route::CategoryWaitingForPage,
|
||||||
icon: FaHourglassHalf
|
icon: FaHourglassHalf
|
||||||
}
|
}
|
||||||
@@ -3,17 +3,14 @@ use dioxus::prelude::*;
|
|||||||
use dioxus_free_icons::{Icon, IconShape};
|
use dioxus_free_icons::{Icon, IconShape};
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub(crate) fn NavigationItem<I: IconShape + Clone + PartialEq + 'static>(
|
pub(crate) fn Item<I: IconShape + Clone + PartialEq + 'static>(route: Route, icon: I) -> Element {
|
||||||
route: Route,
|
|
||||||
icon: I,
|
|
||||||
) -> Element {
|
|
||||||
let current_route = use_route::<Route>();
|
let current_route = use_route::<Route>();
|
||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
Link {
|
Link {
|
||||||
to: route.clone(),
|
to: route.clone(),
|
||||||
class: format!(
|
class: format!(
|
||||||
"py-2.5 flex flex-row justify-center items-center hover:*:bg-gray-900 active:*:text-gray-400",
|
"py-2.5 sm:px-6 flex flex-row justify-center items-center hover:*:bg-gray-900 active:*:text-gray-400",
|
||||||
),
|
),
|
||||||
div {
|
div {
|
||||||
class: format!("pt-2.5 px-4 {} transition-all duration-150",
|
class: format!("pt-2.5 px-4 {} transition-all duration-150",
|
||||||
7
src/components/navigation/mod.rs
Normal file
7
src/components/navigation/mod.rs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
mod bottom;
|
||||||
|
mod item;
|
||||||
|
mod side;
|
||||||
|
|
||||||
|
pub(crate) use bottom::Bottom;
|
||||||
|
use item::Item;
|
||||||
|
pub(crate) use side::Side;
|
||||||
52
src/components/navigation/side.rs
Normal file
52
src/components/navigation/side.rs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
use crate::route::Route;
|
||||||
|
use dioxus::prelude::*;
|
||||||
|
use dioxus_free_icons::icons::fa_regular_icons::FaLightbulb;
|
||||||
|
use dioxus_free_icons::icons::fa_solid_icons::{
|
||||||
|
FaCalendarDay, FaCalendarDays, FaHourglassHalf, FaInbox, FaList, FaSignsPost, FaTrashCan,
|
||||||
|
FaVolcano,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[component]
|
||||||
|
pub(crate) fn Side(class: Option<String>) -> Element {
|
||||||
|
rsx! {
|
||||||
|
div {
|
||||||
|
class: format!("flex flex-col {}", class.unwrap_or(String::new())),
|
||||||
|
super::Item {
|
||||||
|
route: Route::CategoryInboxPage,
|
||||||
|
icon: FaInbox
|
||||||
|
},
|
||||||
|
super::Item {
|
||||||
|
route: Route::CategoryTodayPage,
|
||||||
|
icon: FaCalendarDay
|
||||||
|
},
|
||||||
|
super::Item {
|
||||||
|
route: Route::CategoryCalendarPage,
|
||||||
|
icon: FaCalendarDays
|
||||||
|
},
|
||||||
|
super::Item {
|
||||||
|
route: Route::CategoryNextStepsPage,
|
||||||
|
icon: FaSignsPost
|
||||||
|
},
|
||||||
|
super::Item {
|
||||||
|
route: Route::CategoryWaitingForPage,
|
||||||
|
icon: FaHourglassHalf
|
||||||
|
},
|
||||||
|
super::Item {
|
||||||
|
route: Route::CategorySomedayMaybePage,
|
||||||
|
icon: FaLightbulb
|
||||||
|
},
|
||||||
|
super::Item {
|
||||||
|
route: Route::CategoryDonePage,
|
||||||
|
icon: FaVolcano
|
||||||
|
},
|
||||||
|
super::Item {
|
||||||
|
route: Route::CategoryTrashPage,
|
||||||
|
icon: FaTrashCan
|
||||||
|
},
|
||||||
|
super::Item {
|
||||||
|
route: Route::ProjectsPage,
|
||||||
|
icon: FaList
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ pub(crate) fn ProjectList() -> Element {
|
|||||||
class: "flex flex-col",
|
class: "flex flex-col",
|
||||||
for project in projects {
|
for project in projects {
|
||||||
div {
|
div {
|
||||||
class: "px-7 py-4 hover:bg-gray-800 font-medium text-pretty wrap-anywhere select-none transition-all duration-150 cursor-pointer",
|
class: "px-7 sm:px-8 py-4 hover:bg-gray-800 font-medium text-pretty wrap-anywhere select-none transition-all duration-150 cursor-pointer",
|
||||||
key: "{project.id}",
|
key: "{project.id}",
|
||||||
onclick: move |_| {
|
onclick: move |_| {
|
||||||
*PROJECT_BEING_EDITED.write() = Some(project.clone());
|
*PROJECT_BEING_EDITED.write() = Some(project.clone());
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use dioxus::prelude::*;
|
|||||||
pub(crate) fn StickyBottom(children: Element) -> Element {
|
pub(crate) fn StickyBottom(children: Element) -> Element {
|
||||||
rsx! {
|
rsx! {
|
||||||
div {
|
div {
|
||||||
class: "fixed bottom-0 left-0 right-0 flex flex-col pointer-events-none",
|
class: "fixed bottom-0 left-0 right-0 flex flex-col pointer-events-none sm:hidden",
|
||||||
{children}
|
{children}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ pub(crate) fn TaskList(
|
|||||||
div {
|
div {
|
||||||
key: "{task.task.id}",
|
key: "{task.task.id}",
|
||||||
class: format!(
|
class: format!(
|
||||||
"px-7 pt-3.75 {} flex flex-row items-start gap-4 hover:bg-gray-800 cursor-pointer select-none transition-all duration-150",
|
"px-7 sm:px-8 pt-3.75 {} flex flex-row items-start gap-4 hover:bg-gray-800 cursor-pointer select-none transition-all duration-150",
|
||||||
if task.task.deadline.is_some() || !task.subtasks.is_empty() {
|
if task.task.deadline.is_some() || !task.subtasks.is_empty() {
|
||||||
"pb-0.25"
|
"pb-0.25"
|
||||||
} else if let Category::Calendar { time, .. } = &task.task.category {
|
} else if let Category::Calendar { time, .. } = &task.task.category {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
use crate::components;
|
||||||
use crate::components::bottom_panel::BottomPanel;
|
use crate::components::bottom_panel::BottomPanel;
|
||||||
use crate::components::create_button::CreateButton;
|
use crate::components::create_button::CreateButton;
|
||||||
use crate::components::sticky_bottom::StickyBottom;
|
use crate::components::sticky_bottom::StickyBottom;
|
||||||
@@ -27,11 +28,24 @@ pub(crate) fn Navigation() -> Element {
|
|||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
div {
|
div {
|
||||||
class: "grow flex flex-col pb-36",
|
class: "grow flex flex-col sm:flex-row pb-36 sm:pb-0",
|
||||||
Outlet::<Route> {}
|
div {
|
||||||
|
class: "hidden sm:flex sm:flex-col gap-4 py-3.25 items-center bg-gray-800",
|
||||||
|
components::navigation::Side {},
|
||||||
|
div {
|
||||||
|
CreateButton {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
class: "grow flex flex-col py-4",
|
||||||
|
Outlet::<Route> {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
StickyBottom {
|
StickyBottom {
|
||||||
CreateButton {},
|
div {
|
||||||
|
class: "m-4 self-end",
|
||||||
|
CreateButton {},
|
||||||
|
}
|
||||||
BottomPanel {}
|
BottomPanel {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use dioxus::prelude::*;
|
|||||||
pub(crate) fn ProjectFormPage() -> Element {
|
pub(crate) fn ProjectFormPage() -> Element {
|
||||||
rsx! {
|
rsx! {
|
||||||
ErrorBoundaryMessage {
|
ErrorBoundaryMessage {
|
||||||
class: "grow py-4 flex flex-col gap-12",
|
class: "grow py-8 max-w-xl w-full mx-auto flex flex-col gap-12",
|
||||||
ProjectForm {}
|
ProjectForm {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use dioxus::prelude::*;
|
|||||||
pub(crate) fn TaskFormPage() -> Element {
|
pub(crate) fn TaskFormPage() -> Element {
|
||||||
rsx! {
|
rsx! {
|
||||||
ErrorBoundaryMessage {
|
ErrorBoundaryMessage {
|
||||||
class: "grow py-4 flex flex-col gap-12",
|
class: "grow py-8 max-w-xl w-full mx-auto flex flex-col gap-12",
|
||||||
TaskForm {}
|
TaskForm {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user