add file picker, add library file picker patch, bump lib, logger tweaks

This commit is contained in:
AAGaming
2022-09-09 16:25:52 -04:00
parent 9d980618a7
commit b5b041fdee
13 changed files with 758 additions and 47 deletions
+32
View File
@@ -0,0 +1,32 @@
import { SteamSpinner } from 'decky-frontend-lib';
import { FunctionComponent, ReactElement, ReactNode, Suspense } from 'react';
interface WithSuspenseProps {
children: ReactNode;
}
// Nice little wrapper around Suspense so we don't have to duplicate the styles and code for the loading spinner
const WithSuspense: FunctionComponent<WithSuspenseProps> = (props) => {
const propsCopy = { ...props };
delete propsCopy.children;
(props.children as ReactElement)?.props && Object.assign((props.children as ReactElement).props, propsCopy); // There is probably a better way to do this but valve does it this way so ¯\_(ツ)_/¯
return (
<Suspense
fallback={
<div
style={{
marginTop: '40px',
height: 'calc( 100% - 40px )',
overflowY: 'scroll',
}}
>
<SteamSpinner />
</div>
}
>
{props.children}
</Suspense>
);
};
export default WithSuspense;