-
Notifications
You must be signed in to change notification settings - Fork 106
/
Copy pathSpotifyContentListItem.tsx
39 lines (36 loc) · 1.19 KB
/
SpotifyContentListItem.tsx
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
import React from "react";
import { ListItem, Left, View, Text, Body, Right } from "native-base";
import { ContentItem } from "react-native-spotify-remote";
const SpotifyContentListItem: React.SFC<{ onPress?: (item: ContentItem) => void, onLongPress?: (item: ContentItem) => void, item: ContentItem }> = ({
item,
onPress,
onLongPress
}) => {
const {
title,
subtitle,
id,
playable,
uri,
container,
availableOffline,
children: itemChildren = []
} = item;
return (
<ListItem onPress={() => onPress && onPress(item)} onLongPress={() => onLongPress && onLongPress(item)}>
<Left>
<View style={{ display: 'flex', flexDirection: 'column', alignItems: "flex-start", justifyContent: 'space-between', maxWidth: 150 }}>
<Text>{title}</Text>
<Text style={{ width: "100%", marginTop: 5, fontSize: 12, color: "gray" }}>{subtitle}</Text>
</View>
</Left>
<Body>
<Text>{availableOffline && "Offline"}</Text>
</Body>
<Right>
<Text>{itemChildren.length}</Text>
</Right>
</ListItem>
)
}
export default SpotifyContentListItem;