forked from necolas/react-native-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSource.js
More file actions
70 lines (68 loc) · 2.09 KB
/
Source.js
File metadata and controls
70 lines (68 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import sources from '../sources';
import React from 'react';
import { Image, StyleSheet, Text, View } from 'react-native';
export default function Source() {
return (
<React.Fragment>
<View style={styles.row}>
<View style={styles.column}>
<Text style={styles.text}>Static image</Text>
<Image source={sources.static} style={styles.image} />
</View>
<View style={styles.column}>
<Text style={styles.text}>Progressive JPEG</Text>
<Image source={sources.pjpeg} style={styles.image} />
</View>
<View style={styles.column}>
<Text style={styles.text}>Animated GIF</Text>
<Image source={sources.animatedGif} style={styles.image} />
</View>
</View>
<View style={styles.row}>
<View style={styles.column}>
<Text style={styles.text}>PNG (base64)</Text>
<Image source={sources.dataBase64Png} style={styles.image} />
</View>
<View style={styles.column}>
<Text style={styles.text}>SVG (base64)</Text>
<Image source={sources.dataBase64Svg} style={styles.image} />
</View>
<View style={styles.column}>
<Text style={styles.text}>SVG (inline data)</Text>
<Image source={sources.dataSvg} style={styles.image} />
</View>
</View>
<View style={styles.row}>
<View style={styles.column}>
<Text style={styles.text}>WebP</Text>
<Image source={sources.webP} style={styles.image} />
</View>
<View style={styles.column}>
<Text style={styles.text}>Dynamic (POST)</Text>
<Image source={sources.dynamic} style={styles.image} />
</View>
</View>
</React.Fragment>
);
}
const styles = StyleSheet.create({
row: {
flexDirection: 'row',
flexWrap: 'wrap',
justifyContent: 'space-between'
},
column: {
alignItems: 'flex-start',
marginBottom: '1rem'
},
text: {
marginBottom: '0.5rem'
},
image: {
borderColor: 'black',
borderWidth: 0.5,
height: 120,
width: 120,
resizeMode: 'cover'
}
});