delete music
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
import { View, Text } from "react-native";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { Text, View } from "react-native";
|
||||||
import { SheetManager } from "react-native-actions-sheet";
|
import { SheetManager } from "react-native-actions-sheet";
|
||||||
import { Palette } from "../../styles";
|
import { Palette } from "../../styles";
|
||||||
import BorderGradientButton from "../BorderGradientButton";
|
|
||||||
import GradientButton from "../GradientButton";
|
|
||||||
import { FONT_FAMILY } from "../../styles/Fonts";
|
import { FONT_FAMILY } from "../../styles/Fonts";
|
||||||
import AppActionSheet from "../AppActionSheet";
|
import AppActionSheet from "../AppActionSheet";
|
||||||
|
import BorderGradientButton from "../BorderGradientButton";
|
||||||
|
import GradientButton from "../GradientButton";
|
||||||
|
|
||||||
const DeleteModal = ({ payload }) => {
|
const DeleteModal = ({ payload }) => {
|
||||||
const {
|
const {
|
||||||
@@ -51,7 +51,10 @@ const DeleteModal = ({ payload }) => {
|
|||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ width: "80%", alignSelf: "center", gap: 12 }}>
|
<View style={{ width: "80%", alignSelf: "center", gap: 12 }}>
|
||||||
<BorderGradientButton title="Oui, supprimer" onPress={handleConfirm} />
|
<BorderGradientButton
|
||||||
|
title="Oui, supprimer"
|
||||||
|
onPress={handleConfirm}
|
||||||
|
/>
|
||||||
<GradientButton title="Non, annuler" onPress={onClose} />
|
<GradientButton title="Non, annuler" onPress={onClose} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { BlurView } from "expo-blur";
|
||||||
|
import { Image as ExpoImage } from "expo-image";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import {
|
import {
|
||||||
FlatList,
|
FlatList,
|
||||||
@@ -9,12 +11,10 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
View,
|
View,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { Image as ExpoImage } from "expo-image";
|
|
||||||
import { SheetManager } from "react-native-actions-sheet";
|
import { SheetManager } from "react-native-actions-sheet";
|
||||||
import { responsiveHeight } from "react-native-responsive-dimensions";
|
import { responsiveHeight } from "react-native-responsive-dimensions";
|
||||||
import { useGlobal } from "reactn";
|
import { useGlobal } from "reactn";
|
||||||
import { background, icons, img } from "../../assets";
|
import { background, icons, img } from "../../assets";
|
||||||
import alert from "../../components/Alert";
|
|
||||||
import BorderGradient from "../../components/BorderGradient/BorderGradient";
|
import BorderGradient from "../../components/BorderGradient/BorderGradient";
|
||||||
import MoreMenu from "../../components/MoreMenu";
|
import MoreMenu from "../../components/MoreMenu";
|
||||||
import { projectsRef } from "../../config/firebase";
|
import { projectsRef } from "../../config/firebase";
|
||||||
@@ -26,7 +26,6 @@ import { Palette } from "../../styles";
|
|||||||
import { FONT_FAMILY } from "../../styles/Fonts";
|
import { FONT_FAMILY } from "../../styles/Fonts";
|
||||||
import Style, { gutters, size } from "../../styles/Style";
|
import Style, { gutters, size } from "../../styles/Style";
|
||||||
import MusicCard from "../Library/components/MusicCard";
|
import MusicCard from "../Library/components/MusicCard";
|
||||||
import { BlurView } from "expo-blur";
|
|
||||||
|
|
||||||
const Profile = () => {
|
const Profile = () => {
|
||||||
const [selected, setSelected] = useState("Chansons");
|
const [selected, setSelected] = useState("Chansons");
|
||||||
@@ -221,32 +220,28 @@ const Profile = () => {
|
|||||||
{
|
{
|
||||||
label: "Supprimer",
|
label: "Supprimer",
|
||||||
onPress: () =>
|
onPress: () =>
|
||||||
alert(
|
SheetManager.show("Delete", {
|
||||||
"Confirmer la suppression",
|
payload: {
|
||||||
"Cette action supprimera définitivement ce projet.",
|
title: "Supprimer le projet",
|
||||||
[
|
message:
|
||||||
{ text: "Annuler", style: "cancel", onPress: () => {} },
|
"Cette action supprimera définitivement ce projet.",
|
||||||
{
|
onConfirm: async () => {
|
||||||
text: "Supprimer",
|
try {
|
||||||
onPress: async () => {
|
if (!selectedProjectId) return;
|
||||||
try {
|
await projectsRef.doc(selectedProjectId).delete();
|
||||||
if (!selectedProjectId) return;
|
setTooltip({
|
||||||
await projectsRef.doc(selectedProjectId).delete();
|
type: "success",
|
||||||
setTooltip({
|
text: "Projet supprimé",
|
||||||
type: "success",
|
});
|
||||||
text: "Projet supprimé",
|
} catch (e) {
|
||||||
});
|
setTooltip({
|
||||||
} catch (e) {
|
type: "error",
|
||||||
setTooltip({
|
text: e?.message || "Suppression impossible",
|
||||||
type: "error",
|
});
|
||||||
text: e?.message || "Suppression impossible",
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
{ cancelable: true },
|
}),
|
||||||
),
|
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user