chore(lib/components): move stylesheet and constants to internal file

This commit is contained in:
PalmDevs 2025-06-12 22:16:05 +07:00
parent 6b5c5a62c3
commit be2abcc555
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA
4 changed files with 30 additions and 17 deletions

View file

@ -20,6 +20,9 @@
},
"./types": {
"types": "./src/types.ts"
},
"./_": {
"default": "./src/_internal.ts"
}
}
}

View file

@ -1,5 +1,6 @@
import { FormSwitch as Switch } from '@revenge-mod/discord/design'
import { StyleSheet, View } from 'react-native'
import { View } from 'react-native'
import { styles } from './_internal'
import type { DiscordModules } from '@revenge-mod/discord/types'
/**
@ -14,9 +15,3 @@ export default function FormSwitch(
</View>
)
}
const styles = StyleSheet.create({
disabled: {
opacity: 0.5,
},
})

View file

@ -1,19 +1,15 @@
import { Design } from '@revenge-mod/discord/design'
import { StyleSheet } from 'react-native'
import { PageSpacing, styles } from './_internal'
import type { DiscordModules } from '@revenge-mod/discord/types'
export default function Page(props: DiscordModules.Components.StackProps) {
return (
<Design.Stack spacing={24} style={styles.page} {...props}>
<Design.Stack
spacing={PageSpacing}
style={[styles.grow, styles.pagePadding]}
{...props}
>
{props.children}
</Design.Stack>
)
}
const styles = StyleSheet.create({
page: {
flex: 1,
paddingHorizontal: 16,
paddingTop: 12,
},
})

View file

@ -0,0 +1,19 @@
import { StyleSheet } from 'react-native'
export const styles = StyleSheet.create({
disabled: {
opacity: 0.5,
},
flex: {
flex: 1,
},
grow: {
flexGrow: 1,
},
pagePadding: {
paddingHorizontal: 16,
paddingTop: 12,
},
})
export const PageSpacing = 24