Last active
October 27, 2020 16:15
-
-
Save agustito37/d89db60561fbe5073e340f3b6c6c35b4 to your computer and use it in GitHub Desktop.
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={[ | |
styles.contentText, | |
{ color: isDisabled ? GREY_COLOR : BLACK_COLOR } | |
]}> | |
Hello World! | |
</Text> | |
<Button | |
style={[ | |
styles.button, | |
{ backgroundColor: WHITE_COLOR, color: BLACK_COLOR } | |
]} | |
onCLick={() => setDisabled(current => !current)} | |
title="Toggle Disable" | |
/> | |
</View> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment