share playback

This commit is contained in:
2025-09-03 15:29:57 +02:00
parent 64fd988d2f
commit a516f260d1
4 changed files with 191 additions and 35 deletions
+2 -28
View File
@@ -1,12 +1,9 @@
import numbro from "numbro";
import { Clipboard } from "react-native-web";
import moment from "moment";
import numbro from "numbro";
import alert from "../components/Alert.js";
import { Linking } from "react-native";
import { isTauri, isWeb } from "../hooks/useLayoutType";
import Palette from "../styles/Palette.js";
import { Linking, Share } from "react-native";
export const capitalize = (string) => {
return string.charAt(0).toUpperCase() + string.slice(1);
@@ -196,26 +193,3 @@ export const openLinkInBrowser = ({ url }) => {
console.error(error);
}
};
export const shareLink = ({ url, title = "", message = "" }) => {
try {
if (isWeb) {
if (!Clipboard.isAvailable) {
throw new Error("Clipboard not available");
}
Clipboard.setString(url);
alert("Lien copié", "Le lien a été copié dans votre presse-papiers.");
} else {
Share.share({
message,
url,
title,
});
}
} catch (error) {
console.log(error);
alert("Partage non disponible", "Il y a eu une erreur lors du partage.");
}
};