Skip to content

Commit

Permalink
fix(plugins/settings): match Discord's page styles better
Browse files Browse the repository at this point in the history
  • Loading branch information
PalmDevs committed Dec 4, 2024
1 parent 73abe1a commit b6637bd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions src/plugins/settings/pages/(Wrapper).tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,28 @@ const styles = StyleSheet.create({
},
paddedContainer: {
paddingHorizontal: 16,
paddingTop: 16,
paddingTop: 24,
},
paddedContainerTopControls: {
paddingTop: 12,
paddingHorizontal: 16,
},
})

// Hacky way to allow dismissing input fields when tapping outside of them
// But also not allowing the ScrollView to scroll
export default function PageWrapper(props: { children: ReactNode }) {
export default function PageWrapper(props: { children: ReactNode; withTopControls?: boolean }) {
return (
<View style={styles.growable}>
<ScrollView keyboardShouldPersistTaps="handled" contentContainerStyle={styles.resizable}>
<Stack style={[styles.paddedContainer, styles.resizable]} spacing={16} direction="vertical">
<Stack
style={[
props.withTopControls ? styles.paddedContainerTopControls : styles.paddedContainer,
styles.resizable,
]}
spacing={28}
direction="vertical"
>
{props.children}
</Stack>
</ScrollView>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/settings/pages/Plugins.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export default function PluginsSettingsPage() {
const pluginListNoResults = pluginListEmpty && query

return (
<PageWrapper>
<PageWrapper withTopControls>
<PluginSettingsPageContext.Provider
value={{ setQuery, showCorePlugins, sortMode, ContextMenuComponent: MemoizedContextMenu }}
>
Expand Down

0 comments on commit b6637bd

Please sign in to comment.