share modal

This commit is contained in:
2025-10-03 13:36:18 +02:00
parent 8ea7f89c7b
commit dcc50506de
13 changed files with 377 additions and 54 deletions
+1 -1
View File
@@ -187,7 +187,7 @@ const HitParade = () => {
backgroundImg={isWeb ? background.libraryBgWeb : background.hitParadeBG}
headerType="NONE"
width="100%"
maxWidth={null}
maxWidth={800}
blurIntensity={isWeb ? 2 : 0}
>
<View style={{ gap: 12, flex: 1 }}>
+36 -4
View File
@@ -1,18 +1,23 @@
import React, { useState } from "react";
import { View } from "react-native";
import { SheetManager } from "react-native-actions-sheet";
import { useGlobal } from "reactn";
import MoreMenu from "../../../components/MoreMenu";
import { projectsRef } from "../../../config/firebase";
import { Routes } from "../../../navigation";
import { navigate } from "../../../navigation/NavigationService";
import { useUser } from "../../../providers/UserDataProvider";
import CardContainer from "./CardContainer";
import MusicCard from "./MusicCard";
import MoreMenu from "../../../components/MoreMenu";
const MyMusic = () => {
const { userProjects = [] } = useUser();
const [menuPosition, setMenuPosition] = useState(null);
const [showMenu, setShowMenu] = useState(false);
const [selectedProjectId, setSelectedProjectId] = useState(null);
const projects = Array.isArray(userProjects) ? userProjects.slice(0, 3) : [];
const [, setTooltip] = useGlobal("_tooltip");
return (
<CardContainer
label="Mes musiques"
@@ -39,8 +44,7 @@ const MyMusic = () => {
setSelectedProjectId(p.id);
setMenuPosition(posTop);
setShowMenu(
(prev) =>
!prev || posTop?.top !== (menuPosition?.top ?? null),
(prev) => !prev || posTop?.top !== (menuPosition?.top ?? null)
);
}}
/>
@@ -52,6 +56,34 @@ const MyMusic = () => {
onClose={() => setShowMenu(false)}
inPlaylist={false}
projectId={selectedProjectId}
extraItems={[
{
label: "Supprimer",
onPress: () =>
SheetManager.show("Delete", {
payload: {
title: "Supprimer le projet",
message:
"Cette action supprimera définitivement ce projet.",
onConfirm: async () => {
try {
if (!selectedProjectId) return;
await projectsRef.doc(selectedProjectId).delete();
setTooltip({
type: "success",
text: "Projet supprimé",
});
} catch (e) {
setTooltip({
type: "error",
text: e?.message || "Suppression impossible",
});
}
},
},
}),
},
]}
/>
</View>
</CardContainer>
+5 -11
View File
@@ -1,16 +1,10 @@
import {
View,
Text,
TextInput,
Image,
Pressable,
Platform,
} from "react-native";
import { BlurView } from "expo-blur";
import React, { useState } from "react";
import { Platform, Pressable, Text, TextInput, View } from "react-native";
import EyeSlashSVG from "../../../assets/UI/EyeSlashSVG";
import EyeSVG from "../../../assets/UI/EyeSVG";
import { Palette, Style } from "../../../styles";
import { FONT_FAMILY } from "../../../styles/Fonts";
import { BlurView } from "expo-blur";
import { icons } from "../../../assets";
const EditInput = ({
label = "",
@@ -79,7 +73,7 @@ const EditInput = ({
/>
{type === "password" && (
<Pressable onPress={() => setShowPassword(!showPassword)}>
<Image source={icons.eye} />
{showPassword ? <EyeSVG /> : <EyeSlashSVG />}
</Pressable>
)}
</BlurView>