From b2e3c8a4a333468f62de045ac441433bc5881f89 Mon Sep 17 00:00:00 2001 From: Kleber Santos Date: Mon, 22 Jul 2024 20:07:24 -0300 Subject: [PATCH] feat: hide preview button when the text in not being edited --- app/renderer/src/components/Checkbox.tsx | 13 +++----- app/renderer/src/components/Radio.tsx | 7 +--- .../src/routes/Tasks/TaskDetails/index.tsx | 2 +- .../src/styles/components/checkbox.ts | 33 +++++-------------- 4 files changed, 16 insertions(+), 39 deletions(-) diff --git a/app/renderer/src/components/Checkbox.tsx b/app/renderer/src/components/Checkbox.tsx index 697a9012..08696649 100644 --- a/app/renderer/src/components/Checkbox.tsx +++ b/app/renderer/src/components/Checkbox.tsx @@ -8,18 +8,15 @@ import { export type CheckboxProps = { label?: string; asPrimary?: boolean; + hidden?: boolean; } & React.HTMLProps; export const Checkbox = React.forwardRef< HTMLInputElement, CheckboxProps ->(({ id, label, name, disabled, asPrimary, ...props }, ref) => { +>(({ id, label, name, disabled, asPrimary, hidden, ...props }, ref) => { return ( - + - - {label} + ); }); diff --git a/app/renderer/src/components/Radio.tsx b/app/renderer/src/components/Radio.tsx index bf092834..e7b1c91f 100644 --- a/app/renderer/src/components/Radio.tsx +++ b/app/renderer/src/components/Radio.tsx @@ -9,12 +9,7 @@ import { CheckboxProps } from "./Checkbox"; export const Radio = React.forwardRef( ({ id, label, name, disabled, asPrimary, ...props }, ref) => { return ( - + ( Description