From 74bc8d78a0952f294f001449ba659f9a2337f521 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Thu, 9 Feb 2023 17:24:42 +0100 Subject: [PATCH] #505 - Enhancements to theming of the data fields --- .../components/Common/Button.tsx | 2 +- .../components/Common/LinkButton.tsx | 26 ++++++ .../components/DataView/SortableItem.tsx | 30 ++----- .../components/SnippetsView/Item.tsx | 2 +- .../TaxonomyView/TaxonomyActions.tsx | 47 ++++------ .../TaxonomyView/TaxonomyLookup.tsx | 4 +- .../TaxonomyView/TaxonomyManager.tsx | 36 +++++--- .../components/UnknownView/UnknownView.tsx | 7 +- src/dashboardWebView/index.tsx | 11 +-- src/dashboardWebView/styles.css | 85 ++++++++++++++++--- 10 files changed, 162 insertions(+), 88 deletions(-) create mode 100644 src/dashboardWebView/components/Common/LinkButton.tsx diff --git a/src/dashboardWebView/components/Common/Button.tsx b/src/dashboardWebView/components/Common/Button.tsx index 4b494b4f..140d3f88 100644 --- a/src/dashboardWebView/components/Common/Button.tsx +++ b/src/dashboardWebView/components/Common/Button.tsx @@ -21,7 +21,7 @@ export const Button: React.FunctionComponent = ({ + ); +}; \ No newline at end of file diff --git a/src/dashboardWebView/components/DataView/SortableItem.tsx b/src/dashboardWebView/components/DataView/SortableItem.tsx index 793baa09..bfcd2bd1 100644 --- a/src/dashboardWebView/components/DataView/SortableItem.tsx +++ b/src/dashboardWebView/components/DataView/SortableItem.tsx @@ -2,6 +2,7 @@ import { PencilIcon, SelectorIcon, TrashIcon, XIcon } from '@heroicons/react/out import * as React from 'react'; import { SortableHandle, SortableElement } from 'react-sortable-hoc'; import useThemeColors from '../../hooks/useThemeColors'; +import { LinkButton } from '../Common/LinkButton'; import { Alert } from '../Modals/Alert'; export interface ISortableItemProps { @@ -50,34 +51,19 @@ export const SortableItem = SortableElement(
- - +
diff --git a/src/dashboardWebView/components/SnippetsView/Item.tsx b/src/dashboardWebView/components/SnippetsView/Item.tsx index 8b78e3c0..e96327e9 100644 --- a/src/dashboardWebView/components/SnippetsView/Item.tsx +++ b/src/dashboardWebView/components/SnippetsView/Item.tsx @@ -145,7 +145,7 @@ export const Item: React.FunctionComponent = ({ return ( <> -
  • = ( return (
    {unmapped && ( - + )} - + - + - + - +
    ); }; diff --git a/src/dashboardWebView/components/TaxonomyView/TaxonomyLookup.tsx b/src/dashboardWebView/components/TaxonomyView/TaxonomyLookup.tsx index 92a87439..b6e5af88 100644 --- a/src/dashboardWebView/components/TaxonomyView/TaxonomyLookup.tsx +++ b/src/dashboardWebView/components/TaxonomyView/TaxonomyLookup.tsx @@ -6,6 +6,7 @@ import { useRecoilValue } from 'recoil'; import { getTaxonomyField } from '../../../helpers/getTaxonomyField'; import { useNavigate } from 'react-router-dom'; import { routePaths } from '../..'; +import useThemeColors from '../../hooks/useThemeColors'; export interface ITaxonomyLookupProps { taxonomy: string | null; @@ -20,6 +21,7 @@ export const TaxonomyLookup: React.FunctionComponent = ({ }: React.PropsWithChildren) => { const settings = useRecoilValue(SettingsSelector); const navigate = useNavigate(); + const { getColors } = useThemeColors(); const total: number | undefined = useMemo(() => { if (!taxonomy || !value || !pages || !settings?.contentTypes) { @@ -54,7 +56,7 @@ export const TaxonomyLookup: React.FunctionComponent = ({ if (taxonomy === 'tags' || taxonomy === 'categories') { return (