diff --git a/assets/favicon.ico b/assets/favicon.ico
index 070d1da..adc9155 100644
Binary files a/assets/favicon.ico and b/assets/favicon.ico differ
diff --git a/assets/images/icon.png b/assets/images/icon.png
index 1c33866..ba339b6 100644
Binary files a/assets/images/icon.png and b/assets/images/icon.png differ
diff --git a/assets/images/icon.svg b/assets/images/icon.svg
deleted file mode 100644
index 30bb299..0000000
--- a/assets/images/icon.svg
+++ /dev/null
@@ -1,203 +0,0 @@
-
-
-
-
diff --git a/assets/manifest.json b/assets/manifest.json
index ee671f6..a0062c6 100644
--- a/assets/manifest.json
+++ b/assets/manifest.json
@@ -3,8 +3,8 @@
"short_name": "Todo Baggins",
"start_url": "/",
"display": "standalone",
- "background_color": "#27272a",
- "theme_color": "#27272a",
+ "background_color": "#101828",
+ "theme_color": "#b89a2e",
"icons": [
{
"src": "/assets/images/icon.png",
diff --git a/assets/styles/input_range.css b/assets/styles/input_range.css
index 555e054..b48083c 100644
--- a/assets/styles/input_range.css
+++ b/assets/styles/input_range.css
@@ -8,56 +8,37 @@ input[type="range"] {
background: transparent;
}
-input[type="range"]::-moz-range-thumb {
+input[type="range"]::-moz-range-thumb,
+input[type="range"]::-webkit-slider-thumb {
width: 1.25rem;
height: 1.25rem;
- background: rgba(228 228 231);
+ background: var(--color-gray-400);
+ filter: drop-shadow(0 var(--spacing) 0 var(--color-gray-500));
border: 0;
border-radius: 0.5rem;
+ cursor: pointer;
}
-input[type="range"]::-moz-range-progress {
- background: #525259;
+input[type="range"]::-webkit-slider-thumb {
+ position: relative;
+ top: -9px;
+}
+
+input[type="range"]::-moz-range-track,
+input[type="range"]::-webkit-slider-runnable-track {
+ background: var(--color-gray-800-muted);
height: 0.5rem;
+ filter: drop-shadow(
+ 0 calc(0px - var(--spacing)) 0 var(--color-gray-900-muted)
+ );
border-radius: 0.25rem;
}
input[type="range"]::-moz-range-track {
- background: rgba(39 39 42 / 50%);
- height: 0.5rem;
- border-radius: 0.25rem;
-}
-
-input[type="range"].input-range-reverse::-moz-range-progress {
- background: #2d2d31;
- height: 0.5rem;
- border-radius: 0.25rem;
-}
-
-input[type="range"].input-range-reverse::-moz-range-track {
- background: rgba(113 113 122 / 50%);
- height: 0.5rem;
- border-radius: 0.25rem;
-}
-
-input[type="range"]::-webkit-slider-thumb {
- width: 1.25rem;
- height: 1.25rem;
- background: rgba(228 228 231);
- border: 0;
- border-radius: 0.5rem;
- position: relative;
- top: -0.4rem;
+ transform: translateY(3px);
}
input[type="range"]::-webkit-slider-runnable-track {
- background: rgba(39 39 42 / 50%);
- height: 0.5rem;
- border-radius: 0.25rem;
-}
-
-input[type="range"].input-range-reverse::-webkit-slider-runnable-track {
- background: rgba(39 39 42 / 50%);
- height: 0.5rem;
- border-radius: 0.25rem;
+ position: relative;
+ top: 3px;
}
diff --git a/assets/styles/select_arrow.css b/assets/styles/select_arrow.css
new file mode 100644
index 0000000..585e826
--- /dev/null
+++ b/assets/styles/select_arrow.css
@@ -0,0 +1,7 @@
+select {
+ appearance: none;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath fill='%239ca3af' d='M300.3 440.8C312.9 451 331.4 450.3 343.1 438.6L471.1 310.6C480.3 301.4 483 287.7 478 275.7C473 263.7 461.4 256 448.5 256L192.5 256C179.6 256 167.9 263.8 162.9 275.8C157.9 287.8 160.7 301.5 169.9 310.6L297.9 438.6L300.3 440.8z'/%3E%3C/svg%3E");
+ background-repeat: no-repeat;
+ background-size: 2rem;
+ background-position: right 0.5rem center;
+}
diff --git a/src/components/app.rs b/src/components/app.rs
index 553ee51..6e4204c 100644
--- a/src/components/app.rs
+++ b/src/components/app.rs
@@ -1,4 +1,5 @@
use crate::internationalization::get_language_identifier;
+
use crate::route::Route;
use dioxus::core_macro::rsx;
use dioxus::dioxus_core::Element;
@@ -15,6 +16,7 @@ static FONTS_DIRECTORY: Asset = asset!(
const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css");
const INPUT_NUMBER_ARROWS_CSS: Asset = asset!("/assets/styles/input_number_arrows.css");
const INPUT_RANGE_CSS: Asset = asset!("/assets/styles/input_range.css");
+const SELECT_ARROW_CSS: Asset = asset!("/assets/styles/select_arrow.css");
const MANIFEST: Asset = asset!("/assets/manifest.json");
#[component]
@@ -36,10 +38,11 @@ pub(crate) fn App() -> Element {
document::Stylesheet { href: TAILWIND_CSS }
document::Stylesheet { href: INPUT_NUMBER_ARROWS_CSS }
document::Stylesheet { href: INPUT_RANGE_CSS }
+ document::Stylesheet { href: SELECT_ARROW_CSS }
document::Link { rel: "manifest", href: MANIFEST, crossorigin: "use-credentials" }
div {
- class: "min-h-screen pt-4 pb-36 flex flex-col text-zinc-200 bg-zinc-800",
+ class: "min-h-screen py-4 flex flex-col text-gray-300 bg-gray-900",
Router:: {}
}
}
diff --git a/src/components/bottom_panel.rs b/src/components/bottom_panel.rs
index 7738415..f230871 100644
--- a/src/components/bottom_panel.rs
+++ b/src/components/bottom_panel.rs
@@ -1,78 +1,22 @@
-use crate::components::error_boundary_message::ErrorBoundaryMessage;
use crate::components::navigation::Navigation;
-use crate::components::project_form::ProjectForm;
-use crate::components::task_form::TaskForm;
-use crate::models::project::Project;
-use crate::models::task::Task;
-use crate::route::Route;
use dioxus::prelude::*;
#[component]
-pub(crate) fn BottomPanel(display_form: Signal) -> Element {
- // A signal for delaying the application of styles.
- #[allow(clippy::redundant_closure)]
- let mut expanded = use_signal(|| display_form());
+pub(crate) fn BottomPanel() -> Element {
let navigation_expanded = use_signal(|| false);
- let current_route = use_route();
-
- let mut project_being_edited = use_context::>>();
- let mut task_being_edited = use_context::>>();
-
- use_effect(use_reactive(&display_form, move |display_form| {
- if display_form() {
- expanded.set(true);
- } else {
- spawn(async move {
- // Necessary for a smooth – not instant – height transition.
- #[cfg(not(feature = "server"))]
- async_std::task::sleep(std::time::Duration::from_millis(500)).await;
- /* The check is necessary for the situation when the user expands the panel while
- it is being closed. */
- if !display_form() {
- expanded.set(false);
- }
- });
- }
- }));
rsx! {
div {
class: format!(
- "flex flex-col pointer-events-auto bg-zinc-700/50 rounded-t-xl border-t-zinc-600 border-t backdrop-blur drop-shadow-[0_-5px_10px_rgba(0,0,0,0.2)] transition-[height] duration-[500ms] ease-[cubic-bezier(0.79,0.14,0.15,0.86)] overflow-y-scroll {}",
- match (display_form(), current_route, navigation_expanded()) {
- (false, _, false) => "h-[64px]",
- (false, _, true) => "h-[130px]",
- (true, Route::ProjectsPage, _) => "h-[130px]",
- (true, _, _) => "h-[506px]",
+ "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() {
+ "h-[130px]"
+ } else {
+ "h-[66px]"
}
),
- if expanded() {
- ErrorBoundaryMessage {
- match current_route {
- Route::ProjectsPage => rsx! {
- ProjectForm {
- project: project_being_edited(),
- on_successful_submit: move |_| {
- display_form.set(false);
- project_being_edited.set(None);
- }
- }
- },
- _ => rsx! {
- TaskForm {
- task: task_being_edited(),
- on_successful_submit: move |_| {
- display_form.set(false);
- task_being_edited.set(None);
- }
- }
- }
- }
- }
- } else {
- Navigation {
- expanded: navigation_expanded,
- }
+ Navigation {
+ is_expanded: navigation_expanded,
}
}
}
diff --git a/src/components/button_primary.rs b/src/components/button_primary.rs
new file mode 100644
index 0000000..7fe01c2
--- /dev/null
+++ b/src/components/button_primary.rs
@@ -0,0 +1,29 @@
+use dioxus::prelude::*;
+
+#[component]
+pub(crate) fn ButtonPrimary(
+ class: Option,
+ children: Element,
+ #[props(extends = GlobalAttributes, extends = button)] attributes: Vec,
+ // TODO: Remove this once https://github.com/DioxusLabs/dioxus/issues/4019 gets resolved.
+ onclick: Option>>,
+) -> Element {
+ rsx! {
+ button {
+ class: format!(
+ "cursor-pointer pb-[6px] hover:pb-[7px] active:pb-[2px] mt-[1px] hover:mt-0 active:mt-[5px] hover:*:drop-shadow-[0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted)] active:*:drop-shadow-[0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted)] transition-all duration-150 {}",
+ class.unwrap_or("".to_owned())
+ ),
+ onclick: move |event| {
+ if let Some(onclick) = onclick {
+ onclick.call(event);
+ }
+ },
+ ..attributes,
+ div {
+ class: "py-3.5 px-4 flex flex-row justify-center items-center bg-amber-300-muted drop-shadow-[0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted),0_1px_0_var(--color-amber-700-muted)] text-amber-700-muted rounded-xl transition-all duration-150",
+ {children}
+ }
+ }
+ }
+}
diff --git a/src/components/button_secondary.rs b/src/components/button_secondary.rs
new file mode 100644
index 0000000..4be48a0
--- /dev/null
+++ b/src/components/button_secondary.rs
@@ -0,0 +1,29 @@
+use dioxus::prelude::*;
+
+#[component]
+pub(crate) fn ButtonSecondary(
+ class: Option,
+ children: Element,
+ #[props(extends = GlobalAttributes, extends = button)] attributes: Vec,
+ // TODO: Remove this once https://github.com/DioxusLabs/dioxus/issues/4019 gets resolved.
+ onclick: Option>>,
+) -> Element {
+ rsx! {
+ button {
+ class: format!(
+ "cursor-pointer pb-[6px] hover:pb-[7px] active:pb-[2px] mt-[1px] hover:mt-0 active:mt-[5px] hover:*:drop-shadow-[0_7px_0_var(--color-gray-800)] active:*:drop-shadow-[0_2px_0_var(--color-gray-800)] transition-all duration-150 {}",
+ class.unwrap_or("".to_owned())
+ ),
+ onclick: move |event| {
+ if let Some(onclick) = onclick {
+ onclick.call(event);
+ }
+ },
+ ..attributes,
+ div {
+ class: "py-3.5 px-4 flex flex-row justify-center items-center bg-gray-600 drop-shadow-[0_6px_0_var(--color-gray-800)] rounded-xl transition-all duration-150",
+ {children}
+ }
+ }
+ }
+}
diff --git a/src/components/category_calendar_task_list.rs b/src/components/category_calendar_task_list.rs
index 5a61335..16df019 100644
--- a/src/components/category_calendar_task_list.rs
+++ b/src/components/category_calendar_task_list.rs
@@ -28,11 +28,12 @@ pub(crate) fn CategoryCalendarTaskList() -> Element {
div {
class: "flex flex-col gap-4",
div {
- class: "px-7 flex flex-row items-center gap-2 font-bold",
+ class: "px-7 flex flex-row items-center gap-2 text-gray-500 font-bold",
div {
class: "pt-1",
{
- date_current.format_localized(t!(
+ date_current.format_localized(
+ t!(
if date_current.year() == Local::now().year() {
"date-weekday-format"
} else {
diff --git a/src/components/category_input.rs b/src/components/category_input.rs
index b86f805..9420271 100644
--- a/src/components/category_input.rs
+++ b/src/components/category_input.rs
@@ -1,10 +1,11 @@
+use crate::components::select_button::SelectButton;
use crate::models::category::Category;
use dioxus::core_macro::rsx;
use dioxus::dioxus_core::Element;
use dioxus::prelude::*;
-use dioxus_free_icons::Icon;
+use dioxus_free_icons::icons::fa_regular_icons::FaLightbulb;
use dioxus_free_icons::icons::fa_solid_icons::{
- FaCalendarDays, FaForward, FaHourglassHalf, FaInbox, FaQuestion, FaWater,
+ FaCalendarDays, FaHourglassHalf, FaInbox, FaSignsPost, FaWater,
};
#[component]
@@ -14,105 +15,51 @@ pub(crate) fn CategoryInput(
) -> Element {
rsx! {
div {
- class: format!("flex flex-row gap-2 {}", class.unwrap_or("")),
- button {
- r#type: "button",
- class: format!(
- "py-3 flex flex-row justify-center items-center rounded-lg grow basis-0 {} cursor-pointer",
- if selected_category() == Category::SomedayMaybe { "bg-zinc-500/50" }
- else { "bg-zinc-800/50" }
- ),
- onclick: move |_| {
+ class: format!("grid grid-cols-3 gap-3 {}", class.unwrap_or("")),
+ SelectButton {
+ icon: FaLightbulb,
+ is_selected: matches!(selected_category(), Category::SomedayMaybe),
+ on_select: move |_| {
selected_category.set(Category::SomedayMaybe);
- },
- Icon {
- icon: FaQuestion,
- height: 16,
- width: 16
}
- },
- button {
- r#type: "button",
- class: format!(
- "py-3 flex flex-row justify-center items-center rounded-lg grow basis-0 {} cursor-pointer",
- if selected_category() == Category::LongTerm { "bg-zinc-500/50" }
- else { "bg-zinc-800/50" }
- ),
- onclick: move |_| {
+ }
+ SelectButton {
+ icon: FaWater,
+ is_selected: matches!(selected_category(), Category::LongTerm),
+ on_select: move |_| {
selected_category.set(Category::LongTerm);
- },
- Icon {
- icon: FaWater,
- height: 16,
- width: 16
}
- },
- button {
- r#type: "button",
- class: format!(
- "py-3 flex flex-row justify-center items-center rounded-lg grow basis-0 {} cursor-pointer",
- if let Category::WaitingFor(_) = selected_category() { "bg-zinc-500/50" }
- else { "bg-zinc-800/50" }
- ),
- onclick: move |_| {
+ }
+ SelectButton {
+ icon: FaHourglassHalf,
+ is_selected: matches!(selected_category(), Category::WaitingFor(_)),
+ on_select: move |_| {
selected_category.set(Category::WaitingFor(String::new()));
- },
- Icon {
- icon: FaHourglassHalf,
- height: 16,
- width: 16
}
- },
- button {
- r#type: "button",
- class: format!(
- "py-3 flex flex-row justify-center items-center rounded-lg grow basis-0 {} cursor-pointer",
- if selected_category() == Category::NextSteps { "bg-zinc-500/50" }
- else { "bg-zinc-800/50" }
- ),
- onclick: move |_| {
+ }
+ SelectButton {
+ icon: FaSignsPost,
+ is_selected: matches!(selected_category(), Category::NextSteps),
+ on_select: move |_| {
selected_category.set(Category::NextSteps);
- },
- Icon {
- icon: FaForward,
- height: 16,
- width: 16
}
- },
- button {
- r#type: "button",
- class: format!(
- "py-3 flex flex-row justify-center items-center rounded-lg grow basis-0 {} cursor-pointer",
- if let Category::Calendar { .. } = selected_category() { "bg-zinc-500/50" }
- else { "bg-zinc-800/50" }
- ),
- onclick: move |_| {
+ }
+ SelectButton {
+ icon: FaCalendarDays,
+ is_selected: matches!(selected_category(), Category::Calendar { .. }),
+ on_select: move |_| {
selected_category.set(Category::Calendar {
date: chrono::Local::now().date_naive(),
reoccurrence: None,
time: None,
});
- },
- Icon {
- icon: FaCalendarDays,
- height: 16,
- width: 16
}
- },
- button {
- r#type: "button",
- class: format!(
- "py-3 flex flex-row justify-center items-center rounded-lg grow basis-0 {} cursor-pointer",
- if selected_category() == Category::Inbox { "bg-zinc-500/50" }
- else { "bg-zinc-800/50" }
- ),
- onclick: move |_| {
+ }
+ SelectButton {
+ icon: FaInbox,
+ is_selected: matches!(selected_category(), Category::Inbox),
+ on_select: move |_| {
selected_category.set(Category::Inbox);
- },
- Icon {
- icon: FaInbox,
- height: 16,
- width: 16
}
}
}
diff --git a/src/components/category_today_task_list.rs b/src/components/category_today_task_list.rs
index 0cb6e0e..772847c 100644
--- a/src/components/category_today_task_list.rs
+++ b/src/components/category_today_task_list.rs
@@ -46,29 +46,31 @@ pub(crate) fn CategoryTodayTaskList() -> Element {
rsx! {
div {
class: "pt-4 flex flex-col gap-8",
- div {
- class: "flex flex-col gap-4",
+ if !long_term_tasks.is_empty() {
div {
- class: "px-7 flex flex-row items-center gap-2 font-bold",
- Icon {
- class: "mx-1",
- icon: FaWater
- }
+ class: "flex flex-col gap-4",
div {
- {t!("long-term")._upper_first()}
+ class: "px-7 flex flex-row items-center gap-2 text-gray-500 font-bold",
+ Icon {
+ class: "mx-1.5",
+ icon: FaWater
+ }
+ div {
+ {t!("long-term")._upper_first()}
+ }
+ }
+ TaskList {
+ tasks: long_term_tasks
}
- }
- TaskList {
- tasks: long_term_tasks
}
}
if !overdue_tasks.is_empty() {
div {
class: "flex flex-col gap-4",
div {
- class: "px-7 flex flex-row items-center gap-2 font-bold",
+ class: "px-7 flex flex-row items-center gap-2 text-gray-500 font-bold",
Icon {
- class: "mx-1",
+ class: "mx-1.25",
height: 22,
width: 22,
icon: FaCalendarXmark
@@ -86,9 +88,9 @@ pub(crate) fn CategoryTodayTaskList() -> Element {
div {
class: "flex flex-col gap-4",
div {
- class: "px-7 flex flex-row items-center gap-2 font-bold",
+ class: "px-7 flex flex-row items-center gap-2 text-gray-500 font-bold",
Icon {
- class: "mx-1",
+ class: "mx-1.25",
height: 22,
width: 22,
icon: FaCalendarCheck
diff --git a/src/components/create_button.rs b/src/components/create_button.rs
new file mode 100644
index 0000000..a67576d
--- /dev/null
+++ b/src/components/create_button.rs
@@ -0,0 +1,31 @@
+use crate::components::project_form::PROJECT_BEING_EDITED;
+use crate::components::{button_primary::ButtonPrimary, task_form::TASK_BEING_EDITED};
+use crate::route::Route;
+use dioxus::prelude::*;
+use dioxus_free_icons::{Icon, icons::fa_solid_icons::FaGavel};
+
+#[component]
+pub(crate) fn CreateButton() -> Element {
+ let navigator = use_navigator();
+ let current_route = use_route();
+ rsx! {
+ ButtonPrimary {
+ class: "pointer-events-auto m-4 self-end *:rounded-full! *:p-4",
+ onclick: move |_| {
+ *TASK_BEING_EDITED.write() = None;
+ *PROJECT_BEING_EDITED.write() = None;
+ navigator.push(
+ match current_route {
+ Route::ProjectsPage => Route::ProjectFormPage,
+ _ => Route::TaskFormPage,
+ }
+ );
+ },
+ Icon {
+ icon: FaGavel,
+ height: 24,
+ width: 24
+ }
+ }
+ }
+}
diff --git a/src/components/error_boundary_message.rs b/src/components/error_boundary_message.rs
index 4beb4d4..6beb3ac 100644
--- a/src/components/error_boundary_message.rs
+++ b/src/components/error_boundary_message.rs
@@ -14,6 +14,7 @@ pub(crate) fn ErrorBoundaryMessage(children: Element, class: Option) ->
class: "grow flex flex-col justify-center items-center",
div {
Icon {
+ class: "text-gray-500",
icon: FaTriangleExclamation,
height: 32,
width: 32
diff --git a/src/components/form_open_button.rs b/src/components/form_open_button.rs
deleted file mode 100644
index 253e1c4..0000000
--- a/src/components/form_open_button.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-use crate::models::project::Project;
-use crate::models::task::Task;
-use dioxus::prelude::*;
-use dioxus_free_icons::{
- Icon,
- icons::fa_solid_icons::{FaPlus, FaXmark},
-};
-
-#[component]
-pub(crate) fn FormOpenButton(opened: Signal) -> Element {
- let mut project_being_edited = use_context::>>();
- let mut task_being_edited = use_context::>>();
-
- rsx! {
- button {
- class: "pointer-events-auto m-4 py-4 px-5 self-end text-center bg-zinc-300/50 rounded-xl border-t-zinc-200 border-t backdrop-blur drop-shadow-[0_-5px_10px_rgba(0,0,0,0.2)] text-2xl text-zinc-200 cursor-pointer",
- onclick: move |_| {
- if opened() {
- project_being_edited.set(None);
- task_being_edited.set(None);
- }
- opened.set(!opened());
- },
- if opened() {
- Icon {
- icon: FaXmark,
- height: 24,
- width: 24
- }
- } else {
- Icon {
- icon: FaPlus,
- height: 24,
- width: 24
- }
- }
- }
- }
-}
diff --git a/src/components/input.rs b/src/components/input.rs
new file mode 100644
index 0000000..91aad72
--- /dev/null
+++ b/src/components/input.rs
@@ -0,0 +1,53 @@
+use dioxus::prelude::*;
+
+#[component]
+pub(crate) fn Input(
+ class: Option,
+ name: String,
+ r#type: String,
+ id: Option,
+ #[props(extends = GlobalAttributes, extends = input)] attributes: Vec,
+ // TODO: Remove this once https://github.com/DioxusLabs/dioxus/issues/5271 gets resolved.
+ autofocus: Option,
+ // TODO: Remove this once https://github.com/DioxusLabs/dioxus/issues/4019 gets resolved.
+ oninput: Option>>,
+ onchange: Option>>,
+) -> Element {
+ rsx! {
+ input {
+ class: format!(
+ /* `w-full` is required for the Chromium renderer to allow the input to shrink
+ properly. */
+ "pt-3 pb-2.25 w-full {} bg-gray-800-muted enabled:hover:bg-gray-800 enabled:focus:bg-gray-800 drop-shadow-[0_calc(0px_-_var(--spacing))_0_var(--color-gray-900-muted)] rounded-xl outline-0 {} transition-all duration-150 {}",
+ match r#type.as_str() {
+ "date" => "ps-3.25 pe-3",
+ _ => "px-4"
+ },
+ match r#type.as_str() {
+ "text" | "number" => "",
+ _ => "enabled:cursor-pointer"
+ },
+ class.unwrap_or("".to_owned())
+ ),
+ name: name.clone(),
+ r#type,
+ id: id.unwrap_or(format!("input_{}", name)),
+ oninput: move |event| {
+ if let Some(oninput) = oninput {
+ oninput.call(event);
+ }
+ },
+ onchange: move |event| {
+ if let Some(onchange) = oninput {
+ onchange.call(event);
+ }
+ },
+ onmounted: move |element| async move {
+ if let Some(true) = autofocus {
+ let _ = element.set_focus(true).await;
+ }
+ },
+ ..attributes
+ }
+ }
+}
diff --git a/src/components/input_label.rs b/src/components/input_label.rs
new file mode 100644
index 0000000..b1b859d
--- /dev/null
+++ b/src/components/input_label.rs
@@ -0,0 +1,21 @@
+use dioxus::prelude::*;
+use dioxus_free_icons::{Icon, IconShape};
+
+#[component]
+pub(crate) fn InputLabel(
+ icon: I,
+ r#for: Option,
+) -> Element {
+ rsx! {
+ label {
+ r#for,
+ class: "mt-0.5 min-w-7 flex flex-row justify-center items-center",
+ Icon {
+ class: "text-gray-600",
+ icon,
+ height: 16,
+ width: 16
+ }
+ }
+ }
+}
diff --git a/src/components/mod.rs b/src/components/mod.rs
index 81d8ae0..4ca3745 100644
--- a/src/components/mod.rs
+++ b/src/components/mod.rs
@@ -1,16 +1,21 @@
pub(crate) mod app;
pub(crate) mod bottom_panel;
+pub(crate) mod button_primary;
+pub(crate) mod button_secondary;
pub(crate) mod category_calendar_task_list;
pub(crate) mod category_input;
pub(crate) mod category_today_task_list;
+pub(crate) mod create_button;
pub(crate) mod error_boundary_message;
-pub(crate) mod form_open_button;
+pub(crate) mod input;
+pub(crate) mod input_label;
pub(crate) mod navigation;
pub(crate) mod navigation_item;
pub(crate) mod project_form;
pub(crate) mod project_list;
pub(crate) mod project_select;
-pub(crate) mod reoccurrence_input;
+pub(crate) mod reoccurrence_interval_input;
+pub(crate) mod select_button;
pub(crate) mod sticky_bottom;
pub(crate) mod subtasks_form;
pub(crate) mod task_form;
diff --git a/src/components/navigation.rs b/src/components/navigation.rs
index 4c01216..0ced100 100644
--- a/src/components/navigation.rs
+++ b/src/components/navigation.rs
@@ -2,32 +2,37 @@ use crate::components::navigation_item::NavigationItem;
use crate::route::Route;
use dioxus::prelude::*;
use dioxus_free_icons::Icon;
+use dioxus_free_icons::icons::fa_regular_icons::FaLightbulb;
use dioxus_free_icons::icons::fa_solid_icons::{
- FaBars, FaCalendarDay, FaCalendarDays, FaCheck, FaForward, FaHourglassHalf, FaInbox, FaList,
- FaQuestion, FaTrashCan,
+ FaBars, FaCalendarDay, FaCalendarDays, FaHourglassHalf, FaInbox, FaList, FaSignsPost,
+ FaTrashCan, FaVolcano,
};
#[component]
-pub(crate) fn Navigation(expanded: Signal) -> Element {
+pub(crate) fn Navigation(is_expanded: Signal) -> Element {
rsx! {
div {
class: "grid grid-cols-5 justify-stretch",
button {
class: format!(
- "py-5 flex flex-row justify-center items-center {} cursor-pointer",
- if expanded() { "text-zinc-200" }
- else { "text-zinc-500" }
+ "py-2 flex flex-row justify-center items-center cursor-pointer",
),
- onclick: move |_| expanded.set(!expanded()),
- Icon {
- icon: FaBars,
- height: 24,
- width: 24
+ onclick: move |_| is_expanded.set(!is_expanded()),
+ div {
+ class: format!("pt-2.5 px-4 {} transition-all duration-150",
+ if is_expanded() { "pb-2 mt-1 bg-gray-900 text-gray-400 rounded-xl drop-shadow-[0_calc(0px_-_var(--spacing))_0_var(--color-gray-950)]" }
+ else { "pb-3 bg-gray-800 rounded-xl drop-shadow-[0_0_0_var(--color-gray-950)] text-gray-600" }
+ ),
+ Icon {
+ icon: FaBars,
+ height: 24,
+ width: 24
+ }
}
},
NavigationItem {
route: Route::CategoryNextStepsPage,
- icon: FaForward
+ icon: FaSignsPost
},
NavigationItem {
route: Route::CategoryCalendarPage,
@@ -41,7 +46,7 @@ pub(crate) fn Navigation(expanded: Signal) -> Element {
route: Route::CategoryInboxPage,
icon: FaInbox
},
- {if expanded() {
+ {if is_expanded() {
rsx! {
NavigationItem {
route: Route::ProjectsPage,
@@ -53,11 +58,11 @@ pub(crate) fn Navigation(expanded: Signal) -> Element {
},
NavigationItem {
route: Route::CategoryDonePage,
- icon: FaCheck
+ icon: FaVolcano
},
NavigationItem {
route: Route::CategorySomedayMaybePage,
- icon: FaQuestion
+ icon: FaLightbulb
},
NavigationItem {
route: Route::CategoryWaitingForPage,
diff --git a/src/components/navigation_item.rs b/src/components/navigation_item.rs
index 39c139e..720c535 100644
--- a/src/components/navigation_item.rs
+++ b/src/components/navigation_item.rs
@@ -13,14 +13,18 @@ pub(crate) fn NavigationItem(
Link {
to: route.clone(),
class: format!(
- "py-5 flex flex-row justify-center items-center {}",
- if current_route == route { "text-zinc-200" }
- else { "text-zinc-500" }
+ "py-2.5 flex flex-row justify-center items-center hover:*:bg-gray-900 active:*:text-gray-400",
),
- Icon {
- icon,
- height: 24,
- width: 24
+ div {
+ class: format!("pt-2.5 px-4 {} transition-all duration-150",
+ if current_route == route { "pb-2 mt-1 bg-gray-900 text-gray-400 rounded-xl drop-shadow-[0_calc(0px_-_var(--spacing))_0_var(--color-gray-950)]" }
+ else { "pb-3 bg-gray-800 rounded-xl drop-shadow-[0_0_0_var(--color-gray-950)] text-gray-600" }
+ ),
+ Icon {
+ icon,
+ height: 24,
+ width: 24
+ }
}
}
}
diff --git a/src/components/project_form.rs b/src/components/project_form.rs
index 07a2206..5ac7857 100644
--- a/src/components/project_form.rs
+++ b/src/components/project_form.rs
@@ -1,82 +1,110 @@
+use crate::components::button_primary::ButtonPrimary;
+use crate::components::button_secondary::ButtonSecondary;
+use crate::components::input::Input;
+use crate::components::input_label::InputLabel;
use crate::models::project::Project;
use crate::server::projects::{create_project, delete_project, edit_project};
use dioxus::core_macro::{component, rsx};
use dioxus::dioxus_core::Element;
use dioxus::prelude::*;
use dioxus_free_icons::Icon;
-use dioxus_free_icons::icons::fa_solid_icons::{FaFloppyDisk, FaPenClip, FaTrashCan};
+use dioxus_free_icons::icons::fa_solid_icons::{FaFeatherPointed, FaStamp, FaTrashCan, FaXmark};
+
+pub(crate) static PROJECT_BEING_EDITED: GlobalSignal