mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 18:51:59 +00:00
Add testing store info to browse tab (#504)
This commit is contained in:
@@ -220,7 +220,11 @@
|
|||||||
"alph_desc": "Alphabetical (A to Z)",
|
"alph_desc": "Alphabetical (A to Z)",
|
||||||
"title": "Browse"
|
"title": "Browse"
|
||||||
},
|
},
|
||||||
"store_testing_cta": "Please consider testing new plugins to help the Decky Loader team!"
|
"store_testing_cta": "Please consider testing new plugins to help the Decky Loader team!",
|
||||||
|
"store_testing_warning": {
|
||||||
|
"desc": "You can use this store channel to test bleeding-edge plugin versions. Be sure to leave feedback on GitHub so the plugin can be updated for all users.",
|
||||||
|
"label": "Welcome to the Testing Store Channel"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"StoreSelect": {
|
"StoreSelect": {
|
||||||
"custom_store": {
|
"custom_store": {
|
||||||
@@ -234,7 +238,7 @@
|
|||||||
"testing": "Testing"
|
"testing": "Testing"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"TitleView":{
|
"TitleView": {
|
||||||
"decky_store_desc": "Open Decky Store",
|
"decky_store_desc": "Open Decky Store",
|
||||||
"settings_desc": "Open Decky Settings"
|
"settings_desc": "Open Decky Settings"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
|
|
||||||
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 { Store, StorePlugin, getPluginList, getStore } from '../../store';
|
||||||
import PluginCard from './PluginCard';
|
import PluginCard from './PluginCard';
|
||||||
|
|
||||||
const logger = new Logger('Store');
|
const logger = new Logger('Store');
|
||||||
@@ -21,6 +21,7 @@ const logger = new Logger('Store');
|
|||||||
const StorePage: FC<{}> = () => {
|
const StorePage: FC<{}> = () => {
|
||||||
const [currentTabRoute, setCurrentTabRoute] = useState<string>('browse');
|
const [currentTabRoute, setCurrentTabRoute] = useState<string>('browse');
|
||||||
const [data, setData] = useState<StorePlugin[] | null>(null);
|
const [data, setData] = useState<StorePlugin[] | null>(null);
|
||||||
|
const [isTesting, setIsTesting] = useState<boolean>(false);
|
||||||
const { TabCount } = findModule((m) => {
|
const { TabCount } = findModule((m) => {
|
||||||
if (m?.TabCount && m?.TabTitle) return true;
|
if (m?.TabCount && m?.TabTitle) return true;
|
||||||
return false;
|
return false;
|
||||||
@@ -33,6 +34,9 @@ const StorePage: FC<{}> = () => {
|
|||||||
const res = await getPluginList();
|
const res = await getPluginList();
|
||||||
logger.log('got data!', res);
|
logger.log('got data!', res);
|
||||||
setData(res);
|
setData(res);
|
||||||
|
const storeRes = await getStore();
|
||||||
|
logger.log(`store is ${storeRes}, isTesting is ${storeRes === Store.Testing}`);
|
||||||
|
setIsTesting(storeRes === Store.Testing);
|
||||||
})();
|
})();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -58,7 +62,7 @@ const StorePage: FC<{}> = () => {
|
|||||||
tabs={[
|
tabs={[
|
||||||
{
|
{
|
||||||
title: t('Store.store_tabs.title'),
|
title: t('Store.store_tabs.title'),
|
||||||
content: <BrowseTab children={{ data: data }} />,
|
content: <BrowseTab children={{ data: data, isTesting: isTesting }} />,
|
||||||
id: 'browse',
|
id: 'browse',
|
||||||
renderTabAddon: () => <span className={TabCount}>{data.length}</span>,
|
renderTabAddon: () => <span className={TabCount}>{data.length}</span>,
|
||||||
},
|
},
|
||||||
@@ -75,7 +79,7 @@ const StorePage: FC<{}> = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
|
const BrowseTab: FC<{ children: { data: StorePlugin[]; isTesting: boolean } }> = (data) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const sortOptions = useMemo(
|
const sortOptions = useMemo(
|
||||||
@@ -178,6 +182,36 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
|
|||||||
</div>
|
</div>
|
||||||
</Focusable>
|
</Focusable>
|
||||||
</div>
|
</div>
|
||||||
|
{data.children.isTesting && (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
alignItems: 'center',
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
marginLeft: '20px',
|
||||||
|
marginRight: '20px',
|
||||||
|
marginBottom: '20px',
|
||||||
|
padding: '8px 36px',
|
||||||
|
background: 'rgba(255, 255, 0, 0.067)',
|
||||||
|
textAlign: 'center',
|
||||||
|
border: '2px solid rgba(255, 255, 0, 0.467)',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<h2 style={{ margin: 0 }}>{t('Store.store_testing_warning.label')}</h2>
|
||||||
|
<span>
|
||||||
|
{`${t('Store.store_testing_warning.desc')} `}
|
||||||
|
<a
|
||||||
|
href="https://decky.xyz/testing"
|
||||||
|
target="_blank"
|
||||||
|
style={{
|
||||||
|
textDecoration: 'none',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
decky.xyz/testing
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div>
|
<div>
|
||||||
{data.children.data
|
{data.children.data
|
||||||
.filter((plugin: StorePlugin) => {
|
.filter((plugin: StorePlugin) => {
|
||||||
@@ -229,13 +263,13 @@ const AboutTab: FC<{}> = () => {
|
|||||||
<span>
|
<span>
|
||||||
{t('Store.store_testing_cta')}{' '}
|
{t('Store.store_testing_cta')}{' '}
|
||||||
<a
|
<a
|
||||||
href="https://deckbrew.xyz/testing"
|
href="https://decky.xyz/testing"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
style={{
|
style={{
|
||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
deckbrew.xyz/testing
|
decky.xyz/testing
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<span className="deckyStoreAboutHeader">{t('Store.store_contrib.label')}</span>
|
<span className="deckyStoreAboutHeader">{t('Store.store_contrib.label')}</span>
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ export interface PluginInstallRequest {
|
|||||||
// name: version
|
// name: version
|
||||||
export type PluginUpdateMapping = Map<string, StorePluginVersion>;
|
export type PluginUpdateMapping = Map<string, StorePluginVersion>;
|
||||||
|
|
||||||
|
export async function getStore(): Promise<Store> {
|
||||||
|
return await getSetting<Store>('store', Store.Default);
|
||||||
|
}
|
||||||
|
|
||||||
export async function getPluginList(): Promise<StorePlugin[]> {
|
export async function getPluginList(): Promise<StorePlugin[]> {
|
||||||
let version = await window.DeckyPluginLoader.updateVersion();
|
let version = await window.DeckyPluginLoader.updateVersion();
|
||||||
let store = await getSetting<Store>('store', Store.Default);
|
let store = await getSetting<Store>('store', Store.Default);
|
||||||
|
|||||||
Reference in New Issue
Block a user