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.

Revisions

  1. justinecodez revised this gist Jan 4, 2024. No changes.
  2. justinecodez renamed this gist Jan 4, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. justinecodez created this gist Jan 4, 2024.
    30 changes: 30 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    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