From 6479c6c1c94a5507d276199693b7e14d1f4bd709 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Thu, 11 Jan 2024 01:04:51 -0300 Subject: [PATCH] frontend: layout / design tweaks --- twenty-frontend/src/css/_global.scss | 1 - twenty-frontend/src/css/_layout.scss | 4 + twenty-frontend/src/css/_panels.scss | 7 +- .../src/html/tasks/edit/index.html.erb | 4 +- .../src/html/tasks/new/index.html.erb | 4 +- twenty-frontend/src/js/components/Task.tsx | 148 ++++++++++-------- .../src/js/hooks/mutations/useCreateTask.ts | 17 +- 7 files changed, 107 insertions(+), 78 deletions(-) diff --git a/twenty-frontend/src/css/_global.scss b/twenty-frontend/src/css/_global.scss index d8cc8d5..0704d86 100644 --- a/twenty-frontend/src/css/_global.scss +++ b/twenty-frontend/src/css/_global.scss @@ -13,5 +13,4 @@ body .wrapper { margin: 0; padding: 0; } - .w-85 { width: 85%; } } diff --git a/twenty-frontend/src/css/_layout.scss b/twenty-frontend/src/css/_layout.scss index 57a61d6..328595a 100644 --- a/twenty-frontend/src/css/_layout.scss +++ b/twenty-frontend/src/css/_layout.scss @@ -22,3 +22,7 @@ .w-100 { width: 100%; } .w-95 { width: 95%; } .w-85 { width: 85%; } +.h-100 { height: 100%; } +.h-80 { height: 80%; } +.h-50 { height: 50%; } +.h-70 { height: 70%; } diff --git a/twenty-frontend/src/css/_panels.scss b/twenty-frontend/src/css/_panels.scss index 438cf20..af14d70 100644 --- a/twenty-frontend/src/css/_panels.scss +++ b/twenty-frontend/src/css/_panels.scss @@ -33,8 +33,8 @@ border-radius: 5px; min-width: 120px; text-align: center; - background: $secondary-color; - color: lighten($secondary-color, 15%); + background: $primary-color; + color: $secondary-color; cursor: pointer; opacity: 0.5; } @@ -51,6 +51,9 @@ width: 100%; .task.content { padding: 10px; + ul { + padding: revert; + } ul li { line-height: 1.7em; } diff --git a/twenty-frontend/src/html/tasks/edit/index.html.erb b/twenty-frontend/src/html/tasks/edit/index.html.erb index 0db39ab..faaa5fd 100644 --- a/twenty-frontend/src/html/tasks/edit/index.html.erb +++ b/twenty-frontend/src/html/tasks/edit/index.html.erb @@ -1,4 +1,4 @@ -
-
+
+
diff --git a/twenty-frontend/src/html/tasks/new/index.html.erb b/twenty-frontend/src/html/tasks/new/index.html.erb index d17b804..366a6fe 100644 --- a/twenty-frontend/src/html/tasks/new/index.html.erb +++ b/twenty-frontend/src/html/tasks/new/index.html.erb @@ -1,4 +1,4 @@ -
-
+
+
diff --git a/twenty-frontend/src/js/components/Task.tsx b/twenty-frontend/src/js/components/Task.tsx index 1580851..05b9c4b 100644 --- a/twenty-frontend/src/js/components/Task.tsx +++ b/twenty-frontend/src/js/components/Task.tsx @@ -6,6 +6,8 @@ import { useFindTask } from "/hooks/queries/useFindTask"; import { useProjects } from "/hooks/queries/useProjects"; import { Task, Project, TaskInput, Maybe } from "/types/schema"; import { rendermd } from "/lib/markdown-utils"; +import { NavBar } from "/components/NavBar"; + import classnames from "classnames"; const DEFAULT_TASK_CONTENT = [ @@ -30,7 +32,7 @@ export function Task({ taskId }: { taskId?: number }) { defaultValues: { projectId: 1 }, }); const [isEditable, setIsEditable] = useState(!taskId); - const [createTask] = useCreateTask(); + const createTask = useCreateTask(); const updateTask = useUpdateTask(); const { data: taskData, loading: findingTask } = useFindTask(Number(taskId)); const { data: projectsData, loading: findingProjects } = useProjects(); @@ -64,77 +66,85 @@ export function Task({ taskId }: { taskId?: number }) { } return ( -
-
-
-
    -
  • setIsEditable(true)} - > - Write -
  • -
  • setIsEditable(false)} - > - Preview -
  • -
-
-
-
- -
-
- -
- {isEditable ? ( - <> -
-