From 3747dbc1a8c42fdf24112f25459014f459105ade Mon Sep 17 00:00:00 2001 From: Carlos Valente Date: Mon, 21 Jul 2025 07:07:26 +0200 Subject: [PATCH] refactor: style and ux tweaks --- .../common/components/copy-tag/CopyTag.tsx | 19 ++++++++----------- .../components/dialog/Dialog.module.scss | 1 + .../input/delay-input/BlockRadio.module.scss | 8 ++------ .../radio-group/RadioGroup.module.scss | 8 ++------ .../view-params-editor/ViewParamsSection.tsx | 1 - .../panel/feature-panel/URLPresets.tsx | 11 ++++++----- .../feature-panel/composite/URLPresetForm.tsx | 12 +++++++----- 7 files changed, 26 insertions(+), 34 deletions(-) diff --git a/apps/client/src/common/components/copy-tag/CopyTag.tsx b/apps/client/src/common/components/copy-tag/CopyTag.tsx index 9b9ab9957..8edf6d5ad 100644 --- a/apps/client/src/common/components/copy-tag/CopyTag.tsx +++ b/apps/client/src/common/components/copy-tag/CopyTag.tsx @@ -1,4 +1,4 @@ -import { PropsWithChildren, useState } from 'react'; +import { PropsWithChildren, useRef, useState } from 'react'; import { IoCheckmark } from 'react-icons/io5'; import { IoCopy } from 'react-icons/io5'; @@ -24,32 +24,29 @@ export default function CopyTag({ onClick, }: PropsWithChildren) { const [copied, setCopied] = useState(false); + const timeoutRef = useRef(null); const handleClick = () => { copyToClipboard(copyValue); setCopied(true); // reset copied state - setTimeout(() => setCopied(false), 1000); + if (timeoutRef.current) { + clearTimeout(timeoutRef.current); + } + timeoutRef.current = setTimeout(() => setCopied(false), 2000); }; return (
{onClick !== undefined ? ( - ) : (
{children}
)} - + {copied ? : }
diff --git a/apps/client/src/common/components/dialog/Dialog.module.scss b/apps/client/src/common/components/dialog/Dialog.module.scss index a8370909e..fa6ee98d3 100644 --- a/apps/client/src/common/components/dialog/Dialog.module.scss +++ b/apps/client/src/common/components/dialog/Dialog.module.scss @@ -13,6 +13,7 @@ border-radius: 3px; box-shadow: $box-shadow-l1; border: 1px solid $gray-1100; + outline: none; } .backdrop { diff --git a/apps/client/src/common/components/input/delay-input/BlockRadio.module.scss b/apps/client/src/common/components/input/delay-input/BlockRadio.module.scss index 2b4d185df..4ea9ee050 100644 --- a/apps/client/src/common/components/input/delay-input/BlockRadio.module.scss +++ b/apps/client/src/common/components/input/delay-input/BlockRadio.module.scss @@ -31,11 +31,7 @@ } &[data-checked] { - background-color: $gray-1200; - - &:hover { - border-color: $gray-1000; - } + background-color: $gray-700; } &:focus-visible { @@ -57,6 +53,6 @@ border-radius: 100%; width: 0.5em; height: 0.5em; - background-color: $blue-500; + background-color: $ui-white; } } diff --git a/apps/client/src/common/components/radio-group/RadioGroup.module.scss b/apps/client/src/common/components/radio-group/RadioGroup.module.scss index 7dbb056cc..e6db7f378 100644 --- a/apps/client/src/common/components/radio-group/RadioGroup.module.scss +++ b/apps/client/src/common/components/radio-group/RadioGroup.module.scss @@ -1,6 +1,5 @@ .radioGroup { display: flex; - gap: 0.25rem; color: $gray-900; font-size: calc(1rem - 2px); color: $ui-white; @@ -46,10 +45,7 @@ } &[data-checked] { - background-color: $ui-white; - &:hover { - border-color: $gray-1000; - } + background-color: $blue-700; } &:focus-visible { @@ -71,6 +67,6 @@ border-radius: 100%; width: 0.5rem; height: 0.5rem; - background-color: $gray-1200; + background-color: $ui-white; } } diff --git a/apps/client/src/common/components/view-params-editor/ViewParamsSection.tsx b/apps/client/src/common/components/view-params-editor/ViewParamsSection.tsx index 2e310ad5a..9d9dc4fac 100644 --- a/apps/client/src/common/components/view-params-editor/ViewParamsSection.tsx +++ b/apps/client/src/common/components/view-params-editor/ViewParamsSection.tsx @@ -1,4 +1,3 @@ -import { memo } from 'react'; import { IoChevronDown } from 'react-icons/io5'; import { useLocalStorage } from '@mantine/hooks'; diff --git a/apps/client/src/features/app-settings/panel/feature-panel/URLPresets.tsx b/apps/client/src/features/app-settings/panel/feature-panel/URLPresets.tsx index 7c772e262..82222ad98 100644 --- a/apps/client/src/features/app-settings/panel/feature-panel/URLPresets.tsx +++ b/apps/client/src/features/app-settings/panel/feature-panel/URLPresets.tsx @@ -7,6 +7,7 @@ import IconButton from '../../../../common/components/buttons/IconButton'; import Info from '../../../../common/components/info/Info'; import ExternalLink from '../../../../common/components/link/external-link/ExternalLink'; import Switch from '../../../../common/components/switch/Switch'; +import Tag from '../../../../common/components/tag/Tag'; import useUrlPresets, { useUpdateUrlPreset } from '../../../../common/hooks-query/useUrlPresets'; import { handleLinks } from '../../../../common/utils/linkUtils'; import * as Panel from '../../panel-utils/PanelUtils'; @@ -57,9 +58,8 @@ export default function URLPresets() { Enabled - Alias Target view - URL parameters + Alias @@ -71,9 +71,10 @@ export default function URLPresets() { {}} /> - {preset.alias} - {preset.target} - {preset.search} + + {preset.target} + + {preset.alias} [] = [ { value: OntimeView.Cuesheet, label: 'Cuesheet' }, { value: OntimeView.Operator, label: 'Operator' }, { value: OntimeView.Timer, label: 'Timer' }, @@ -126,14 +127,15 @@ export default function URLPresetForm({ urlPreset, onClose }: URLPresetFormProps