mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
better/shared list player controls w/shuffle
also faked download list/song (by star for now, also faked)
This commit is contained in:
@@ -5,12 +5,15 @@ import { GestureResponderEvent, StyleSheet, Text } from 'react-native'
|
||||
import PressableOpacity from './PressableOpacity'
|
||||
|
||||
const Button: React.FC<{
|
||||
title: string
|
||||
title?: string
|
||||
buttonStyle?: 'hollow' | 'highlight'
|
||||
onPress: (event: GestureResponderEvent) => void
|
||||
}> = ({ title, onPress }) => {
|
||||
}> = ({ title, buttonStyle, onPress, children }) => {
|
||||
return (
|
||||
<PressableOpacity onPress={onPress} style={styles.container}>
|
||||
<Text style={styles.text}>{title}</Text>
|
||||
<PressableOpacity
|
||||
onPress={onPress}
|
||||
style={[styles.container, buttonStyle !== undefined ? styles[buttonStyle] : {}]}>
|
||||
{title ? <Text style={styles.text}>{title}</Text> : children}
|
||||
</PressableOpacity>
|
||||
)
|
||||
}
|
||||
@@ -18,16 +21,26 @@ const Button: React.FC<{
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
backgroundColor: colors.accent,
|
||||
paddingHorizontal: 24,
|
||||
paddingHorizontal: 10,
|
||||
minHeight: 42,
|
||||
justifyContent: 'center',
|
||||
borderRadius: 1000,
|
||||
},
|
||||
hollow: {
|
||||
backgroundColor: 'transparent',
|
||||
borderColor: colors.text.secondary,
|
||||
borderWidth: 1.5,
|
||||
},
|
||||
highlight: {
|
||||
borderColor: colors.text.primary,
|
||||
borderWidth: 1.5,
|
||||
},
|
||||
text: {
|
||||
fontSize: 15,
|
||||
fontSize: 16,
|
||||
fontFamily: font.bold,
|
||||
color: colors.text.primary,
|
||||
paddingHorizontal: 14,
|
||||
},
|
||||
})
|
||||
|
||||
export default React.memo(Button)
|
||||
export default Button
|
||||
|
||||
Reference in New Issue
Block a user