-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.tsx
More file actions
63 lines (56 loc) · 1.25 KB
/
Copy pathindex.tsx
File metadata and controls
63 lines (56 loc) · 1.25 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
import React from 'react';
import {ScrollView, StyleSheet} from 'react-native';
import {Container, Image, ImageSizes} from '@fast-base/native';
const IMAGE = 'https://www.stockvault.net/data/2011/05/31/124348/thumb16.jpg';
const Sizes: (keyof typeof ImageSizes)[] = [
'xs',
'sm',
'md',
'lg',
'xl',
'2xl',
];
const isCompression = true;
const ImagesCompression: React.FC = () => {
return (
<React.Fragment>
{Sizes.map(size => {
return (
<Image
key={size}
size={size}
radius={size}
skeletonLoading
source={{uri: IMAGE}}
/>
);
})}
<Image skeletonLoading radius="full" source={{uri: IMAGE}} />
</React.Fragment>
);
};
const ImageExample: React.FC = () => {
return (
<Container py={10}>
<ScrollView
style={styles.container}
contentContainerStyle={styles.content}>
{isCompression ? (
<ImagesCompression />
) : (
<Image size="sm" radius="full" source={{uri: IMAGE}} />
)}
</ScrollView>
</Container>
);
};
export default ImageExample;
const styles = StyleSheet.create({
container: {
flex: 1,
},
content: {
gap: 30,
alignItems: 'center',
},
});