mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 06:52:43 +01:00
remove all inline styles
This commit is contained in:
@@ -7,7 +7,7 @@ import colors from '@app/styles/colors'
|
||||
import font from '@app/styles/font'
|
||||
import { useNavigation } from '@react-navigation/native'
|
||||
import React, { useCallback } from 'react'
|
||||
import { ActivityIndicator, Pressable, StyleSheet, Text, View } from 'react-native'
|
||||
import { ActivityIndicator, Pressable, StyleSheet, Text, View, ViewStyle } from 'react-native'
|
||||
import { State } from 'react-native-track-player'
|
||||
import IconFA5 from 'react-native-vector-icons/FontAwesome5'
|
||||
|
||||
@@ -80,10 +80,10 @@ const NowPlayingBar = React.memo(() => {
|
||||
const navigation = useNavigation()
|
||||
const track = useStore(selectTrackPlayer.currentTrack)
|
||||
|
||||
const displayStyle: ViewStyle = { display: track ? 'flex' : 'none' }
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
onPress={() => navigation.navigate('now-playing')}
|
||||
style={{ ...styles.container, display: track ? 'flex' : 'none' }}>
|
||||
<Pressable onPress={() => navigation.navigate('now-playing')} style={[styles.container, displayStyle]}>
|
||||
<ProgressBar />
|
||||
<View style={styles.subContainer}>
|
||||
<CoverArt
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
import { GestureResponderEvent, LayoutRectangle, Pressable, PressableProps, ViewStyle } from 'react-native'
|
||||
import { GestureResponderEvent, LayoutRectangle, Pressable, PressableProps, ViewStyle, StyleSheet } from 'react-native'
|
||||
|
||||
type PressableOpacityProps = PressableProps & {
|
||||
ripple?: boolean
|
||||
@@ -55,7 +55,7 @@ const PressableOpacity: React.FC<PressableOpacityProps> = props => {
|
||||
return (
|
||||
<Pressable
|
||||
{...props}
|
||||
style={[{ justifyContent: 'center', alignItems: 'center' }, props.style as any, { opacity }, disabledStyle]}
|
||||
style={[styles.pressable, props.style as any, { opacity }, disabledStyle]}
|
||||
android_ripple={
|
||||
props.ripple
|
||||
? {
|
||||
@@ -74,4 +74,11 @@ const PressableOpacity: React.FC<PressableOpacityProps> = props => {
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
pressable: {
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
})
|
||||
|
||||
export default React.memo(PressableOpacity)
|
||||
|
||||
Reference in New Issue
Block a user