forked from calebnance/expo-spotify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlaylistItem.js
More file actions
40 lines (36 loc) · 951 Bytes
/
PlaylistItem.js
File metadata and controls
40 lines (36 loc) · 951 Bytes
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
import React from 'react';
import { StyleSheet, Text, TouchableOpacity } from 'react-native';
import PropTypes from 'prop-types';
import { colors, fonts, gStyle } from '../api';
const PlaylistItem = ({ bgColor, onPress, title }) => (
<TouchableOpacity
activeOpacity={gStyle.activeOpacity}
onPress={onPress}
style={[styles.playlistItem, { backgroundColor: bgColor }]}
>
<Text style={styles.playlistTitle}>{title}</Text>
</TouchableOpacity>
);
PlaylistItem.propTypes = {
// required
bgColor: PropTypes.string.isRequired,
onPress: PropTypes.func.isRequired,
title: PropTypes.string.isRequired
};
const styles = StyleSheet.create({
playlistItem: {
borderRadius: 6,
height: 98,
flex: 1,
marginBottom: 24,
marginRight: 24,
paddingLeft: 12,
paddingTop: 12
},
playlistTitle: {
color: colors.white,
fontFamily: fonts.spotifyBold,
fontSize: 22
}
});
export default PlaylistItem;