Files
react-native-fast-image/ReactNativeFastImageExample/FastImage/BorderRadiusExample.js
T

61 lines
1.3 KiB
JavaScript
Raw Normal View History

import React from 'react'
import { StyleSheet, View } from 'react-native'
import withCacheBust from './withCacheBust'
import SectionFlex from './SectionFlex'
import FastImage from 'react-native-fast-image'
import Section from './Section'
import FeatureText from './FeatureText'
const IMAGE_URL = 'https://media.giphy.com/media/GEsoqZDGVoisw/giphy.gif'
2018-01-30 20:13:30 -05:00
const BorderRadiusExample = ({ onPressReload, bust }) => (
<View>
<Section>
2018-01-30 20:13:30 -05:00
<FeatureText text="• Border radius." />
</Section>
<SectionFlex onPress={onPressReload}>
<FastImage
2018-01-30 20:42:58 -05:00
style={styles.imageSquare}
source={{
uri: IMAGE_URL + bust,
}}
/>
<FastImage
style={styles.imageRectangular}
source={{
uri: IMAGE_URL + bust,
}}
2018-01-30 20:13:30 -05:00
/>
</SectionFlex>
</View>
)
const styles = StyleSheet.create({
2018-01-30 20:42:58 -05:00
imageSquare: {
2018-03-10 19:10:34 -05:00
borderRadius: 50,
height: 100,
backgroundColor: '#ddd',
margin: 20,
width: 100,
flex: 0,
},
2018-01-30 20:42:58 -05:00
imageRectangular: {
2018-03-10 19:10:34 -05:00
borderRadius: 50,
borderTopLeftRadius: 10,
borderBottomRightRadius: 10,
2018-01-30 20:42:58 -05:00
height: 100,
backgroundColor: '#ddd',
margin: 20,
flex: 1,
},
plus: {
width: 30,
height: 30,
position: 'absolute',
bottom: 0,
right: 0,
},
})
2018-01-30 20:13:30 -05:00
export default withCacheBust(BorderRadiusExample)