chore(lib/components): move stylesheet and constants to internal file
This commit is contained in:
parent
6b5c5a62c3
commit
be2abcc555
4 changed files with 30 additions and 17 deletions
|
|
@ -20,6 +20,9 @@
|
|||
},
|
||||
"./types": {
|
||||
"types": "./src/types.ts"
|
||||
},
|
||||
"./_": {
|
||||
"default": "./src/_internal.ts"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
})
|
||||
|
|
|
|||
19
lib/components/src/_internal.ts
Normal file
19
lib/components/src/_internal.ts
Normal 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
|
||||
Loading…
Add table
Reference in a new issue