subtracks/app/components/NothingHere.tsx
austinried 52e95dc959 don't use i18n namespaces
there's no need to keep reloading different parts of the object we already cached
2022-04-16 18:06:06 +09:00

40 lines
1.0 KiB
TypeScript

import font from '@app/styles/font'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { Text, View, StyleSheet, ViewStyle } from 'react-native'
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
import { withSuspenseMemo } from './withSuspense'
const NothingHere = withSuspenseMemo<{
height?: number
width?: number
style?: ViewStyle
}>(({ height, width, style }) => {
const { t } = useTranslation()
height = height || 200
width = width || 200
return (
<View style={[styles.container, { height, width }, style]}>
<Icon name="music-rest-quarter" color={styles.text.color} size={width / 2} />
<Text style={[styles.text, { fontSize: width / 8 }]} numberOfLines={3}>
{t('messages.nothingHere')}
</Text>
</View>
)
})
const styles = StyleSheet.create({
container: {
justifyContent: 'center',
alignItems: 'center',
opacity: 0.25,
},
text: {
fontFamily: font.lightItalic,
color: 'white',
},
})
export default NothingHere