Last active
December 29, 2023 21:15
-
-
Save coolsoftwaretyler/5b9c4bf15cdbcc4c5b132a4082b0f767 to your computer and use it in GitHub Desktop.
Revisions
-
coolsoftwaretyler revised this gist
Dec 29, 2023 . No changes.There are no files selected for viewing
-
coolsoftwaretyler revised this gist
Dec 29, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export interface TextProps extends RNTextProps { color?: string; } export function BrandText(props: TextProps) { const { text, preset = 'body', -
coolsoftwaretyler revised this gist
Dec 26, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ const styles = StyleSheet.create({ fontWeight: 'normal', lineHeight: 24, }, defaultColor: { color: '#000000' }, }); type PresetNames = 'header' | 'subheader' | 'body'; -
coolsoftwaretyler created this gist
Dec 26, 2023 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,55 @@ import React from 'react'; import { StyleSheet, Text as RNText, TextProps as RNTextProps, TextStyle, } from 'react-native'; const styles = StyleSheet.create({ header: { fontSize: 32, fontWeight: 'bold', lineHeight: 40, textTransform: 'uppercase', }, subheader: { fontSize: 24, fontWeight: '600', lineHeight: 30, }, body: { fontSize: 16, fontWeight: 'normal', lineHeight: 24, }, defaultColor: { color: '#000000' }, // Assuming richBlack color for default text color }); type PresetNames = 'header' | 'subheader' | 'body'; export interface TextProps extends RNTextProps { text?: string; preset?: PresetNames; color?: string; } export function Text(props: TextProps) { const { text, preset = 'body', color = styles.defaultColor.color, style, ...rest } = props; const presetStyle = styles[preset] || styles.body; const colorStyle = { color }; const combinedStyles = [presetStyle, colorStyle, style]; return ( <RNText {...rest} style={combinedStyles}> {text} </RNText> ); }