Last active
January 4, 2024 13:06
-
-
Save justinecodez/42952552203877b9ff923abd92666859 to your computer and use it in GitHub Desktop.
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 characters
import React from 'react' | |
import { | |
ActivityIndicator, | |
} from 'react-native' | |
const CustomButton = ({ | |
}) => { | |
const [loading, setIsLoading] = useState(false) | |
loading ? return ( | |
<View style={styles.loadingOverlay}> | |
<ActivityIndicator size="large" color={colors.white} /> | |
</View> | |
</TouchableOpacity> | |
): return (<View><Text>Finished laoding </Text></View>) | |
} | |
const styles = StyleSheet.create<Styles>({ | |
loadingOverlay: { | |
...StyleSheet.absoluteFillObject, | |
backgroundColor: 'rgba(0, 0, 0, 0.5)', // Semi-transparent overlay | |
justifyContent: 'center', | |
alignItems: 'center', | |
borderRadius: 8, // Match your button's borderRadius | |
}, | |
}) | |
export default CustomButton |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment