This file contains 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 characters
import { GlobalStyles } from 'react-native-use-styles'; | |
GlobalStyles({ | |
constants: { | |
white: '#ffffff', | |
black: '#000000', | |
grey: '#adadad' | |
}, | |
container: { | |
flex: 1, |
This file contains 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 characters
import { Styles } from 'react-native-use-styles'; | |
export default Styles({ | |
computed: { | |
disabled: ([isDisabled]) => ({ color: isDisabled ? '$grey' : '$black' }) | |
}, | |
content: '.container pd:horizontal:10', | |
contentText: { fontSize: 16 } | |
}); |
This file contains 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 characters
import { useState } from 'react'; | |
import useStyles from './styles'; | |
const Component = () => { | |
const [isDisabled, setDisabled] = useState(false); | |
const s = useStyles([isDisabled]); | |
return ( | |
<View style={s`.content`}> | |
<Text style={s`.contentText &disabled`}>Hello World!</Text> |
This file contains 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 characters
import { useState } from 'react'; | |
import { GREY_COLOR, BLACK_COLOR, WHITE_COLOR } from './globalStyles'; | |
import { styles } from './styles'; | |
const Component = () => { | |
const [isDisabled, setDisabled] = useState(true); | |
return ( | |
<View style={styles.content}> | |
<Text style={[ |
This file contains 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 characters
import { GREY_COLOR } from './globalStyles'; | |
import { styles } from './styles'; | |
const Component = () => { | |
return ( | |
<View style={styles.content}> | |
<Text style={{ color: GREY_COLOR }}>Hello World!</Text> | |
</View> | |
); | |
}; |
This file contains 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 characters
import { globalStyles, GREEN_COLOR } from './globalStyles'; | |
import Stylesheet from 'react-native'; | |
export const styles = Stylesheet.create({ | |
content: { | |
...globalStyles.container, | |
backgroundColor: GREEN_COLOR | |
} | |
}); |
This file contains 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 characters
export const RED_COLOR = '#ff0000'; | |
export const GREEN_COLOR = '#00ff00'; | |
export const BLUE_COLOR = '#0000ff'; | |
export const globalStyles = { | |
container: { | |
flex: 1, | |
flexDirection: row, | |
backgroundColor: RED_COLOR | |
} |
This file contains 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 characters
import { BLUE_COLOR } from './globalStyles'; | |
import { styles } from './styles'; | |
export default () => { | |
return ( | |
<View style={styles.local}> | |
<Text style={{ color: BLUE_COLOR }}>Hello World!</Text> | |
</View> | |
); | |
}; |