MCPcopy Create free account
hub / github.com/stripe/stripe-react-native / Button

Function Button

example/src/components/Button.tsx:21–57  ·  view source on GitHub ↗
({
  title,
  variant = 'default',
  disabled,
  loading,
  center,
  onPress,
  ...props
}: Props)

Source from the content-addressed store, hash-verified

19};
20
21export default function Button({
22 title,
23 variant = 'default',
24 disabled,
25 loading,
26 center,
27 onPress,
28 ...props
29}: Props) {
30 const titleElement = React.isValidElement(title) ? (
31 title
32 ) : (
33 <Text style={[styles.text, variant === 'primary' && styles.textPrimary]}>
34 {title}
35 </Text>
36 );
37 return (
38 <View style={disabled && styles.disabled}>
39 <TouchableOpacity
40 disabled={disabled}
41 style={[
42 styles.container,
43 variant === 'primary' && styles.primaryContainer,
44 center && styles.centered,
45 ]}
46 onPress={onPress}
47 {...props}
48 >
49 {loading ? (
50 <ActivityIndicator color={colors.white} size="small" />
51 ) : (
52 titleElement
53 )}
54 </TouchableOpacity>
55 </View>
56 );
57}
58
59const styles = StyleSheet.create({
60 container: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…