forked from calebnance/expo-spotify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrary.js
More file actions
51 lines (43 loc) · 1.32 KB
/
Library.js
File metadata and controls
51 lines (43 loc) · 1.32 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
import React from 'react';
import { FlatList, ScrollView, StyleSheet, View } from 'react-native';
import PropTypes from 'prop-types';
import { device, gStyle } from '../api';
// components
import LineItemCategory from '../components/LineItemCategory';
import ScreenHeader from '../components/ScreenHeader';
// mock data
import yourLibrary from '../mockdata/menuYourLibrary';
const Library = ({ navigation }) => (
<React.Fragment>
<View style={{ position: 'absolute', top: 0, width: '100%', zIndex: 10 }}>
<ScreenHeader navigation={navigation} title="You Library" />
</View>
<ScrollView showsVerticalScrollIndicator={false} style={gStyle.container}>
<FlatList
contentContainerStyle={styles.containerFlatlist}
data={yourLibrary}
keyExtractor={itemObj => itemObj.id.toString()}
renderItem={itemObj => {
const { item } = itemObj;
return (
<LineItemCategory
icon={item.icon}
onPress={() => null}
title={item.title}
/>
);
}}
/>
</ScrollView>
</React.Fragment>
);
Library.propTypes = {
// required
navigation: PropTypes.object.isRequired
};
const styles = StyleSheet.create({
containerFlatlist: {
marginTop: device.iPhoneX ? 88 : 64
}
});
export default Library;