fix(mobile): show download quality as a popup
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0d644869ea
commit
4bf9107b56
1 file changed
+14
-22
@@ -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 },
|
||||
|
||||
Reference in new issue
Block a user