Fix center
This commit is contained in:
4 files changed
+107
-41
No files matched your search
@@ -119,7 +119,7 @@ export default function AlbumScreen() {
|
||||
<Pressable
|
||||
onPress={() => void toggleAlbumFavorite(album.id)}
|
||||
hitSlop={8}
|
||||
style={[styles.iconAction, { backgroundColor: colors.muted }]}
|
||||
style={[styles.iconAction, styles.leftAction, { backgroundColor: colors.muted }]}
|
||||
>
|
||||
<Ionicons
|
||||
name={isAlbumFavorite(album.id) ? "star" : "star-outline"}
|
||||
@@ -133,13 +133,15 @@ export default function AlbumScreen() {
|
||||
onPress={() => void playAlbum(album.id)}
|
||||
style={styles.playButton}
|
||||
/>
|
||||
<Button
|
||||
title="Shuffle"
|
||||
icon="shuffle"
|
||||
variant="secondary"
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Shuffle"
|
||||
hitSlop={8}
|
||||
onPress={() => void playAlbumShuffled(album.id)}
|
||||
style={styles.sideActionButton}
|
||||
/>
|
||||
style={[styles.iconAction, styles.rightAction, { backgroundColor: colors.muted }]}
|
||||
>
|
||||
<Ionicons name="shuffle" size={22} color={colors.foreground} />
|
||||
</Pressable>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -203,18 +205,22 @@ const styles = StyleSheet.create({
|
||||
actions: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
gap: spacing.sm,
|
||||
justifyContent: "center",
|
||||
alignSelf: "stretch",
|
||||
minHeight: 44,
|
||||
marginTop: spacing.sm,
|
||||
},
|
||||
playButton: { borderRadius: 999, minWidth: 160 },
|
||||
sideActionButton: { borderRadius: 999 },
|
||||
iconAction: {
|
||||
position: "absolute",
|
||||
width: 44,
|
||||
height: 44,
|
||||
borderRadius: 22,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
},
|
||||
leftAction: { left: 0 },
|
||||
rightAction: { right: 0 },
|
||||
trackRow: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
|
||||
@@ -95,7 +95,7 @@ export default function ArtistScreen() {
|
||||
<Pressable
|
||||
onPress={() => void toggleArtistFavorite(data.artist.id)}
|
||||
hitSlop={8}
|
||||
style={[styles.iconAction, { backgroundColor: colors.muted }]}
|
||||
style={[styles.iconAction, styles.leftAction, { backgroundColor: colors.muted }]}
|
||||
>
|
||||
<Ionicons
|
||||
name={isArtistFavorite(data.artist.id) ? "star" : "star-outline"}
|
||||
@@ -109,13 +109,15 @@ export default function ArtistScreen() {
|
||||
onPress={() => void playArtist(data.artist.id)}
|
||||
style={styles.playButton}
|
||||
/>
|
||||
<Button
|
||||
title="Shuffle"
|
||||
icon="shuffle"
|
||||
variant="secondary"
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Shuffle"
|
||||
hitSlop={8}
|
||||
onPress={() => void playArtistShuffled(data.artist.id)}
|
||||
style={styles.sideActionButton}
|
||||
/>
|
||||
style={[styles.iconAction, styles.rightAction, { backgroundColor: colors.muted }]}
|
||||
>
|
||||
<Ionicons name="shuffle" size={22} color={colors.foreground} />
|
||||
</Pressable>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -136,16 +138,25 @@ const styles = StyleSheet.create({
|
||||
borderRadius: 90,
|
||||
},
|
||||
title: { fontSize: 28, fontWeight: "800", textAlign: "center" },
|
||||
actions: { flexDirection: "row", alignItems: "center", gap: spacing.sm, marginTop: spacing.sm },
|
||||
actions: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
alignSelf: "stretch",
|
||||
minHeight: 44,
|
||||
marginTop: spacing.sm,
|
||||
},
|
||||
playButton: { borderRadius: 999, minWidth: 160 },
|
||||
sideActionButton: { borderRadius: 999 },
|
||||
iconAction: {
|
||||
position: "absolute",
|
||||
width: 44,
|
||||
height: 44,
|
||||
borderRadius: 22,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
},
|
||||
leftAction: { left: 0 },
|
||||
rightAction: { right: 0 },
|
||||
section: { padding: spacing.lg, gap: spacing.md },
|
||||
sectionTitle: { fontSize: 20, fontWeight: "700" },
|
||||
})
|
||||
@@ -161,13 +161,32 @@ export default function PlaylistScreen() {
|
||||
<Text style={{ color: colors.mutedForeground }}>{playlist.owner.name}</Text>
|
||||
<View style={styles.actions}>
|
||||
{!playlist.isOwner && playlist.id ? (
|
||||
<Button
|
||||
title={playlist.isSubscribed ? "Subscribed" : "Subscribe"}
|
||||
icon={playlist.isSubscribed ? "checkmark" : "add"}
|
||||
variant={playlist.isSubscribed ? "secondary" : "primary"}
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={playlist.isSubscribed ? "Subscribed" : "Subscribe"}
|
||||
accessibilityState={{ selected: playlist.isSubscribed }}
|
||||
hitSlop={8}
|
||||
onPress={() => void handleSubscribeToggle()}
|
||||
style={styles.sideActionButton}
|
||||
/>
|
||||
style={[
|
||||
styles.iconAction,
|
||||
styles.leftAction,
|
||||
{
|
||||
backgroundColor: playlist.isSubscribed
|
||||
? colors.muted
|
||||
: colors.primary,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Ionicons
|
||||
name={playlist.isSubscribed ? "checkmark" : "add"}
|
||||
size={24}
|
||||
color={
|
||||
playlist.isSubscribed
|
||||
? colors.foreground
|
||||
: colors.primaryForeground
|
||||
}
|
||||
/>
|
||||
</Pressable>
|
||||
) : null}
|
||||
<Button
|
||||
title="Play"
|
||||
@@ -175,13 +194,15 @@ export default function PlaylistScreen() {
|
||||
onPress={() => playlist.id && void playPlaylist(playlist.id)}
|
||||
style={styles.playButton}
|
||||
/>
|
||||
<Button
|
||||
title="Shuffle"
|
||||
icon="shuffle"
|
||||
variant="secondary"
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Shuffle"
|
||||
hitSlop={8}
|
||||
onPress={() => playlist.id && void playPlaylistShuffled(playlist.id)}
|
||||
style={styles.sideActionButton}
|
||||
/>
|
||||
style={[styles.iconAction, styles.rightAction, { backgroundColor: colors.muted }]}
|
||||
>
|
||||
<Ionicons name="shuffle" size={22} color={colors.foreground} />
|
||||
</Pressable>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -236,9 +257,20 @@ const styles = StyleSheet.create({
|
||||
actions: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
gap: spacing.sm,
|
||||
justifyContent: "center",
|
||||
alignSelf: "stretch",
|
||||
minHeight: 44,
|
||||
marginTop: spacing.sm,
|
||||
},
|
||||
playButton: { borderRadius: 999, minWidth: 160 },
|
||||
sideActionButton: { borderRadius: 999 },
|
||||
iconAction: {
|
||||
position: "absolute",
|
||||
width: 44,
|
||||
height: 44,
|
||||
borderRadius: 22,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
},
|
||||
leftAction: { left: 0 },
|
||||
rightAction: { right: 0 },
|
||||
})
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useQuery } from "convex/react"
|
||||
import { ScrollView, StyleSheet, Text, View } from "react-native"
|
||||
import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native"
|
||||
|
||||
import { Button, LoadingView } from "@/components/ui/primitives"
|
||||
import { contentBottomInset, SongRow } from "@/components/player"
|
||||
@@ -96,13 +96,15 @@ export default function FavoritesScreen() {
|
||||
onPress={() => void playInOrder(songIds)}
|
||||
style={styles.playButton}
|
||||
/>
|
||||
<Button
|
||||
title="Shuffle"
|
||||
icon="shuffle"
|
||||
variant="secondary"
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Shuffle"
|
||||
hitSlop={8}
|
||||
onPress={() => void playShuffled(songIds)}
|
||||
style={styles.sideActionButton}
|
||||
/>
|
||||
style={[styles.iconAction, styles.rightAction, { backgroundColor: colors.muted }]}
|
||||
>
|
||||
<Ionicons name="shuffle" size={22} color={colors.foreground} />
|
||||
</Pressable>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -141,7 +143,22 @@ const styles = StyleSheet.create({
|
||||
borderRadius: radius.lg,
|
||||
},
|
||||
title: { fontSize: 24, fontWeight: "800" },
|
||||
actions: { flexDirection: "row", gap: spacing.sm, marginTop: spacing.sm },
|
||||
actions: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
alignSelf: "stretch",
|
||||
minHeight: 44,
|
||||
marginTop: spacing.sm,
|
||||
},
|
||||
playButton: { borderRadius: 999, minWidth: 160 },
|
||||
sideActionButton: { borderRadius: 999 },
|
||||
iconAction: {
|
||||
position: "absolute",
|
||||
width: 44,
|
||||
height: 44,
|
||||
borderRadius: 22,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
},
|
||||
rightAction: { right: 0 },
|
||||
})
|
||||
Reference in new issue
Block a user