From 8da039591730d8579a951f1fcd6197c678a6a765 Mon Sep 17 00:00:00 2001 From: Marco Rodolfi Date: Mon, 23 Jan 2023 13:23:18 +0100 Subject: [PATCH] Styling fixes --- .../components/modals/PluginInstallModal.tsx | 8 ++--- frontend/src/components/store/PluginCard.tsx | 8 ++--- frontend/src/components/store/Store.tsx | 36 ++++++++++--------- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/frontend/src/components/modals/PluginInstallModal.tsx b/frontend/src/components/modals/PluginInstallModal.tsx index 46b20d89..5183ab80 100644 --- a/frontend/src/components/modals/PluginInstallModal.tsx +++ b/frontend/src/components/modals/PluginInstallModal.tsx @@ -1,7 +1,7 @@ import { ConfirmModal, Navigation, QuickAccessTab } from 'decky-frontend-lib'; import { FC, useState } from 'react'; - import { useTranslation } from 'react-i18next'; + const { t } = useTranslation('PluginInstallModal'); interface PluginInstallModalProps { @@ -29,13 +29,13 @@ const PluginInstallModal: FC = ({ artifact, version, ha onCancel={async () => { await onCancel(); }} - strTitle={t("install_title", artifact)} - strOKButtonText={loading ? t("install_button_processing") : t("install_button_idle")} + strTitle={t('install_title', artifact)} + strOKButtonText={loading ? t('install_button_processing') : t('install_button_idle')} > {hash == 'False' ? (

!!!!NO HASH PROVIDED!!!!

) : ( - t("install_desc", artifact, version) + t('install_desc', artifact, version) )} ); diff --git a/frontend/src/components/store/PluginCard.tsx b/frontend/src/components/store/PluginCard.tsx index 272d0abe..c91218b4 100644 --- a/frontend/src/components/store/PluginCard.tsx +++ b/frontend/src/components/store/PluginCard.tsx @@ -100,7 +100,7 @@ const PluginCard: FC = ({ plugin }) => { plugin.description ) : ( - {t("plugin_no_desc")} + {t('plugin_no_desc')} )} @@ -112,7 +112,7 @@ const PluginCard: FC = ({ plugin }) => { color: '#fee75c', }} > - {t("plugin_full_access")}{' '} + {t('plugin_full_access')}{' '} = ({ plugin }) => { layout="below" onClick={() => requestPluginInstall(plugin.name, plugin.versions[selectedOption])} > - {t("plugin_install")} + {t('plugin_install')}
= ({ plugin }) => { label: version.name, })) as SingleDropdownOption[] } - menuLabel={t("plugin_version_label") as string} + menuLabel={t('plugin_version_label') as string} selectedOption={selectedOption} onChange={({ data }) => setSelectedOption(data)} /> diff --git a/frontend/src/components/store/Store.tsx b/frontend/src/components/store/Store.tsx index ad1cab12..24f3e7b3 100644 --- a/frontend/src/components/store/Store.tsx +++ b/frontend/src/components/store/Store.tsx @@ -9,15 +9,15 @@ import { findModule, } from 'decky-frontend-lib'; import { FC, useEffect, useMemo, useState } from 'react'; - import { useTranslation } from 'react-i18next'; -const { t } = useTranslation('Store'); import logo from '../../../assets/plugin_store.png'; import Logger from '../../logger'; import { StorePlugin, getPluginList } from '../../store'; import PluginCard from './PluginCard'; +const { t } = useTranslation('Store'); + const logger = new Logger('FilePicker'); const StorePage: FC<{}> = () => { @@ -57,13 +57,13 @@ const StorePage: FC<{}> = () => { }} tabs={[ { - title: t("store_tabs_title"), + title: t('store_tabs_title'), content: , id: 'browse', renderTabAddon: () => {data.length}, }, { - title: t("store_tabs_about"), + title: t('store_tabs_about'), content: , id: 'about', }, @@ -78,8 +78,8 @@ const StorePage: FC<{}> = () => { const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => { const sortOptions = useMemo( (): DropdownOption[] => [ - { data: 1, label: t("store_tabs_alph_desc") }, - { data: 2, label: t("store_tabs_alph_asce") }, + { data: 1, label: t('store_tabs_alph_desc') }, + { data: 2, label: t('store_tabs_alph_asce') }, ], [], ); @@ -154,11 +154,11 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => { maxWidth: '100%', }} > - {t("store_sort_label")} + {t('store_sort_label')} setSort(e.data)} /> @@ -168,7 +168,11 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
- setSearchValue(e.target.value)} /> + setSearchValue(e.target.value)} + />
@@ -219,7 +223,7 @@ const AboutTab: FC<{}> = () => { /> Testing - {t("store_testing_cta")}{' '} + {t('store_testing_cta')}{' '}
= () => { deckbrew.xyz/testing - {t("store_contrib_label")} - - {t("store_contrib_desc")} - - {t("store_source_label")} - {t("store_source_desc")} + {t('store_contrib_label')} + {t('store_contrib_desc')} + {t('store_source_label')} + {t('store_source_desc')}
); };