mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
added nothing here message for empty lists
This commit is contained in:
33
app/components/NothingHere.tsx
Normal file
33
app/components/NothingHere.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import font from '@app/styles/font'
|
||||
import React from 'react'
|
||||
import { Text, View, StyleSheet } from 'react-native'
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
|
||||
|
||||
const NothingHere = React.memo<{
|
||||
height?: number
|
||||
width?: number
|
||||
}>(({ height, width }) => {
|
||||
height = height || 200
|
||||
width = width || 200
|
||||
|
||||
return (
|
||||
<View style={[styles.container, { height, width }]}>
|
||||
<Icon name="music-note-outline" color={styles.text.color} size={width / 2} />
|
||||
<Text style={[styles.text, { fontSize: width / 8 }]}>Nothing here...</Text>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
opacity: 0.25,
|
||||
},
|
||||
text: {
|
||||
fontFamily: font.lightItalic,
|
||||
color: 'white',
|
||||
},
|
||||
})
|
||||
|
||||
export default NothingHere
|
||||
@@ -6,7 +6,6 @@ import { useAtomValue } from 'jotai/utils'
|
||||
import React from 'react'
|
||||
import { GestureResponderEvent, StyleSheet, Text, View } from 'react-native'
|
||||
import IconFA from 'react-native-vector-icons/FontAwesome'
|
||||
import IconMat from 'react-native-vector-icons/MaterialIcons'
|
||||
import CoverArt from './CoverArt'
|
||||
import PressableOpacity from './PressableOpacity'
|
||||
|
||||
@@ -33,10 +32,7 @@ const SongItem: React.FC<{
|
||||
</PressableOpacity>
|
||||
<View style={styles.controls}>
|
||||
<PressableOpacity onPress={undefined}>
|
||||
<IconFA name="star-o" size={26} color={colors.text.primary} />
|
||||
</PressableOpacity>
|
||||
<PressableOpacity onPress={undefined} style={styles.more}>
|
||||
<IconMat name="more-vert" size={32} color="white" />
|
||||
<IconFA name="star-o" size={26} color={colors.text.secondary} />
|
||||
</PressableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
@@ -76,7 +72,7 @@ const styles = StyleSheet.create({
|
||||
controls: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginLeft: 10,
|
||||
marginLeft: 16,
|
||||
},
|
||||
more: {
|
||||
marginLeft: 8,
|
||||
|
||||
Reference in New Issue
Block a user