-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesr.js
More file actions
139 lines (122 loc) · 3.99 KB
/
tesr.js
File metadata and controls
139 lines (122 loc) · 3.99 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import React, {useState} from 'react';
import Header from '../../header';
import {SafeAreaView} from 'react-native-safe-area-context';
import {View, Text, Image, ScrollView, TouchableOpacity} from 'react-native';
import {NativeBaseProvider} from 'native-base';
import {colors, icons, images} from '../../constants';
import {Dimensions, StyleSheet} from 'react-native';
const {width} = Dimensions.get('window');
const scale = width / 420;
import {Fab} from 'native-base';
import Menu from './menu';
const colorss = ['tomato', 'thistle', 'skyblue', 'teal'];
export default function Presse() {
const [isBoolean, setBoolean] = useState(false);
const [items, setItems] = useState(Menu);
const filterItem = categoryItem => {
const updatedItems = Menu.filter(curElem => {
return curElem.category === categoryItem;
});
setItems(updatedItems);
};
return (
<SafeAreaView style={{flex: 1, backgroundColor: colors.Quaternary}}>
<View style={{flex: 1, height:400, backgroundColor: colors.Quaternary,}}>
<Header title="Presse" />
<ScrollView >
<View
style={{
width: '100%',
backgroundColor: colors.tertiary,
borderRadius: 70 * scale,
position: 'fixed',
}}>
<NativeBaseProvider>
<View
style={{
backgroundColor: colors.Quaternary,
height: 50 * scale,
marginHorizontal: 50 * scale,
borderRadius: 20 * scale,
marginTop: 40 * scale,
marginBottom: 0 * scale,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
padding: 15 * scale,
fontWeight: 'bold',
}}>
<TouchableOpacity onPress={() => setItems(Menu)}>
<Text
style={{
fontWeight: 'bold',
color: colors.white,
}}>
Tout
</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => filterItem('podcast')}>
<Text
style={{
fontWeight: 'bold',
color: colors.white,
}}>
Podcast
</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => filterItem('videos')}>
<Text
style={{
fontWeight: 'bold',
color: colors.white,
}}>
Videos
</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => filterItem('photos')}>
<Text
style={{
fontWeight: 'bold',
color: colors.white,
}}>
Photos
</Text>
</TouchableOpacity>
</View>
<View>
{items === 'photos' ? (
<View>
<Text>This is an image</Text>
<Image
source={images.sila}
style={{ width: 100, height: 100 }} // Add appropriate styles
resizeMode="cover" // Optional: specify how the image should be resized
/>
</View>
) : null}
{(items=='videos') ? (
<View style={{height:200}}>
<Text>this is video</Text>
<Image source={images.sila} />
</View>
) : null}
{/* {items('podcast') ? (
<View>
<Text>this is podcast</Text>
<Image source={images.sila} />
</View>
) : null}
{items(Menu) ? (
<View>
<Text>this is tout</Text>
<Image source={images.sila} />
</View>
) : null} */}
</View>
</NativeBaseProvider>
</View>
</ScrollView>
</View>
</SafeAreaView>
);
}