Styling fixes

This commit is contained in:
Marco Rodolfi
2023-01-23 13:23:18 +01:00
parent 0f0b47beed
commit 8da0395917
3 changed files with 27 additions and 25 deletions
@@ -1,7 +1,7 @@
import { ConfirmModal, Navigation, QuickAccessTab } from 'decky-frontend-lib'; import { ConfirmModal, Navigation, QuickAccessTab } from 'decky-frontend-lib';
import { FC, useState } from 'react'; import { FC, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
const { t } = useTranslation('PluginInstallModal'); const { t } = useTranslation('PluginInstallModal');
interface PluginInstallModalProps { interface PluginInstallModalProps {
@@ -29,13 +29,13 @@ const PluginInstallModal: FC<PluginInstallModalProps> = ({ artifact, version, ha
onCancel={async () => { onCancel={async () => {
await onCancel(); await onCancel();
}} }}
strTitle={t("install_title", artifact)} strTitle={t('install_title', artifact)}
strOKButtonText={loading ? t("install_button_processing") : t("install_button_idle")} strOKButtonText={loading ? t('install_button_processing') : t('install_button_idle')}
> >
{hash == 'False' ? ( {hash == 'False' ? (
<h3 style={{ color: 'red' }}>!!!!NO HASH PROVIDED!!!!</h3> <h3 style={{ color: 'red' }}>!!!!NO HASH PROVIDED!!!!</h3>
) : ( ) : (
t("install_desc", artifact, version) t('install_desc', artifact, version)
)} )}
</ConfirmModal> </ConfirmModal>
); );
+4 -4
View File
@@ -100,7 +100,7 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => {
plugin.description plugin.description
) : ( ) : (
<span> <span>
<i style={{ color: '#666' }}>{t("plugin_no_desc")}</i> <i style={{ color: '#666' }}>{t('plugin_no_desc')}</i>
</span> </span>
)} )}
</span> </span>
@@ -112,7 +112,7 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => {
color: '#fee75c', color: '#fee75c',
}} }}
> >
<i>{t("plugin_full_access")}</i>{' '} <i>{t('plugin_full_access')}</i>{' '}
<a <a
className="deckyStoreCardDescriptionRootLink" className="deckyStoreCardDescriptionRootLink"
href="https://deckbrew.xyz/root" href="https://deckbrew.xyz/root"
@@ -149,7 +149,7 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => {
layout="below" layout="below"
onClick={() => requestPluginInstall(plugin.name, plugin.versions[selectedOption])} onClick={() => requestPluginInstall(plugin.name, plugin.versions[selectedOption])}
> >
<span className="deckyStoreCardInstallText">{t("plugin_install")}</span> <span className="deckyStoreCardInstallText">{t('plugin_install')}</span>
</ButtonItem> </ButtonItem>
</div> </div>
<div <div
@@ -166,7 +166,7 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => {
label: version.name, label: version.name,
})) as SingleDropdownOption[] })) as SingleDropdownOption[]
} }
menuLabel={t("plugin_version_label") as string} menuLabel={t('plugin_version_label') as string}
selectedOption={selectedOption} selectedOption={selectedOption}
onChange={({ data }) => setSelectedOption(data)} onChange={({ data }) => setSelectedOption(data)}
/> />
+19 -17
View File
@@ -9,15 +9,15 @@ import {
findModule, findModule,
} from 'decky-frontend-lib'; } from 'decky-frontend-lib';
import { FC, useEffect, useMemo, useState } from 'react'; import { FC, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
const { t } = useTranslation('Store');
import logo from '../../../assets/plugin_store.png'; import logo from '../../../assets/plugin_store.png';
import Logger from '../../logger'; import Logger from '../../logger';
import { StorePlugin, getPluginList } from '../../store'; import { StorePlugin, getPluginList } from '../../store';
import PluginCard from './PluginCard'; import PluginCard from './PluginCard';
const { t } = useTranslation('Store');
const logger = new Logger('FilePicker'); const logger = new Logger('FilePicker');
const StorePage: FC<{}> = () => { const StorePage: FC<{}> = () => {
@@ -57,13 +57,13 @@ const StorePage: FC<{}> = () => {
}} }}
tabs={[ tabs={[
{ {
title: t("store_tabs_title"), title: t('store_tabs_title'),
content: <BrowseTab children={{ data: data }} />, content: <BrowseTab children={{ data: data }} />,
id: 'browse', id: 'browse',
renderTabAddon: () => <span className={TabCount}>{data.length}</span>, renderTabAddon: () => <span className={TabCount}>{data.length}</span>,
}, },
{ {
title: t("store_tabs_about"), title: t('store_tabs_about'),
content: <AboutTab />, content: <AboutTab />,
id: 'about', id: 'about',
}, },
@@ -78,8 +78,8 @@ const StorePage: FC<{}> = () => {
const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => { const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
const sortOptions = useMemo( const sortOptions = useMemo(
(): DropdownOption[] => [ (): DropdownOption[] => [
{ data: 1, label: t("store_tabs_alph_desc") }, { data: 1, label: t('store_tabs_alph_desc') },
{ data: 2, label: t("store_tabs_alph_asce") }, { data: 2, label: t('store_tabs_alph_asce') },
], ],
[], [],
); );
@@ -154,11 +154,11 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
maxWidth: '100%', maxWidth: '100%',
}} }}
> >
<span className="DialogLabel">{t("store_sort_label")}</span> <span className="DialogLabel">{t('store_sort_label')}</span>
<Dropdown <Dropdown
menuLabel={t("store_sort_label") as string} menuLabel={t('store_sort_label') as string}
rgOptions={sortOptions} rgOptions={sortOptions}
strDefaultLabel={t("store_sort_label_def") as string} strDefaultLabel={t('store_sort_label_def') as string}
selectedOption={selectedSort} selectedOption={selectedSort}
onChange={(e) => setSort(e.data)} onChange={(e) => setSort(e.data)}
/> />
@@ -168,7 +168,11 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
<div style={{ justifyContent: 'center', display: 'flex' }}> <div style={{ justifyContent: 'center', display: 'flex' }}>
<Focusable style={{ display: 'flex', alignItems: 'center', width: '96%' }}> <Focusable style={{ display: 'flex', alignItems: 'center', width: '96%' }}>
<div style={{ width: '100%' }}> <div style={{ width: '100%' }}>
<TextField label={t("store_search_label")} value={searchFieldValue} onChange={(e) => setSearchValue(e.target.value)} /> <TextField
label={t('store_search_label')}
value={searchFieldValue}
onChange={(e) => setSearchValue(e.target.value)}
/>
</div> </div>
</Focusable> </Focusable>
</div> </div>
@@ -219,7 +223,7 @@ const AboutTab: FC<{}> = () => {
/> />
<span className="deckyStoreAboutHeader">Testing</span> <span className="deckyStoreAboutHeader">Testing</span>
<span> <span>
{t("store_testing_cta")}{' '} {t('store_testing_cta')}{' '}
<a <a
href="https://deckbrew.xyz/testing" href="https://deckbrew.xyz/testing"
target="_blank" target="_blank"
@@ -230,12 +234,10 @@ const AboutTab: FC<{}> = () => {
deckbrew.xyz/testing deckbrew.xyz/testing
</a> </a>
</span> </span>
<span className="deckyStoreAboutHeader">{t("store_contrib_label")}</span> <span className="deckyStoreAboutHeader">{t('store_contrib_label')}</span>
<span> <span>{t('store_contrib_desc')}</span>
{t("store_contrib_desc")} <span className="deckyStoreAboutHeader">{t('store_source_label')}</span>
</span> <span>{t('store_source_desc')}</span>
<span className="deckyStoreAboutHeader">{t("store_source_label")}</span>
<span>{t("store_source_desc")}</span>
</div> </div>
); );
}; };