From 9619c52720c97ef74842b15aa732dd0a8d6fb26a Mon Sep 17 00:00:00 2001 From: AAGaming Date: Wed, 22 Jun 2022 23:22:27 -0400 Subject: add settings page with install from URL option --- frontend/src/plugin-loader.tsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'frontend/src/plugin-loader.tsx') diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx index 9b1020c7..cad59c2f 100644 --- a/frontend/src/plugin-loader.tsx +++ b/frontend/src/plugin-loader.tsx @@ -1,9 +1,10 @@ -import { ModalRoot, showModal, staticClasses } from 'decky-frontend-lib'; +import { ModalRoot, QuickAccessTab, showModal, staticClasses } from 'decky-frontend-lib'; import { FaPlug } from 'react-icons/fa'; import { DeckyState, DeckyStateContextProvider } from './components/DeckyState'; import LegacyPlugin from './components/LegacyPlugin'; import PluginView from './components/PluginView'; +import SettingsPage from './components/settings'; import StorePage from './components/store/Store'; import TitleView from './components/TitleView'; import Logger from './logger'; @@ -31,14 +32,11 @@ class PluginLoader extends Logger { this.log('Initialized'); this.tabsHook.add({ - id: 'main', - title: ( - - - - ), + id: QuickAccessTab.Decky, + title: null, content: ( + ), @@ -46,22 +44,23 @@ class PluginLoader extends Logger { }); this.routerHook.addRoute('/decky/store', () => ); + this.routerHook.addRoute('/decky/settings', () => ); } - public addPluginInstallPrompt(artifact: string, version: string, request_id: string) { + public addPluginInstallPrompt(artifact: string, version: string, request_id: string, hash: string) { showModal( { - console.log('ok'); this.callServerMethod('confirm_plugin_install', { request_id }); }} onCancel={() => { - console.log('nope'); this.callServerMethod('cancel_plugin_install', { request_id }); }} > -
- Install {artifact} version {version}? +
+ {hash == 'False' ?

!!!!NO HASH PROVIDED!!!!

: null} + Install {artifact} + {version ? ' version ' + version : null}?
, ); @@ -76,6 +75,7 @@ class PluginLoader extends Logger { public deinit() { this.routerHook.removeRoute('/decky/store'); + this.routerHook.removeRoute('/decky/settings'); } public async importPlugin(name: string) { -- cgit v1.2.3