• 🌙 Community Spirit

    Ramadan Mubarak! To honor this month, Crax has paused NSFW categories. Wishing you peace and growth!

Button Component in React Native expo component #4 (1 Viewer)

Currently reading:
 Button Component in React Native expo component #4 (1 Viewer)

Recently searched:

tempcp001

Member
LV
2
Joined
Jan 7, 2024
Threads
12
Likes
0
Awards
4
Credits
1,669©
Cash
0$
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'
import React from 'react'
import { ActivityIndicator } from 'react-native'
import { Colors } from '../constants/colors'
export default function SubmitButton({
title,
onPress,
loading
}) {
return (
<TouchableOpacity onPress={onPress}>
{
loading ?
<View style={styles.loginButton}>
<ActivityIndicator size={'small'} color='#fff' />
</View>
:
<Text style={styles.loginButton}>{title}</Text>
}
</TouchableOpacity>
)
}
const styles = StyleSheet.create({
loginButton: {
color: '#fff',
textAlign: 'center',
borderRadius: 5,
borderWidth: 1,
borderColor: Colors.primary,
padding: 10,
marginTop: 20,
backgroundColor: Colors.primary,
overflow: 'hidden',
},
})
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Tips
Recently searched:

Similar threads

Users who are viewing this thread

Top Bottom