Skip to content
Snippets Groups Projects
Select Git revision
  • f94badc06f4ddaa08cb7ed0ff3462f29e3ff4698
  • master default protected
  • 69-resize-image-before-upload
  • 60-add-match-salamander-modal-to-edit-salamander
  • 50-fix-server-error-message
  • 48-fix-gradle
  • 31-camera-communicate-with-api-and-delete-from-cache-2
  • 20-changing-verification-step-in-profile-to-modal
  • 4-add-all-basic-views
  • 1-setup
10 results

CustomActivityIndicator.js

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    CustomActivityIndicator.js 1.24 KiB
    import React from 'react'
    import { StyleSheet, View, Modal, Text } from 'react-native'
    import { Colors, ActivityIndicator } from "react-native-paper";
    
    const CustomActivityIndicator = (props) => {
        return (
            <Modal transparent={true} animationType="none" visible={props.visible}>
                <View
                    style={{ ...styles.activityIndicator, ...props.style }}>
                    <ActivityIndicator 
                        style={styles.loading} 
                        animating={props.visible} 
                        color={Colors.white}
                        size='large'
                    />
                    <Text style={styles.text}>
                        {props.text}
                    </Text>
                </View>
            </Modal>
        )
    }
    
    export default CustomActivityIndicator
    
    const styles = StyleSheet.create({
        loading: {
            position: 'absolute',
            left: 0,
            right: 0,
            top: 0,
            bottom: 0,
            alignItems: 'center',
            justifyContent: 'center'
          }, 
        activityIndicator: {
            flex: 1,
            alignItems: "center",
            justifyContent: "center",
            backgroundColor: `rgba(0,0,0,${0.1})`
        }, 
        text: {
            alignContent: "center", 
            marginTop: 100,
            color: 'white'
        }
    })