From b7d7ca04e12690b5e65259c8806e5e895cdc16aa Mon Sep 17 00:00:00 2001 From: botato <63275405+botatooo@users.noreply.github.com> Date: Sat, 27 Aug 2022 00:01:23 -0400 Subject: Refractor plugin backend (#111) * refractor uninstall plugin backend * refractor plugin installation method * Change formatting in browser.py * Manually format main.py * Manually format utilities.py * remove inconsistency * remove unnecessary linebreaks * lol what * last minute pythoning * Fix async missing * lint * more refractor * await forgotten * fix: menu not disappearing after first click * lint * bug: fix double click on uninstall * depricate request installs * basic patch notes viewer, lazy-load settings and store, build frontend as esmodule, add lazy-loaded react-markdown, backend changes to accomodate ESModule frontend * refractor uninstall plugin backend * Change formatting in browser.py * Manually format main.py * Manually format utilities.py * remove unnecessary linebreaks * lol what * last minute pythoning * Fix async missing * rebase onto main * fix error, fix React crash if patch notes are opened before remote version info is loaded Co-authored-by: TrainDoctor Co-authored-by: AAGaming --- .../components/settings/pages/general/Updater.tsx | 64 ++++++++++------------ 1 file changed, 28 insertions(+), 36 deletions(-) (limited to 'frontend/src/components/settings/pages/general/Updater.tsx') diff --git a/frontend/src/components/settings/pages/general/Updater.tsx b/frontend/src/components/settings/pages/general/Updater.tsx index cb58b24c..9635162c 100644 --- a/frontend/src/components/settings/pages/general/Updater.tsx +++ b/frontend/src/components/settings/pages/general/Updater.tsx @@ -17,46 +17,38 @@ function PatchNotesModal({ versionInfo, closeModal }: { versionInfo: VerInfo | n return ( { - console.log(args, versionInfo); - return ( - {}} - style={{ - marginTop: '40px', - height: 'calc( 100% - 40px )', - overflowY: 'scroll', - display: 'flex', - justifyContent: 'center', - margin: '40px', - }} - > -
-

{versionInfo?.all?.[id]?.name}

- {versionInfo?.all?.[id]?.body ? ( - }> - {versionInfo.all[id].body} - - ) : ( - 'no patch notes for this version' - )} -
-
- ); - }} - fnGetId={(id) => { - return id; - }} + fnItemRenderer={(id: number) => ( + {}} + style={{ + marginTop: '40px', + height: 'calc( 100% - 40px )', + overflowY: 'scroll', + display: 'flex', + justifyContent: 'center', + margin: '40px', + }} + > +
+

{versionInfo?.all?.[id]?.name}

+ {versionInfo?.all?.[id]?.body ? ( + }> + {versionInfo.all[id].body} + + ) : ( + 'no patch notes for this version' + )} +
+
+ )} + fnGetId={(id) => id} nNumItems={versionInfo?.all?.length} nHeight={window.innerHeight - 150} nItemHeight={window.innerHeight - 200} nItemMarginX={0} initialColumn={0} autoFocus={true} - fnGetColumnWidth={(...args: any[]) => { - console.log('cw', args); - return window.innerWidth; - }} + fnGetColumnWidth={() => window.innerWidth} />
); @@ -98,8 +90,8 @@ export default function UpdaterSettings() { return ( <>