share modal
This commit is contained in:
@@ -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 }}>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user