2020-06-16 17:51:51 +02:00
|
|
|
import React from 'react';
|
2020-06-20 22:49:51 +02:00
|
|
|
import { Text, Dimensions, View } from 'react-native';
|
2020-06-21 10:30:41 +02:00
|
|
|
import useCurrentTrack from 'utility/useCurrentTrack';
|
2020-06-16 17:51:51 +02:00
|
|
|
import styled from 'styled-components/native';
|
2020-06-20 22:49:51 +02:00
|
|
|
import FastImage from 'react-native-fast-image';
|
2020-06-16 17:51:51 +02:00
|
|
|
|
|
|
|
|
const Screen = Dimensions.get('screen');
|
|
|
|
|
|
2020-06-20 22:49:51 +02:00
|
|
|
const Artwork = styled(FastImage)`
|
2020-06-16 17:51:51 +02:00
|
|
|
border-radius: 10px;
|
|
|
|
|
background-color: #fbfbfb;
|
|
|
|
|
width: ${Screen.width * 0.8}px;
|
|
|
|
|
height: ${Screen.width * 0.8}px;
|
|
|
|
|
margin: 25px auto;
|
|
|
|
|
display: flex;
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default function NowPlaying() {
|
|
|
|
|
const track = useCurrentTrack();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<View style={{ alignItems: 'center' }}>
|
2020-06-16 21:41:02 +02:00
|
|
|
<Artwork style={{ flex: 1 }} source={{ uri: track?.artwork }} />
|
|
|
|
|
<Text style={{ fontWeight: 'bold', fontSize: 24, marginBottom: 12 }} >{track?.artist}</Text>
|
|
|
|
|
<Text style={{ fontSize: 18, marginBottom: 12, textAlign: 'center', paddingLeft: 20, paddingRight: 20 }}>{track?.title}</Text>
|
2020-06-16 17:51:51 +02:00
|
|
|
</View>
|
|
|
|
|
);
|
|
|
|
|
}
|