diff options
| author | AAGaming <aa@mail.catvibers.me> | 2022-06-22 23:22:27 -0400 |
|---|---|---|
| committer | AAGaming <aa@mail.catvibers.me> | 2022-06-22 23:22:27 -0400 |
| commit | 9619c52720c97ef74842b15aa732dd0a8d6fb26a (patch) | |
| tree | ceb46763b919ef8b5f7ac2c0cc0522ad9b6c95b9 /frontend/src/components/TitleView.tsx | |
| parent | 80b223180e9a5f86bb6f6a42fb4660862872f7ab (diff) | |
| download | decky-loader-9619c52720c97ef74842b15aa732dd0a8d6fb26a.tar.gz decky-loader-9619c52720c97ef74842b15aa732dd0a8d6fb26a.zip | |
add settings page with install from URL option
Diffstat (limited to 'frontend/src/components/TitleView.tsx')
| -rw-r--r-- | frontend/src/components/TitleView.tsx | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/frontend/src/components/TitleView.tsx b/frontend/src/components/TitleView.tsx index 4b4a6825..babcd316 100644 --- a/frontend/src/components/TitleView.tsx +++ b/frontend/src/components/TitleView.tsx @@ -1,18 +1,59 @@ -import { staticClasses } from 'decky-frontend-lib'; -import { VFC } from 'react'; +import { DialogButton, Focusable, Router, staticClasses } from 'decky-frontend-lib'; +import { CSSProperties, VFC } from 'react'; +import { FaArrowLeft, FaCog, FaStore } from 'react-icons/fa'; import { useDeckyState } from './DeckyState'; +const titleStyles: CSSProperties = { + display: 'flex', + paddingTop: '3px', + paddingBottom: '14px', + paddingRight: '16px', + boxShadow: 'unset', +}; + const TitleView: VFC = () => { - const { activePlugin } = useDeckyState(); + const { activePlugin, closeActivePlugin } = useDeckyState(); + + const onSettingsClick = () => { + Router.CloseSideMenus(); + Router.Navigate('/decky/settings'); + }; + + const onStoreClick = () => { + Router.CloseSideMenus(); + Router.Navigate('/decky/store'); + }; if (activePlugin === null) { - return <div className={staticClasses.Title}>Decky</div>; + return ( + <Focusable style={titleStyles} className={staticClasses.Title}> + <DialogButton + style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }} + onClick={onSettingsClick} + > + <FaCog style={{ marginTop: '-4px', display: 'block' }} /> + </DialogButton> + <div style={{ marginRight: 'auto', flex: 0.9 }}>Decky</div> + <DialogButton + style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }} + onClick={onStoreClick} + > + <FaStore style={{ marginTop: '-4px', display: 'block' }} /> + </DialogButton> + </Focusable> + ); } return ( - <div className={staticClasses.Title} style={{ paddingLeft: '60px' }}> - {activePlugin.name} + <div className={staticClasses.Title} style={titleStyles}> + <DialogButton + style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }} + onClick={closeActivePlugin} + > + <FaArrowLeft style={{ marginTop: '-4px', display: 'block' }} /> + </DialogButton> + <div style={{ flex: 0.9 }}>{activePlugin.name}</div> </div> ); }; |
