-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improve profile modal styling
- Loading branch information
1 parent
821e508
commit 5e5b147
Showing
3 changed files
with
77 additions
and
24 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
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,43 @@ | ||
import { GamepadButton } from 'decky-frontend-lib'; | ||
import { FC, Fragment } from 'react'; | ||
import { ModalPosition, Panel, ScrollPanelGroup } from '../docs/Scrollable'; | ||
|
||
export interface ScrollableWindowProps { | ||
height: string; | ||
fadePercent: number; | ||
} | ||
export const ScrollableWindow: FC<ScrollableWindowProps> = ({ height, fadePercent, children }) => { | ||
return ( | ||
<> | ||
<style> | ||
{`.modal-position-container .gamepaddialog_ModalPosition_30VHl { | ||
top: 0; | ||
bottom: 0; | ||
padding: 0; | ||
}`} | ||
</style> | ||
<div | ||
className='modal-position-container' | ||
style={{ | ||
position: 'relative', | ||
height: height, | ||
WebkitMaskImage: `linear-gradient(to bottom, transparent, black ${fadePercent}%, black ${100 - fadePercent}%, transparent 100%)` | ||
}}> | ||
<ModalPosition> | ||
|
||
<ScrollPanelGroup focusable={false} style={{ flex: 1, minHeight: 0 }}> | ||
<Panel | ||
focusable={true} | ||
noFocusRing={true} | ||
actionDescriptionMap={{ | ||
[GamepadButton.DIR_UP]: 'Scroll Up', | ||
[GamepadButton.DIR_DOWN]: 'Scroll Down' | ||
}}> | ||
{children} | ||
</Panel> | ||
</ScrollPanelGroup> | ||
</ModalPosition> | ||
</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