From 4ea61b2c8962180f720919f1e00921f553080aa1 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 13 Jan 2024 20:21:03 -0300 Subject: [PATCH] frontend: improve 'New task' page --- twenty-frontend/src/js/components/Group.tsx | 16 ++- twenty-frontend/src/js/components/NavBar.tsx | 14 ++- twenty-frontend/src/js/components/Task.tsx | 126 +++++++++---------- 3 files changed, 87 insertions(+), 69 deletions(-) diff --git a/twenty-frontend/src/js/components/Group.tsx b/twenty-frontend/src/js/components/Group.tsx index e093fa5..e96f59b 100644 --- a/twenty-frontend/src/js/components/Group.tsx +++ b/twenty-frontend/src/js/components/Group.tsx @@ -30,10 +30,19 @@ export function Group({ groupName, getItems }: Props) { const classes = {}; const editHref = `/tasks/edit#id=${task.id}`; return ( -
  • +
  • - + {task.title} {datetime.toFormat("dd LLL, yyyy")} at{" "} @@ -63,7 +72,8 @@ export function Group({ groupName, getItems }: Props) {
    Add a task - . + {" "} + .

    )}
    diff --git a/twenty-frontend/src/js/components/NavBar.tsx b/twenty-frontend/src/js/components/NavBar.tsx index a451d2d..e8fe8f5 100644 --- a/twenty-frontend/src/js/components/NavBar.tsx +++ b/twenty-frontend/src/js/components/NavBar.tsx @@ -9,7 +9,11 @@ const ACTIVE_CLASSNAMES = [ "bg-secondary", "text-primary", ].join(" "); -const INACTIVE_CLASSNAMES = [...BASE_CLASSNAMES, "text-accent", "secondary-hover"].join(" "); +const INACTIVE_CLASSNAMES = [ + ...BASE_CLASSNAMES, + "text-accent", + "secondary-hover", +].join(" "); type Item = { text: string; href: string }; type Bar = Record>; @@ -42,13 +46,17 @@ export function NavBar() { const items = bar[key]; return ( <> -

    {key}

    +

    {key}

    {task ? "Edit task" : "New task"}

    -
    -
    - -
    -
    -
    - -
    -
    + Editor + +
  • +
  • + setIsEditable(false)} + > + Preview + +
  • + + + + {isEditable ? ( + <> +