From 8e281e8f78038b6d1c324e0fb9ed6b5d3ad3257a Mon Sep 17 00:00:00 2001 From: leon-morival Date: Mon, 20 Oct 2025 12:08:09 +0200 Subject: [PATCH] share modal --- app.json | 7 +- src/components/DocumentDropZone.js | 18 +- src/components/modal/ShareModal.js | 308 +++++++++++++++++---- src/screens/Playback/RecordPlayback.web.js | 2 +- 4 files changed, 257 insertions(+), 78 deletions(-) diff --git a/app.json b/app.json index ccc2d82..bbc27ee 100644 --- a/app.json +++ b/app.json @@ -58,7 +58,6 @@ }, "package": "com.omedis.musicland", "permissions": [ - "android.permission.RECORD_AUDIO", "android.permission.CAMERA", "android.permission.MODIFY_AUDIO_SETTINGS", "android.permission.POST_NOTIFICATIONS" @@ -74,7 +73,7 @@ { "photosPermission": "Nous avons besoin d'accéder à votre galerie pour vous permettre d'ajouter des photos à vos tâches.", "cameraPermission": "Nous avons besoin d'accéder à votre appareil photo pour vous permettre de prendre des photos de vos tâches.", - "microphonePermission": "Nous avons besoin d'accéder à votre microphone pour vous permettre d'enregistrer des messages vocaux pour vos tâches." + "microphonePermission": false } ], [ @@ -102,8 +101,8 @@ "expo-camera", { "cameraPermission": "Allow $(PRODUCT_NAME) to access your camera", - "microphonePermission": "Allow $(PRODUCT_NAME) to access your microphone", - "recordAudioAndroid": true + "microphonePermission": false, + "recordAudioAndroid": false } ], "expo-audio", diff --git a/src/components/DocumentDropZone.js b/src/components/DocumentDropZone.js index efeb682..7112283 100644 --- a/src/components/DocumentDropZone.js +++ b/src/components/DocumentDropZone.js @@ -1,23 +1,17 @@ -import React, { - useCallback, - useEffect, - useRef, - useState, - useGlobal, -} from "reactn"; -import { Image, Pressable, Text, View } from "react-native"; -import * as ImagePicker from "expo-image-picker"; -import moment from "moment"; import { useActionSheet } from "@expo/react-native-action-sheet"; import * as DocumentPicker from "expo-document-picker"; +import * as ImagePicker from "expo-image-picker"; +import moment from "moment"; +import { Image, Pressable, Text, View } from "react-native"; import Compressor from "react-native-compressor"; import useMinuit from "react-native-minuit/src/hooks/useMinuit"; +import React, { useCallback, useEffect, useRef, useState } from "reactn"; import { arrayUnion } from "../config/firebase"; -import Style, { gutterConstant, mainBorderRadius } from "../styles/Style"; -import { Fonts, Palette } from "../styles"; import { icons } from "../assets"; +import { Fonts, Palette } from "../styles"; +import Style, { gutterConstant, mainBorderRadius } from "../styles/Style"; import { uploadFileToFirebase } from "../helpers/uploadToFirebase"; import useLayoutType from "../hooks/useLayoutType"; diff --git a/src/components/modal/ShareModal.js b/src/components/modal/ShareModal.js index 4562b54..306b20a 100644 --- a/src/components/modal/ShareModal.js +++ b/src/components/modal/ShareModal.js @@ -222,78 +222,151 @@ const ShareModal = ({ payload }) => { ]; }, [encodedShareText, encodedUrl, payload?.options, shareTitle]); - return ( - - - - {/* - - */} - {heading} - - - {linkLabel} - - - - - - - - - + const mobileContent = ( + + + {heading} + + + {linkLabel} + + + + + + + + - {copied ? Lien copié : null} - + + {copied ? Lien copié : null} + - - {sectionTitle} - + + {sectionTitle} + + {shareOptions.map((option, index) => { + const Icon = option?.Icon ?? Feather; + return ( + + handleShareOption(option)} + style={styles.optionRow} + > + + + + {option?.label} + + + ); + })} + + + + ); + + const webContent = ( + + + {heading} + + + + + + {shareMessage} + + + + {linkLabel} + + + + + {copied ? "Lien copié" : "Copier le lien"} + + + + + + Partager + + + + + + {sectionTitle} + {shareOptions.map((option, index) => { const Icon = option?.Icon ?? Feather; return ( - handleShareOption(option)} + style={styles.webOptionRow} > - handleShareOption(option)} - style={styles.optionRow} - > - - - - {option?.label} - - + + + + {option?.label} + + ); })} - + + + ); + + return ( + + {isWeb ? webContent : mobileContent} ); }; @@ -405,6 +478,119 @@ const styles = StyleSheet.create({ color: Palette.white, fontFamily: FONT_FAMILY.InterMedium, }, + webContainer: { + gap: 24, + }, + webHeader: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + gap: 12, + }, + webHeading: { + flex: 1, + fontSize: 24, + color: Palette.white, + fontFamily: FONT_FAMILY.HelveticaNeueMedium, + }, + webCloseButton: { + width: 32, + height: 32, + borderRadius: 16, + backgroundColor: "rgba(255, 255, 255, 0.08)", + alignItems: "center", + justifyContent: "center", + }, + webSubheading: { + fontSize: 14, + color: "rgba(255, 255, 255, 0.65)", + fontFamily: FONT_FAMILY.InterMedium, + }, + webContent: { + gap: 20, + }, + webLinkCard: { + backgroundColor: "rgba(255, 255, 255, 0.06)", + borderRadius: 20, + paddingHorizontal: 20, + paddingVertical: 18, + gap: 16, + }, + webLinkLabel: { + color: Palette.white, + fontSize: 15, + fontFamily: FONT_FAMILY.InterMedium, + overflow: "hidden", + }, + webLinkActions: { + flexDirection: "row", + alignItems: "center", + gap: 12, + flexWrap: "wrap", + }, + webActionButton: { + flexDirection: "row", + alignItems: "center", + justifyContent: "center", + gap: 10, + paddingHorizontal: 18, + paddingVertical: 12, + borderRadius: 16, + }, + webPrimaryButton: { + backgroundColor: Palette.primary, + }, + webSecondaryButton: { + backgroundColor: "rgba(255, 255, 255, 0.08)", + }, + webActionButtonActive: { + backgroundColor: Palette.darkRadioactivGreen, + }, + webActionLabel: { + fontSize: 14, + color: Palette.white, + fontFamily: FONT_FAMILY.InterMedium, + }, + webOptionsCard: { + backgroundColor: "rgba(255, 255, 255, 0.06)", + borderRadius: 20, + paddingHorizontal: 20, + paddingVertical: 22, + gap: 16, + }, + webSectionHeading: { + fontSize: 18, + color: Palette.white, + fontFamily: FONT_FAMILY.HelveticaNeueMedium, + }, + webOptionsGrid: { + gap: 12, + }, + webOptionRow: { + flexDirection: "row", + alignItems: "center", + justifyContent: "space-between", + gap: 12, + backgroundColor: "rgba(255, 255, 255, 0.04)", + borderRadius: 16, + paddingHorizontal: 18, + paddingVertical: 14, + }, + webOptionIcon: { + width: 36, + height: 36, + borderRadius: 18, + alignItems: "center", + justifyContent: "center", + backgroundColor: "rgba(255, 255, 255, 0.08)", + marginRight: 4, + }, + webOptionLabel: { + flex: 1, + fontSize: 15, + color: Palette.white, + fontFamily: FONT_FAMILY.InterMedium, + }, }); export default ShareModal; diff --git a/src/screens/Playback/RecordPlayback.web.js b/src/screens/Playback/RecordPlayback.web.js index 08c8bc7..2183ac0 100644 --- a/src/screens/Playback/RecordPlayback.web.js +++ b/src/screens/Playback/RecordPlayback.web.js @@ -382,7 +382,7 @@ const RecordPlayback = ({ route }) => { try { const stream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: "user" }, - audio: true, + audio: false, }); if (cancelled) { stream.getTracks().forEach((track) => track.stop());