fix(mobile): show download quality as a popup #122

Merged
joshuafhiggins merged 1 commits from t3/popup-screen into main 2026-11-19 19:58:07 -05:00
+14 -22
View File
@@ -198,7 +198,8 @@ function optionDetail(option: SizedDownloadOption, songCount: number) {
return `${included} of ${songCount} songs, ${option.fallbackCount} in High`
}
function DownloadQualitySheet({
/** Centered popup asking which quality to download a target at. */
function DownloadQualityPopup({
pending,
onClose,
onPick,
@@ -214,7 +215,7 @@ function DownloadQualitySheet({
return (
<Modal
visible={pending !== null}
animationType="slide"
animationType="fade"
transparent
onRequestClose={onClose}
>
@@ -222,14 +223,11 @@ function DownloadQualitySheet({
<Pressable style={styles.overlay} onPress={onClose}>
<Pressable
style={[
styles.sheet,
styles.popup,
{ backgroundColor: colors.card, borderColor: colors.border },
]}
onPress={(event) => event.stopPropagation()}
>
<View
style={[styles.grabber, { backgroundColor: colors.border }]}
/>
<Text style={[styles.title, { color: colors.foreground }]}>
Download Quality
</Text>
@@ -433,7 +431,7 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
<DownloadsContext.Provider value={value}>
{children}
{queue ? <DownloadSync queue={queue} /> : null}
<DownloadQualitySheet
<DownloadQualityPopup
pending={pending}
onClose={() => setPending(null)}
onPick={handlePick}
@@ -445,23 +443,17 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
const styles = StyleSheet.create({
overlay: {
flex: 1,
backgroundColor: "rgba(0,0,0,0.45)",
justifyContent: "flex-end",
backgroundColor: "rgba(0,0,0,0.6)",
justifyContent: "center",
alignItems: "center",
padding: 24,
},
sheet: {
borderTopLeftRadius: 16,
borderTopRightRadius: 16,
popup: {
width: "100%",
maxWidth: 420,
borderRadius: 16,
borderWidth: 1,
paddingHorizontal: 16,
paddingTop: 8,
paddingBottom: 24,
},
grabber: {
width: 36,
height: 4,
borderRadius: 2,
alignSelf: "center",
marginBottom: 12,
padding: 16,
},
title: { fontSize: 18, fontWeight: "700" },
subtitle: { fontSize: 13, marginBottom: 4 },