clean new logique
This commit is contained in:
@@ -141,7 +141,7 @@ const MusicCard = ({
|
||||
// Platform.OS !== "ios" ? "dimezisBlurView" : "none"
|
||||
// }
|
||||
>
|
||||
<View style={{ gap: 3, flexShrink: 1 }}>
|
||||
<View style={{ gap: 3, flexShrink: 1, paddingVertical: 11 }}>
|
||||
<Text numberOfLines={2} style={styles.title}>
|
||||
{title || "Sans titre"}
|
||||
</Text>
|
||||
|
||||
@@ -89,105 +89,91 @@ const SearchResultsList = ({
|
||||
showsVerticalScrollIndicator={false}
|
||||
>
|
||||
{shouldShowMusics && (
|
||||
<View style={{ paddingHorizontal: 2 }}>
|
||||
<CreateLyricsHeader
|
||||
gradientProps={{
|
||||
start: { x: 0, y: 0 },
|
||||
end: { x: 0, y: 1 },
|
||||
}}
|
||||
>
|
||||
{musics.length > 0 && (
|
||||
<View style={{ gap: 1 }}>
|
||||
{Array.isArray(musics) &&
|
||||
musics.slice(0, 6).map((project) => (
|
||||
<MusicCard
|
||||
key={project.id}
|
||||
title={project?.title || "Sans titre"}
|
||||
subtitle={project?.userName}
|
||||
imageUri={project?.coverUrl || null}
|
||||
projectId={project?.id}
|
||||
likedBy={project?.likedBy || []}
|
||||
onPress={() => handleMusicPress(project)}
|
||||
onPressMore={(positionTop) => {
|
||||
setSelectedProjectId(project.id);
|
||||
setMenuPosition(positionTop);
|
||||
setShowMenu(
|
||||
(previous) =>
|
||||
!previous ||
|
||||
positionTop?.top !== (menuPosition?.top ?? null)
|
||||
);
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
{musicsLoading && (
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 12,
|
||||
color: Palette.white,
|
||||
fontFamily: FONT_FAMILY.InterRegular,
|
||||
alignSelf: "center",
|
||||
<View style={{ gap: 10 }}>
|
||||
{musics.length > 0 && (
|
||||
<>
|
||||
{Array.isArray(musics) &&
|
||||
musics.slice(0, 6).map((project) => (
|
||||
<MusicCard
|
||||
key={project.id}
|
||||
title={project?.title || "Sans titre"}
|
||||
subtitle={project?.userName}
|
||||
imageUri={project?.coverUrl || null}
|
||||
projectId={project?.id}
|
||||
likedBy={project?.likedBy || []}
|
||||
onPress={() => handleMusicPress(project)}
|
||||
onPressMore={(positionTop) => {
|
||||
setSelectedProjectId(project.id);
|
||||
setMenuPosition(positionTop);
|
||||
setShowMenu(
|
||||
(previous) =>
|
||||
!previous ||
|
||||
positionTop?.top !== (menuPosition?.top ?? null)
|
||||
);
|
||||
}}
|
||||
>
|
||||
{"Chargement…"}
|
||||
</Text>
|
||||
)}
|
||||
</View>
|
||||
)}
|
||||
{musics.length === 0 && !musicsLoading && (
|
||||
<EmptyText text={"Aucune musique trouvée"} />
|
||||
)}
|
||||
</CreateLyricsHeader>
|
||||
/>
|
||||
))}
|
||||
{musicsLoading && (
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 12,
|
||||
color: Palette.white,
|
||||
fontFamily: FONT_FAMILY.InterRegular,
|
||||
alignSelf: "center",
|
||||
}}
|
||||
>
|
||||
{"Chargement…"}
|
||||
</Text>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{musics.length === 0 && !musicsLoading && (
|
||||
<EmptyText text={"Aucune musique trouvée"} />
|
||||
)}
|
||||
</View>
|
||||
)}
|
||||
{shouldShowPlaybacks && (
|
||||
<View style={{ paddingHorizontal: 2, paddingTop: 10 }}>
|
||||
<CreateLyricsHeader
|
||||
gradientProps={{
|
||||
start: { x: 0, y: 0 },
|
||||
end: { x: 0, y: 1 },
|
||||
}}
|
||||
>
|
||||
{playbacks.length > 0 && (
|
||||
<View style={{ gap: 10 }}>
|
||||
{Array.isArray(playbacks) &&
|
||||
playbacks.slice(0, 6).map((project) => (
|
||||
<MusicCard
|
||||
key={project.id}
|
||||
title={project?.title || "Sans titre"}
|
||||
subtitle={project?.userName}
|
||||
imageUri={project?.coverUrl || null}
|
||||
projectId={project?.id}
|
||||
likedBy={project?.likedBy || []}
|
||||
onPress={() => handlePlaybackPress(project)}
|
||||
onPressMore={(positionTop) => {
|
||||
setSelectedProjectId(project.id);
|
||||
setMenuPosition(positionTop);
|
||||
setShowMenu(
|
||||
(previous) =>
|
||||
!previous ||
|
||||
positionTop?.top !== (menuPosition?.top ?? null)
|
||||
);
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
{playbacksLoading && (
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 12,
|
||||
color: Palette.white,
|
||||
fontFamily: FONT_FAMILY.InterRegular,
|
||||
alignSelf: "center",
|
||||
<View style={{ gap: 10, paddingTop: 10 }}>
|
||||
{playbacks.length > 0 && (
|
||||
<>
|
||||
{Array.isArray(playbacks) &&
|
||||
playbacks.slice(0, 6).map((project) => (
|
||||
<MusicCard
|
||||
key={project.id}
|
||||
title={project?.title || "Sans titre"}
|
||||
subtitle={project?.userName}
|
||||
imageUri={project?.coverUrl || null}
|
||||
projectId={project?.id}
|
||||
likedBy={project?.likedBy || []}
|
||||
onPress={() => handlePlaybackPress(project)}
|
||||
onPressMore={(positionTop) => {
|
||||
setSelectedProjectId(project.id);
|
||||
setMenuPosition(positionTop);
|
||||
setShowMenu(
|
||||
(previous) =>
|
||||
!previous ||
|
||||
positionTop?.top !== (menuPosition?.top ?? null)
|
||||
);
|
||||
}}
|
||||
>
|
||||
{"Chargement…"}
|
||||
</Text>
|
||||
)}
|
||||
</View>
|
||||
)}
|
||||
{playbacks.length === 0 && !playbacksLoading && (
|
||||
<EmptyText text={"Aucun playback trouvé"} />
|
||||
)}
|
||||
</CreateLyricsHeader>
|
||||
/>
|
||||
))}
|
||||
{playbacksLoading && (
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 12,
|
||||
color: Palette.white,
|
||||
fontFamily: FONT_FAMILY.InterRegular,
|
||||
alignSelf: "center",
|
||||
}}
|
||||
>
|
||||
{"Chargement…"}
|
||||
</Text>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{playbacks.length === 0 && !playbacksLoading && (
|
||||
<EmptyText text={"Aucun playback trouvé"} />
|
||||
)}
|
||||
</View>
|
||||
)}
|
||||
{shouldShowUsers && (
|
||||
|
||||
Reference in New Issue
Block a user