feat: share qr at start
This commit is contained in:
@@ -1,14 +1,17 @@
|
|||||||
import React, { useContext, useEffect, useMemo, useState } from "react";
|
import React, { useContext, useEffect, useMemo, useState } from "react";
|
||||||
import { Platform, StyleSheet, View } from "react-native";
|
import { Platform, StyleSheet, View } from "react-native";
|
||||||
|
import { useGlobal } from "reactn";
|
||||||
import { Portal } from "@gorhom/portal";
|
import { Portal } from "@gorhom/portal";
|
||||||
import FullscreenIntroVideo from "./FullscreenIntroVideo";
|
import FullscreenIntroVideo from "./FullscreenIntroVideo";
|
||||||
import { useUser } from "../providers/UserDataProvider";
|
import { useUser } from "../providers/UserDataProvider";
|
||||||
import { SplashAnimationContext } from "../providers/SplashAnimationProvider";
|
import { SplashAnimationContext } from "../providers/SplashAnimationProvider";
|
||||||
|
import { musiclandShareUrl } from "../data";
|
||||||
|
|
||||||
const BLOCKING_TIMEOUT_MS = 5000;
|
const BLOCKING_TIMEOUT_MS = 5000;
|
||||||
|
|
||||||
// Affiche la vidéo d'intro mobile (videos.splash) juste après le splash screen.
|
// Affiche la vidéo d'intro mobile (videos.splash) juste après le splash screen.
|
||||||
const MobileSplashVideo = () => {
|
const MobileSplashVideo = () => {
|
||||||
|
const [, setShareQrModal] = useGlobal("shareQrModal");
|
||||||
const { videos } = useUser();
|
const { videos } = useUser();
|
||||||
const { isFullyLoaded } = useContext(SplashAnimationContext);
|
const { isFullyLoaded } = useContext(SplashAnimationContext);
|
||||||
|
|
||||||
@@ -46,6 +49,11 @@ const MobileSplashVideo = () => {
|
|||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
setHasShown(true);
|
setHasShown(true);
|
||||||
|
setShareQrModal({
|
||||||
|
visible: true,
|
||||||
|
url: musiclandShareUrl,
|
||||||
|
title: "Scannez le QR-code",
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!showBlockingOverlay && !visible) {
|
if (!showBlockingOverlay && !visible) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const ShareQrModal = ({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const blurIntensity = Platform.select({ ios: 40, default: 20 });
|
const blurIntensity = Platform.select({ ios: 40, android: 40, default: 20 });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Portal>
|
<Portal>
|
||||||
@@ -42,6 +42,7 @@ const ShareQrModal = ({
|
|||||||
intensity={blurIntensity}
|
intensity={blurIntensity}
|
||||||
tint="dark"
|
tint="dark"
|
||||||
style={styles.modalCard}
|
style={styles.modalCard}
|
||||||
|
experimentalBlurMethod="dimezisBlurView"
|
||||||
>
|
>
|
||||||
{/* <Pressable
|
{/* <Pressable
|
||||||
onPress={onClose}
|
onPress={onClose}
|
||||||
|
|||||||
Reference in New Issue
Block a user