Files
jellyfin-audio-player/src/screens/Player/components/NowPlaying.tsx

47 lines
1.2 KiB
TypeScript
Raw Normal View History

2020-06-16 17:51:51 +02:00
import React from 'react';
2020-07-26 14:45:32 +02:00
import { Text, Dimensions, View, StyleSheet } 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-07-26 14:45:32 +02:00
import { colors } from 'components/Colors';
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;
width: ${Screen.width * 0.8}px;
height: ${Screen.width * 0.8}px;
margin: 25px auto;
display: flex;
2020-07-26 14:45:32 +02:00
flex: 1;
2020-06-16 17:51:51 +02:00
`;
2020-07-26 14:45:32 +02:00
const styles = StyleSheet.create({
artist: {
...colors.text,
fontWeight: 'bold',
fontSize: 24,
marginBottom: 12,
},
title: {
...colors.text,
fontSize: 18,
marginBottom: 12,
textAlign: 'center',
paddingLeft: 20,
paddingRight: 20,
}
});
2020-06-16 17:51:51 +02:00
export default function NowPlaying() {
const track = useCurrentTrack();
return (
<View style={{ alignItems: 'center' }}>
2020-07-26 14:45:32 +02:00
<Artwork style={colors.imageBackground} source={{ uri: track?.artwork }} />
<Text style={styles.artist} >{track?.artist}</Text>
<Text style={styles.title}>{track?.title}</Text>
2020-06-16 17:51:51 +02:00
</View>
);
}