Skip to content

Instantly share code, notes, and snippets.

@justinecodez
Last active January 4, 2024 13:06
Show Gist options
  • Save justinecodez/42952552203877b9ff923abd92666859 to your computer and use it in GitHub Desktop.
Save justinecodez/42952552203877b9ff923abd92666859 to your computer and use it in GitHub Desktop.
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