forked from axilis/react-native-responsive-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2-hidden-elements.js
42 lines (38 loc) · 1022 Bytes
/
2-hidden-elements.js
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
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Grid, Section, Block } from 'react-native-responsive-layout';
const styles = StyleSheet.create({
element: {
height: 100,
justifyContent: 'center',
},
text: {
textAlign: 'center',
color: '#02326b',
fontSize: 40,
},
textLight: {
color: 'white',
},
});
export default () => (
<Grid>
<Section>
<Block>
<View style={[styles.element, { backgroundColor: '#c3defe' }]}>
<Text style={styles.text}>always visible</Text>
</View>
</Block>
<Block smHidden>
<View style={[styles.element, { backgroundColor: '#4e9dfc' }]}>
<Text style={styles.text}>small phone</Text>
</View>
</Block>
<Block xsHidden smVisible>
<View style={[styles.element, { backgroundColor: '#02326b' }]}>
<Text style={[styles.text, styles.textLight]}>large phone</Text>
</View>
</Block>
</Section>
</Grid>
);