diff options
| author | TrainDoctor <traindoctor@protonmail.com> | 2022-10-23 13:04:00 -0700 |
|---|---|---|
| committer | TrainDoctor <traindoctor@protonmail.com> | 2022-10-23 13:04:00 -0700 |
| commit | 4ad15568cd2802f9499bd3961c5fe24391745502 (patch) | |
| tree | c66db7a36e8ae219cfbe1b236d0168f28594e115 /frontend/src/components | |
| parent | 58849b30024d816f374e11c5489fd5adbcd9a22d (diff) | |
| download | decky-loader-4ad15568cd2802f9499bd3961c5fe24391745502.tar.gz decky-loader-4ad15568cd2802f9499bd3961c5fe24391745502.zip | |
Merge drop-legacy to main.
Diffstat (limited to 'frontend/src/components')
| -rw-r--r-- | frontend/src/components/store/PluginCard.tsx | 73 | ||||
| -rw-r--r-- | frontend/src/components/store/Store.tsx | 13 |
2 files changed, 15 insertions, 71 deletions
diff --git a/frontend/src/components/store/PluginCard.tsx b/frontend/src/components/store/PluginCard.tsx index 0155ff99..03f11b4a 100644 --- a/frontend/src/components/store/PluginCard.tsx +++ b/frontend/src/components/store/PluginCard.tsx @@ -11,17 +11,10 @@ import { } from 'decky-frontend-lib'; import { FC, useRef, useState } from 'react'; -import { - LegacyStorePlugin, - StorePlugin, - StorePluginVersion, - isLegacyPlugin, - requestLegacyPluginInstall, - requestPluginInstall, -} from '../../store'; +import { StorePlugin, StorePluginVersion, requestPluginInstall } from '../../store'; interface PluginCardProps { - plugin: StorePlugin | LegacyStorePlugin; + plugin: StorePlugin; } const PluginCard: FC<PluginCardProps> = ({ plugin }) => { @@ -63,22 +56,13 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => { }} > <div className="deckyStoreCardHeader" style={{ display: 'flex', alignItems: 'center' }}> - <a + <div style={{ fontSize: '18pt', padding: '10px' }} className={joinClassNames(staticClasses.Text)} // onClick={() => Router.NavigateToExternalWeb('https://github.com/' + plugin.artifact)} > - {isLegacyPlugin(plugin) ? ( - <div className="deckyStoreCardNameContainer"> - <span className="deckyStoreCardLegacyRepoOwner" style={{ color: 'grey' }}> - {plugin.artifact.split('/')[0]}/ - </span> - {plugin.artifact.split('/')[1]} - </div> - ) : ( - plugin.name - )} - </a> + {plugin.name} + </div> </div> <div style={{ @@ -94,17 +78,10 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => { width: 'auto', height: '160px', }} - src={ - isLegacyPlugin(plugin) - ? `https://cdn.tzatzikiweeb.moe/file/steam-deck-homebrew/artifact_images/${plugin.artifact.replace( - '/', - '_', - )}.png` - : `https://cdn.tzatzikiweeb.moe/file/steam-deck-homebrew/artifact_images/${plugin.name.replace( - '/', - '_', - )}.png` - } + src={`https://cdn.tzatzikiweeb.moe/file/steam-deck-homebrew/artifact_images/${plugin.name.replace( + '/', + '_', + )}.png`} /> <div style={{ @@ -152,19 +129,6 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => { {tag == 'root' ? 'Requires root' : tag} </span> ))} - {isLegacyPlugin(plugin) && ( - <span - className="deckyStoreCardTag deckyStoreCardLegacyTag" - style={{ - color: '#232120', - padding: '5px', - borderRadius: '5px', - background: '#EDE841', - }} - > - legacy - </span> - )} </p> </div> </div> @@ -194,11 +158,7 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => { <DialogButton className="deckyStoreCardInstallButton" ref={buttonRef} - onClick={() => - isLegacyPlugin(plugin) - ? requestLegacyPluginInstall(plugin, Object.keys(plugin.versions)[selectedOption]) - : requestPluginInstall(plugin.name, plugin.versions[selectedOption]) - } + onClick={() => requestPluginInstall(plugin.name, plugin.versions[selectedOption])} > Install </DialogButton> @@ -211,15 +171,10 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => { > <Dropdown rgOptions={ - (isLegacyPlugin(plugin) - ? Object.keys(plugin.versions).map((v, k) => ({ - data: k, - label: v, - })) - : plugin.versions.map((version: StorePluginVersion, index) => ({ - data: index, - label: version.name, - }))) as SingleDropdownOption[] + plugin.versions.map((version: StorePluginVersion, index) => ({ + data: index, + label: version.name, + })) as SingleDropdownOption[] } strDefaultLabel={'Select a version'} selectedOption={selectedOption} diff --git a/frontend/src/components/store/Store.tsx b/frontend/src/components/store/Store.tsx index cb6f34ad..2ffd8efb 100644 --- a/frontend/src/components/store/Store.tsx +++ b/frontend/src/components/store/Store.tsx @@ -2,14 +2,13 @@ import { SteamSpinner } from 'decky-frontend-lib'; import { FC, useEffect, useState } from 'react'; import Logger from '../../logger'; -import { LegacyStorePlugin, StorePlugin, getLegacyPluginList, getPluginList } from '../../store'; +import { StorePlugin, getPluginList } from '../../store'; import PluginCard from './PluginCard'; const logger = new Logger('FilePicker'); const StorePage: FC<{}> = () => { const [data, setData] = useState<StorePlugin[] | null>(null); - const [legacyData, setLegacyData] = useState<LegacyStorePlugin[] | null>(null); useEffect(() => { (async () => { @@ -17,11 +16,6 @@ const StorePage: FC<{}> = () => { logger.log('got data!', res); setData(res); })(); - (async () => { - const res = await getLegacyPluginList(); - logger.log('got legacy data!', res); - setLegacyData(res); - })(); }, []); return ( @@ -49,11 +43,6 @@ const StorePage: FC<{}> = () => { {data.map((plugin: StorePlugin) => ( <PluginCard plugin={plugin} /> ))} - {!legacyData ? ( - <SteamSpinner /> - ) : ( - legacyData.map((plugin: LegacyStorePlugin) => <PluginCard plugin={plugin} />) - )} </div> )} </div> |
