-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from OMGDuke/add-extras-section
Add a new extras section with some links
- Loading branch information
Showing
8 changed files
with
142 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
import { PanelSection } from '@decky/ui' | ||
import useTranslations from '../../hooks/useTranslations' | ||
import PanelSocialButton from '../settings/socialButton' | ||
import { SiCrowdin, SiDiscord, SiGithub, SiKofi } from 'react-icons/si' | ||
|
||
export default function AboutPage() { | ||
const t = useTranslations() | ||
return ( | ||
<div> | ||
<h1>{t('aboutLabel')}</h1> | ||
<p>{t('aboutDescription')}</p> | ||
<h2>{t('supportLabel')}</h2> | ||
<p>{t('supportDescription')}</p> | ||
<h2>{t('extras')}</h2> | ||
<PanelSection> | ||
<PanelSocialButton icon={<SiKofi fill="#FF5E5B" />} url="https://ko-fi.com/OMGDuke">Ko-fi</PanelSocialButton> | ||
<PanelSocialButton icon={<SiDiscord fill="#5865F2" />} url="https://deckbrew.xyz/discord">Discord</PanelSocialButton> | ||
<PanelSocialButton icon={<SiGithub fill="#f5f5f5" />} url="https://github.com/OMGDuke/SDH-GameThemeMusic/">Github</PanelSocialButton> | ||
<PanelSocialButton icon={<SiCrowdin fill="#FFFFFF" />} url="https://crowdin.com/project/sdh-gamethememusic">{t('helpTranslate')}</PanelSocialButton> | ||
</PanelSection> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { showModal, ModalRoot } from '@decky/ui'; | ||
import { QRCodeSVG } from 'qrcode.react'; | ||
|
||
const showQrModal = (url: string) => { | ||
showModal( | ||
<ModalRoot> | ||
<QRCodeSVG | ||
style={{ margin: '0 auto 1.5em auto' }} | ||
value={url} | ||
includeMargin | ||
size={256} | ||
/> | ||
<span style={{ textAlign: 'center', wordBreak: 'break-word' }}>{url}</span> | ||
</ModalRoot>, | ||
window | ||
); | ||
}; | ||
|
||
export default showQrModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { | ||
PanelSectionRow, | ||
DialogButton, | ||
Field, | ||
Focusable, | ||
Navigation, | ||
} from '@decky/ui'; | ||
import { FC, ReactNode } from 'react'; | ||
import { HiQrCode } from 'react-icons/hi2'; | ||
import useTranslations from '../../hooks/useTranslations' | ||
|
||
import showQrModal from './showQrModal'; | ||
|
||
|
||
const navLink = (url: string) => { | ||
Navigation.CloseSideMenus(); | ||
Navigation.NavigateToExternalWeb(url); | ||
}; | ||
|
||
const PanelSocialButton: FC<{ | ||
icon: ReactNode; | ||
url: string; | ||
children: string, | ||
}> = ({ icon, children, url }) => { | ||
const t = useTranslations() | ||
return ( | ||
<PanelSectionRow> | ||
<Field | ||
bottomSeparator="none" | ||
icon={null} | ||
label={null} | ||
childrenLayout={undefined} | ||
inlineWrap="keep-inline" | ||
padding="none" | ||
spacingBetweenLabelAndChild="none" | ||
childrenContainerWidth="max" | ||
> | ||
<Focusable style={{ display: 'flex' }}> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
fontSize: '1.5em', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
marginRight: '.5em', | ||
}} | ||
> | ||
{icon} | ||
</div> | ||
<DialogButton | ||
onClick={() => navLink(url)} | ||
onSecondaryButton={() => showQrModal(url)} | ||
onSecondaryActionDescription={t('showQrCode')} | ||
style={{ | ||
padding: '10px', | ||
fontSize: '14px', | ||
}} | ||
> | ||
{children} | ||
</DialogButton> | ||
<DialogButton | ||
onOKActionDescription={t('showQrCode')} | ||
onClick={() => showQrModal(url)} | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
padding: '10px', | ||
maxWidth: '40px', | ||
minWidth: 'auto', | ||
marginLeft: '.5em', | ||
}} | ||
> | ||
<HiQrCode /> | ||
</DialogButton> | ||
</Focusable> | ||
</Field> | ||
</PanelSectionRow> | ||
)}; | ||
|
||
export default PanelSocialButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters