mirror of
https://github.com/status-im/react-native-fast-image.git
synced 2026-09-01 14:21:06 +00:00
chore: Convert example to TypeScript (#648)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import React from 'react'
|
||||
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'
|
||||
|
||||
interface ButtonProps {
|
||||
text: string
|
||||
onPress: () => void
|
||||
}
|
||||
|
||||
const Button = ({ text, onPress }: ButtonProps) => (
|
||||
<TouchableOpacity onPress={onPress}>
|
||||
<View style={styles.button}>
|
||||
<Text style={styles.text}>{text}</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
)
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
button: {
|
||||
backgroundColor: 'black',
|
||||
margin: 10,
|
||||
height: 44,
|
||||
paddingLeft: 10,
|
||||
paddingRight: 10,
|
||||
borderRadius: 10,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
text: {
|
||||
color: 'white',
|
||||
},
|
||||
})
|
||||
|
||||
export default Button
|
||||
Reference in New Issue
Block a user