PressableScale
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
|||||||
} from "react-native-responsive-dimensions";
|
} from "react-native-responsive-dimensions";
|
||||||
import { useGlobal } from "reactn";
|
import { useGlobal } from "reactn";
|
||||||
import { background, icons } from "../../assets";
|
import { background, icons } from "../../assets";
|
||||||
|
import PressableScale from "../../components/PressableScale";
|
||||||
import Slider from "../../components/Slider";
|
import Slider from "../../components/Slider";
|
||||||
import {
|
import {
|
||||||
arrayRemove,
|
arrayRemove,
|
||||||
@@ -356,7 +357,7 @@ const MusicDetails = ({ route }) => {
|
|||||||
<Text style={styles.name}>{artist}</Text>
|
<Text style={styles.name}>{artist}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ ...Style.containerRow, gap: 12 }}>
|
<View style={{ ...Style.containerRow, gap: 12 }}>
|
||||||
<Pressable
|
<PressableScale
|
||||||
onPress={async () => {
|
onPress={async () => {
|
||||||
if (!projectId || !currentUID) return;
|
if (!projectId || !currentUID) return;
|
||||||
const next = !fav;
|
const next = !fav;
|
||||||
@@ -377,7 +378,7 @@ const MusicDetails = ({ route }) => {
|
|||||||
style={{ ...size({ size: 24 }) }}
|
style={{ ...size({ size: 24 }) }}
|
||||||
resizeMode="contain"
|
resizeMode="contain"
|
||||||
/>
|
/>
|
||||||
</Pressable>
|
</PressableScale>
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={() =>
|
onPress={() =>
|
||||||
SheetManager.show("Playlist", { payload: { projectId } })
|
SheetManager.show("Playlist", { payload: { projectId } })
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
} from "react-native-responsive-dimensions";
|
} from "react-native-responsive-dimensions";
|
||||||
import { useGlobal } from "reactn";
|
import { useGlobal } from "reactn";
|
||||||
import { background, icons } from "../../assets";
|
import { background, icons } from "../../assets";
|
||||||
|
import PressableScale from "../../components/PressableScale";
|
||||||
import Slider from "../../components/Slider";
|
import Slider from "../../components/Slider";
|
||||||
import {
|
import {
|
||||||
arrayRemove,
|
arrayRemove,
|
||||||
@@ -545,7 +546,7 @@ const MusicDetails = ({ route }) => {
|
|||||||
/>
|
/>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
{/* Play / Pause */}
|
{/* Play / Pause */}
|
||||||
<Pressable
|
<PressableScale
|
||||||
style={{
|
style={{
|
||||||
...size({ size: 40 }),
|
...size({ size: 40 }),
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
@@ -558,9 +559,9 @@ const MusicDetails = ({ route }) => {
|
|||||||
source={isPlaying ? icons.pause : icons.play}
|
source={isPlaying ? icons.pause : icons.play}
|
||||||
style={size({ size: 34 })}
|
style={size({ size: 34 })}
|
||||||
/>
|
/>
|
||||||
</Pressable>
|
</PressableScale>
|
||||||
{/* Next (forward 10s) */}
|
{/* Next (forward 10s) */}
|
||||||
<Pressable onPress={() => seekBy(10)}>
|
<PressableScale onPress={() => seekBy(10)}>
|
||||||
<RNImage
|
<RNImage
|
||||||
source={icons.forward}
|
source={icons.forward}
|
||||||
style={{
|
style={{
|
||||||
@@ -568,7 +569,7 @@ const MusicDetails = ({ route }) => {
|
|||||||
transform: [{ rotate: "180deg" }],
|
transform: [{ rotate: "180deg" }],
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Pressable>
|
</PressableScale>
|
||||||
</View>
|
</View>
|
||||||
<Slider
|
<Slider
|
||||||
value={fmt(positionMs)}
|
value={fmt(positionMs)}
|
||||||
|
|||||||
@@ -1,21 +1,22 @@
|
|||||||
import { BlurView } from "expo-blur";
|
import { BlurView } from "expo-blur";
|
||||||
|
import { Image as ExpoImage } from "expo-image";
|
||||||
import React, { useEffect, useRef, useState } from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import {
|
import {
|
||||||
|
Dimensions,
|
||||||
Pressable,
|
Pressable,
|
||||||
|
Image as RNImage,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
Text,
|
Text,
|
||||||
View,
|
View,
|
||||||
Image as RNImage,
|
|
||||||
Dimensions,
|
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { Image as ExpoImage } from "expo-image";
|
import { responsiveWidth } from "react-native-responsive-dimensions";
|
||||||
import { useGlobal } from "reactn";
|
import { useGlobal } from "reactn";
|
||||||
import { icons, img } from "../../../assets";
|
import { icons, img } from "../../../assets";
|
||||||
|
import PressableScale from "../../../components/PressableScale";
|
||||||
import { arrayRemove, arrayUnion, projectsRef } from "../../../config/firebase";
|
import { arrayRemove, arrayUnion, projectsRef } from "../../../config/firebase";
|
||||||
import { Palette, Style } from "../../../styles";
|
import { Palette, Style } from "../../../styles";
|
||||||
import { FONT_FAMILY } from "../../../styles/Fonts";
|
import { FONT_FAMILY } from "../../../styles/Fonts";
|
||||||
import { size } from "../../../styles/Style";
|
import { size } from "../../../styles/Style";
|
||||||
import { responsiveWidth } from "react-native-responsive-dimensions";
|
|
||||||
|
|
||||||
const MusicCard = ({
|
const MusicCard = ({
|
||||||
onPress,
|
onPress,
|
||||||
@@ -152,16 +153,16 @@ const MusicCard = ({
|
|||||||
gap: 12,
|
gap: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Pressable onPress={toggleLike}>
|
<PressableScale onPress={toggleLike}>
|
||||||
<RNImage
|
<RNImage
|
||||||
source={selected ? icons.heart : icons.heartOutline}
|
source={selected ? icons.heart : icons.heartOutline}
|
||||||
style={size({ size: 24 })}
|
style={size({ size: 24 })}
|
||||||
resizeMode="contain"
|
resizeMode="contain"
|
||||||
/>
|
/>
|
||||||
</Pressable>
|
</PressableScale>
|
||||||
<Pressable ref={moreButtonRef} onPress={onPressMenu}>
|
<PressableScale ref={moreButtonRef} onPress={onPressMenu}>
|
||||||
<RNImage source={icons.more} style={size({ size: 24 })} />
|
<RNImage source={icons.more} style={size({ size: 24 })} />
|
||||||
</Pressable>
|
</PressableScale>
|
||||||
</View>
|
</View>
|
||||||
</BlurView>
|
</BlurView>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { useGlobal } from "reactn";
|
|||||||
import { background, icons, img } from "../../assets";
|
import { background, icons, img } from "../../assets";
|
||||||
import BorderGradient from "../../components/BorderGradient/BorderGradient";
|
import BorderGradient from "../../components/BorderGradient/BorderGradient";
|
||||||
import MoreMenu from "../../components/MoreMenu";
|
import MoreMenu from "../../components/MoreMenu";
|
||||||
|
import PressableScale from "../../components/PressableScale";
|
||||||
import { projectsRef, usersRef } from "../../config/firebase";
|
import { projectsRef, usersRef } from "../../config/firebase";
|
||||||
import useDataFromRef from "../../hooks/useDataFromRef";
|
import useDataFromRef from "../../hooks/useDataFromRef";
|
||||||
import useLayoutType from "../../hooks/useLayoutType";
|
import useLayoutType from "../../hooks/useLayoutType";
|
||||||
@@ -65,7 +66,7 @@ const Profile = () => {
|
|||||||
setFollowers(
|
setFollowers(
|
||||||
Array.isArray(currentUserData?.followedBy)
|
Array.isArray(currentUserData?.followedBy)
|
||||||
? currentUserData.followedBy.length
|
? currentUserData.followedBy.length
|
||||||
: 0,
|
: 0
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -139,8 +140,7 @@ const Profile = () => {
|
|||||||
setSelectedProjectId(item.id);
|
setSelectedProjectId(item.id);
|
||||||
setMenuPosition(posTop);
|
setMenuPosition(posTop);
|
||||||
setShowMenu(
|
setShowMenu(
|
||||||
(prev) =>
|
(prev) => !prev || posTop?.top !== (menuPosition?.top ?? null)
|
||||||
!prev || posTop?.top !== (menuPosition?.top ?? null),
|
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -243,9 +243,9 @@ const Profile = () => {
|
|||||||
}}
|
}}
|
||||||
rightComponent={() =>
|
rightComponent={() =>
|
||||||
!isWeb && isSelf ? (
|
!isWeb && isSelf ? (
|
||||||
<Pressable onPress={() => SheetManager.show("ProfileSettings")}>
|
<PressableScale onPress={() => SheetManager.show("ProfileSettings")}>
|
||||||
<Image source={icons.more} style={{ ...size({ size: 24 }) }} />
|
<Image source={icons.more} style={{ ...size({ size: 24 }) }} />
|
||||||
</Pressable>
|
</PressableScale>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -262,8 +262,8 @@ const Profile = () => {
|
|||||||
// Platform.OS !== "ios" ? "dimezisBlurView" : "none"
|
// Platform.OS !== "ios" ? "dimezisBlurView" : "none"
|
||||||
// }
|
// }
|
||||||
>
|
>
|
||||||
{isWeb && (
|
{isWeb && isSelf && (
|
||||||
<Pressable
|
<PressableScale
|
||||||
style={{
|
style={{
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
}}
|
}}
|
||||||
@@ -278,7 +278,7 @@ const Profile = () => {
|
|||||||
top: 10,
|
top: 10,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Pressable>
|
</PressableScale>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<View style={{ alignItems: "center" }}>
|
<View style={{ alignItems: "center" }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user