template_0205
This commit is contained in:
39
RN_TEMPLATE/ignite/templates/component/NAME.tsx.ejs
Normal file
39
RN_TEMPLATE/ignite/templates/component/NAME.tsx.ejs
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
destinationDir: app/components/<%= props.subdirectory %>
|
||||
---
|
||||
import { StyleProp, TextStyle, View, ViewStyle } from "react-native"
|
||||
import { useAppTheme } from "@/theme/context"
|
||||
import type { ThemedStyle } from "@/theme/types"
|
||||
import { Text } from "@/components/Text"
|
||||
|
||||
export interface <%= props.pascalCaseName %>Props {
|
||||
/**
|
||||
* An optional style override useful for padding & margin.
|
||||
*/
|
||||
style?: StyleProp<ViewStyle>
|
||||
}
|
||||
|
||||
/**
|
||||
* Describe your component here
|
||||
*/
|
||||
export const <%= props.pascalCaseName %> = (props: <%= props.pascalCaseName %>Props) => {
|
||||
const { style } = props
|
||||
const $styles = [$container, style]
|
||||
const { themed } = useAppTheme();
|
||||
|
||||
return (
|
||||
<View style={$styles}>
|
||||
<Text style={themed($text)}>Hello</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
const $container: ViewStyle = {
|
||||
justifyContent: "center",
|
||||
}
|
||||
|
||||
const $text: ThemedStyle<TextStyle> = ({ colors, typography }) => ({
|
||||
fontFamily: typography.primary.normal,
|
||||
fontSize: 14,
|
||||
color: colors.palette.primary500,
|
||||
})
|
||||
Reference in New Issue
Block a user