start refacto home and fix description
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
import React from "react";
|
||||
import { Alert, Pressable, Platform, Text } from "react-native";
|
||||
import { BlurView } from "expo-blur";
|
||||
import { Palette } from "../styles";
|
||||
import { FONT_FAMILY } from "../styles/Fonts";
|
||||
import { icons } from "../assets";
|
||||
import { Image } from "expo-image";
|
||||
|
||||
export default function ShareBtnWeb({ style }) {
|
||||
const handleShare = () => {
|
||||
const shareUrl =
|
||||
typeof window !== "undefined" ? window.location.href : undefined;
|
||||
if (typeof navigator !== "undefined" && navigator.share) {
|
||||
navigator
|
||||
.share({
|
||||
title: "MusicLand",
|
||||
text: "Découvre mon expérience sur MusicLand",
|
||||
...(shareUrl ? { url: shareUrl } : {}),
|
||||
})
|
||||
.catch(() => {
|
||||
Alert.alert("Partage", "Le partage a été annulé.");
|
||||
});
|
||||
return;
|
||||
}
|
||||
Alert.alert("Partage", "Fonctionnalité disponible prochainement.");
|
||||
};
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
style={{
|
||||
...style,
|
||||
}}
|
||||
onPress={handleShare}
|
||||
>
|
||||
<BlurView
|
||||
intensity={Platform.OS === "web" ? 35 : 30}
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
gap: 12,
|
||||
paddingHorizontal: 24,
|
||||
paddingVertical: 12,
|
||||
borderRadius: 999,
|
||||
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 14,
|
||||
color: Palette.white,
|
||||
fontFamily: FONT_FAMILY.InterMedium,
|
||||
}}
|
||||
>
|
||||
Partager l'expérience
|
||||
</Text>
|
||||
<Image
|
||||
source={icons.share}
|
||||
style={{
|
||||
width: 18,
|
||||
height: 18,
|
||||
tintColor: Palette.white,
|
||||
}}
|
||||
contentFit="contain"
|
||||
/>
|
||||
</BlurView>
|
||||
</Pressable>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user