From 048b27a89b57c83411dfababda401f0b9cbd1991 Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Sat, 5 Aug 2023 23:19:26 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20Link=20out=20of=20trans?= =?UTF-8?q?lation=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/en/common.json | 3 ++- public/locales/en/modules/bookmark.json | 2 +- .../Widgets/Inputs/LocationSelection.tsx | 4 +++- .../Tiles/Widgets/WidgetsEditModal.tsx | 21 ++++++++++--------- src/components/InfoCard/InfoCard.tsx | 8 +++++-- src/widgets/bookmark/BookmarkWidgetTile.tsx | 2 +- src/widgets/widgets.ts | 1 + 7 files changed, 25 insertions(+), 16 deletions(-) diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 4b5059ae0..df864b716 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -35,5 +35,6 @@ "small": "small", "medium": "medium", "large": "large" - } + }, + "seeMore": "See more..." } \ No newline at end of file diff --git a/public/locales/en/modules/bookmark.json b/public/locales/en/modules/bookmark.json index a3e694914..183ee3130 100644 --- a/public/locales/en/modules/bookmark.json +++ b/public/locales/en/modules/bookmark.json @@ -6,7 +6,7 @@ "title": "Bookmark settings", "name": { "label": "Widget Title", - "info": "Leave empty to keep the title hidden. See More..." + "info": "Leave empty to keep the title hidden." }, "items": { "label": "Items" diff --git a/src/components/Dashboard/Tiles/Widgets/Inputs/LocationSelection.tsx b/src/components/Dashboard/Tiles/Widgets/Inputs/LocationSelection.tsx index c4ea4eff5..3138af508 100644 --- a/src/components/Dashboard/Tiles/Widgets/Inputs/LocationSelection.tsx +++ b/src/components/Dashboard/Tiles/Widgets/Inputs/LocationSelection.tsx @@ -32,6 +32,7 @@ type LocationSelectionProps = { value: any; handleChange: (key: string, value: IntegrationOptionsValueType) => void; info?: boolean; + infoLink?: string; }; export const LocationSelection = ({ @@ -40,6 +41,7 @@ export const LocationSelection = ({ value, handleChange, info, + infoLink, }: LocationSelectionProps) => { const { t } = useTranslation('widgets/location'); const [query, setQuery] = useState(value.name ?? ''); @@ -63,7 +65,7 @@ export const LocationSelection = ({ {t(`modules/${widgetId}:descriptor.settings.${key}.label`)} - {info && } + {info && } diff --git a/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx b/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx index 457c83f59..bc9b2d62b 100644 --- a/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx +++ b/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx @@ -15,7 +15,7 @@ import { Title, } from '@mantine/core'; import { ContextModalProps } from '@mantine/modals'; -import { IconAlertTriangle, IconPlaylistX, IconPlus, IconInfoCircle } from '@tabler/icons-react'; +import { IconAlertTriangle, IconPlaylistX, IconPlus } from '@tabler/icons-react'; import { Trans, useTranslation } from 'next-i18next'; import { FC, useState } from 'react'; @@ -136,6 +136,7 @@ const WidgetOptionTypeSwitch: FC<{ }> = ({ option, widgetId, propName: key, value, handleChange }) => { const { t } = useTranslation([`modules/${widgetId}`, 'common']); const info = option.info ?? false; + const link = option.infoLink ?? undefined; switch (option.type) { case 'switch': @@ -147,7 +148,7 @@ const WidgetOptionTypeSwitch: FC<{ onChange={(ev) => handleChange(key, ev.currentTarget.checked)} {...option.inputProps} /> - {info && } + {info && } ); case 'text': @@ -155,7 +156,7 @@ const WidgetOptionTypeSwitch: FC<{ {t(`descriptor.settings.${key}.label`)} - {info && } + {info && } {t(`descriptor.settings.${key}.label`)} - {info && } + {info && } {t(`descriptor.settings.${key}.label`)} - {info && } + {info && }