username on creation
This commit is contained in:
@@ -6,7 +6,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|||||||
import { isWeb } from "../hooks/useLayoutType";
|
import { isWeb } from "../hooks/useLayoutType";
|
||||||
import { gutters, Palette } from "../styles";
|
import { gutters, Palette } from "../styles";
|
||||||
|
|
||||||
const AppActionSheet = ({ children, props }) => {
|
const AppActionSheet = ({ children, ...props }) => {
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
return (
|
return (
|
||||||
<ActionSheet
|
<ActionSheet
|
||||||
|
|||||||
@@ -46,9 +46,13 @@ const ShareModal = ({ payload }) => {
|
|||||||
const [copied, setCopied] = useState(false);
|
const [copied, setCopied] = useState(false);
|
||||||
const copyTimeout = useRef(null);
|
const copyTimeout = useRef(null);
|
||||||
const qrOpenTimeout = useRef(null);
|
const qrOpenTimeout = useRef(null);
|
||||||
|
const blurProps =
|
||||||
|
Platform.OS === "android"
|
||||||
|
? { experimentalBlurMethod: "dimezisBlurView" }
|
||||||
|
: {};
|
||||||
|
|
||||||
const closeSheet = useCallback(() => {
|
const closeSheet = useCallback(() => {
|
||||||
SheetManager.hide("Share");
|
return SheetManager.hide("Share");
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const shareText = useMemo(() => {
|
const shareText = useMemo(() => {
|
||||||
@@ -134,7 +138,7 @@ const ShareModal = ({ payload }) => {
|
|||||||
if (option?.type === "qr") {
|
if (option?.type === "qr") {
|
||||||
const qrTitleValue = qrTitle;
|
const qrTitleValue = qrTitle;
|
||||||
|
|
||||||
closeSheet();
|
const hidePromise = closeSheet();
|
||||||
qrOpenTimeout.current = setTimeout(() => {
|
qrOpenTimeout.current = setTimeout(() => {
|
||||||
setGlobal({
|
setGlobal({
|
||||||
shareQrModal: {
|
shareQrModal: {
|
||||||
@@ -144,6 +148,8 @@ const ShareModal = ({ payload }) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
||||||
|
await hidePromise;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,21 +157,21 @@ const ShareModal = ({ payload }) => {
|
|||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
await handleSystemShare();
|
await handleSystemShare();
|
||||||
closeSheet();
|
await closeSheet();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Platform.OS === "web") {
|
if (Platform.OS === "web") {
|
||||||
window.open(target, "_blank", "noopener,noreferrer");
|
window.open(target, "_blank", "noopener,noreferrer");
|
||||||
closeSheet();
|
await closeSheet();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const supported = await Linking.canOpenURL(target);
|
const supported = await Linking.canOpenURL(target);
|
||||||
if (supported) {
|
if (supported) {
|
||||||
await Linking.openURL(target);
|
await Linking.openURL(target);
|
||||||
closeSheet();
|
await closeSheet();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -173,14 +179,14 @@ const ShareModal = ({ payload }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await handleSystemShare();
|
await handleSystemShare();
|
||||||
closeSheet();
|
await closeSheet();
|
||||||
},
|
},
|
||||||
[closeSheet, handleSystemShare, qrTitle, qrUrl]
|
[closeSheet, handleSystemShare, qrTitle, qrUrl]
|
||||||
);
|
);
|
||||||
|
|
||||||
const onSystemShare = useCallback(async () => {
|
const onSystemShare = useCallback(async () => {
|
||||||
await handleSystemShare();
|
await handleSystemShare();
|
||||||
closeSheet();
|
await closeSheet();
|
||||||
}, [closeSheet, handleSystemShare]);
|
}, [closeSheet, handleSystemShare]);
|
||||||
|
|
||||||
const shareOptions = useMemo(() => {
|
const shareOptions = useMemo(() => {
|
||||||
@@ -233,8 +239,11 @@ const ShareModal = ({ payload }) => {
|
|||||||
style={[styles.card, styles.blurCard]}
|
style={[styles.card, styles.blurCard]}
|
||||||
tint="dark"
|
tint="dark"
|
||||||
intensity={40}
|
intensity={40}
|
||||||
experimentalBlurMethod="dimezisBlurView"
|
{...blurProps}
|
||||||
>
|
>
|
||||||
|
<Pressable onPress={closeSheet} style={styles.closeButton} hitSlop={8}>
|
||||||
|
<Feather name="x" size={18} color={Palette.white} />
|
||||||
|
</Pressable>
|
||||||
<Text style={styles.heading}>{heading}</Text>
|
<Text style={styles.heading}>{heading}</Text>
|
||||||
<View style={styles.linkRow}>
|
<View style={styles.linkRow}>
|
||||||
<Text numberOfLines={1} style={styles.linkText}>
|
<Text numberOfLines={1} style={styles.linkText}>
|
||||||
@@ -264,11 +273,7 @@ const ShareModal = ({ payload }) => {
|
|||||||
{copied ? <Text style={styles.copiedText}>Lien copié</Text> : null}
|
{copied ? <Text style={styles.copiedText}>Lien copié</Text> : null}
|
||||||
</BlurView>
|
</BlurView>
|
||||||
|
|
||||||
<BlurView
|
<BlurView intensity={70} style={styles.card} {...blurProps}>
|
||||||
intensity={70}
|
|
||||||
experimentalBlurMethod="dimezisBlurView"
|
|
||||||
style={styles.card}
|
|
||||||
>
|
|
||||||
<Text style={styles.sectionHeading}>{sectionTitle}</Text>
|
<Text style={styles.sectionHeading}>{sectionTitle}</Text>
|
||||||
<View style={styles.optionsList}>
|
<View style={styles.optionsList}>
|
||||||
{shareOptions.map((option, index) => {
|
{shareOptions.map((option, index) => {
|
||||||
@@ -278,7 +283,7 @@ const ShareModal = ({ payload }) => {
|
|||||||
key={option?.key || index}
|
key={option?.key || index}
|
||||||
style={styles.optionBlur}
|
style={styles.optionBlur}
|
||||||
intensity={40}
|
intensity={40}
|
||||||
experimentalBlurMethod="dimezisBlurView"
|
{...blurProps}
|
||||||
>
|
>
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={() => handleShareOption(option)}
|
onPress={() => handleShareOption(option)}
|
||||||
@@ -304,7 +309,7 @@ const styles = StyleSheet.create({
|
|||||||
gap: 24,
|
gap: 24,
|
||||||
},
|
},
|
||||||
card: {
|
card: {
|
||||||
// backgroundColor: Palette.glass,
|
backgroundColor: Palette.glass,
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
borderRadius: 24,
|
borderRadius: 24,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
@@ -315,6 +320,19 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
blurCard: {
|
blurCard: {
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
|
position: "relative",
|
||||||
|
},
|
||||||
|
closeButton: {
|
||||||
|
position: "absolute",
|
||||||
|
top: 16,
|
||||||
|
right: 16,
|
||||||
|
width: 32,
|
||||||
|
height: 32,
|
||||||
|
borderRadius: 16,
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
backgroundColor: "rgba(255, 255, 255, 0.12)",
|
||||||
|
zIndex: 2,
|
||||||
},
|
},
|
||||||
heading: {
|
heading: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
import React, { useMemo } from "react";
|
|
||||||
import { BlurView } from "expo-blur";
|
|
||||||
import { Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
|
||||||
import { Feather } from "@expo/vector-icons";
|
import { Feather } from "@expo/vector-icons";
|
||||||
import { Portal } from "@gorhom/portal";
|
import { Portal } from "@gorhom/portal";
|
||||||
|
import { BlurView } from "expo-blur";
|
||||||
|
import React, { useMemo } from "react";
|
||||||
|
import { Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
||||||
|
|
||||||
import QrCode from "../QrCode";
|
|
||||||
import { Palette } from "../../styles";
|
import { Palette } from "../../styles";
|
||||||
import { FONT_FAMILY } from "../../styles/Fonts";
|
import { FONT_FAMILY } from "../../styles/Fonts";
|
||||||
|
import QrCode from "../QrCode";
|
||||||
|
|
||||||
const ShareQrModal = ({ visible, onClose, url, title = "Scannez le QR-code" }) => {
|
const ShareQrModal = ({
|
||||||
|
visible,
|
||||||
|
onClose,
|
||||||
|
url,
|
||||||
|
title = "Scannez le QR-code",
|
||||||
|
}) => {
|
||||||
const shareUrl = useMemo(() => url, [url]);
|
const shareUrl = useMemo(() => url, [url]);
|
||||||
|
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
@@ -26,22 +31,36 @@ const ShareQrModal = ({ visible, onClose, url, title = "Scannez le QR-code" }) =
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<View style={styles.centerWrapper} pointerEvents="box-none">
|
<View style={styles.centerWrapper} pointerEvents="box-none">
|
||||||
<BlurView intensity={blurIntensity} tint="dark" style={styles.modalCard}>
|
<BlurView
|
||||||
<Pressable onPress={onClose} style={styles.closeButton} hitSlop={10}>
|
intensity={blurIntensity}
|
||||||
|
tint="dark"
|
||||||
|
style={styles.modalCard}
|
||||||
|
>
|
||||||
|
<Pressable
|
||||||
|
onPress={onClose}
|
||||||
|
style={styles.closeButton}
|
||||||
|
hitSlop={10}
|
||||||
|
>
|
||||||
<Feather name="x" size={20} color={Palette.white} />
|
<Feather name="x" size={20} color={Palette.white} />
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
|
||||||
<View style={styles.content}>
|
<View style={styles.content}>
|
||||||
<Text style={styles.title}>{title}</Text>
|
<Text style={styles.title}>{title}</Text>
|
||||||
<Text style={styles.subtitle}>
|
<Text style={styles.subtitle}>Partage Musicland à tes amis.</Text>
|
||||||
Partage ce code pour guider tes contacts directement vers MusicLand.
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<View style={styles.qrWrapper}>
|
<View style={styles.qrWrapper}>
|
||||||
<QrCode value={shareUrl} size={220} backgroundColor="transparent" />
|
<QrCode
|
||||||
|
value={shareUrl}
|
||||||
|
size={220}
|
||||||
|
backgroundColor="transparent"
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<Text numberOfLines={1} ellipsizeMode="middle" style={styles.linkText}>
|
<Text
|
||||||
|
numberOfLines={1}
|
||||||
|
ellipsizeMode="middle"
|
||||||
|
style={styles.linkText}
|
||||||
|
>
|
||||||
{shareUrl}
|
{shareUrl}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -112,17 +112,17 @@ export default ({ children }) => {
|
|||||||
{
|
{
|
||||||
selectedProjectId: projectId || null,
|
selectedProjectId: projectId || null,
|
||||||
},
|
},
|
||||||
{ merge: true },
|
{ merge: true }
|
||||||
);
|
);
|
||||||
console.log("update selected project");
|
console.log("update selected project");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(
|
console.log(
|
||||||
"UserDataProvider: unable to persist selectedProjectId",
|
"UserDataProvider: unable to persist selectedProjectId",
|
||||||
error?.message || error,
|
error?.message || error
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[currentUID],
|
[currentUID]
|
||||||
);
|
);
|
||||||
|
|
||||||
const selectProject = useCallback(
|
const selectProject = useCallback(
|
||||||
@@ -137,12 +137,12 @@ export default ({ children }) => {
|
|||||||
persistSelectedProjectId(safeId).catch((error) => {
|
persistSelectedProjectId(safeId).catch((error) => {
|
||||||
console.log(
|
console.log(
|
||||||
"UserDataProvider: persist selectedProjectId failed",
|
"UserDataProvider: persist selectedProjectId failed",
|
||||||
error?.message || error,
|
error?.message || error
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[currentUID, persistSelectedProjectId, setSelectedProject],
|
[currentUID, persistSelectedProjectId, setSelectedProject]
|
||||||
);
|
);
|
||||||
|
|
||||||
const resetSelectedProject = useCallback(() => {
|
const resetSelectedProject = useCallback(() => {
|
||||||
@@ -159,7 +159,7 @@ export default ({ children }) => {
|
|||||||
...partial,
|
...partial,
|
||||||
updatedAt: firebase.firestore.FieldValue.serverTimestamp(),
|
updatedAt: firebase.firestore.FieldValue.serverTimestamp(),
|
||||||
},
|
},
|
||||||
options,
|
options
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("updateProjectData error", e?.message);
|
console.log("updateProjectData error", e?.message);
|
||||||
@@ -170,10 +170,9 @@ export default ({ children }) => {
|
|||||||
const createNewProject = async ({ hasLyrics = false } = {}) => {
|
const createNewProject = async ({ hasLyrics = false } = {}) => {
|
||||||
try {
|
try {
|
||||||
await setIsLoading(true);
|
await setIsLoading(true);
|
||||||
const user = firebase.auth().currentUser;
|
|
||||||
const payload = {
|
const payload = {
|
||||||
userId: user ? user.uid : currentUID || null,
|
userId: currentUID || null,
|
||||||
hasLyrics: !!hasLyrics,
|
userName: currentUserData?.userName || null,
|
||||||
createdAt: firebase.firestore.FieldValue.serverTimestamp(),
|
createdAt: firebase.firestore.FieldValue.serverTimestamp(),
|
||||||
updatedAt: firebase.firestore.FieldValue.serverTimestamp(),
|
updatedAt: firebase.firestore.FieldValue.serverTimestamp(),
|
||||||
};
|
};
|
||||||
@@ -195,7 +194,7 @@ export default ({ children }) => {
|
|||||||
followedBy: arrayUnion(currentUID),
|
followedBy: arrayUnion(currentUID),
|
||||||
lastFollowersUpdateAt: new Date(),
|
lastFollowersUpdateAt: new Date(),
|
||||||
},
|
},
|
||||||
{ merge: true },
|
{ merge: true }
|
||||||
);
|
);
|
||||||
setTooltip({ type: "success", text: "Abonnement mis à jour" });
|
setTooltip({ type: "success", text: "Abonnement mis à jour" });
|
||||||
}
|
}
|
||||||
@@ -213,7 +212,7 @@ export default ({ children }) => {
|
|||||||
followedBy: arrayRemove(currentUID),
|
followedBy: arrayRemove(currentUID),
|
||||||
lastFollowersUpdateAt: new Date(),
|
lastFollowersUpdateAt: new Date(),
|
||||||
},
|
},
|
||||||
{ merge: true },
|
{ merge: true }
|
||||||
);
|
);
|
||||||
setTooltip({
|
setTooltip({
|
||||||
type: "success",
|
type: "success",
|
||||||
|
|||||||
@@ -32,6 +32,14 @@ const HitParade = () => {
|
|||||||
condition: true,
|
condition: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
"top songs",
|
||||||
|
JSON.stringify(
|
||||||
|
topSongs.map((song) => song.userId),
|
||||||
|
null,
|
||||||
|
2
|
||||||
|
)
|
||||||
|
);
|
||||||
const { data: topPlaybacks } = useDataFromRef({
|
const { data: topPlaybacks } = useDataFromRef({
|
||||||
ref: projectsRef.where("views", ">", 0).orderBy("views", "desc").limit(50),
|
ref: projectsRef.where("views", ">", 0).orderBy("views", "desc").limit(50),
|
||||||
format: (docs) => docs.filter((d) => d?.playbackUrl != null).slice(0, 10),
|
format: (docs) => docs.filter((d) => d?.playbackUrl != null).slice(0, 10),
|
||||||
|
|||||||
@@ -146,6 +146,11 @@ const Home = () => {
|
|||||||
resetSelectedProject();
|
resetSelectedProject();
|
||||||
setActiveStageIndex(0);
|
setActiveStageIndex(0);
|
||||||
if (songwriterAction?.route) {
|
if (songwriterAction?.route) {
|
||||||
|
console.log(
|
||||||
|
"navigating to",
|
||||||
|
songwriterAction.route,
|
||||||
|
songwriterAction.params
|
||||||
|
);
|
||||||
navigate(songwriterAction.route, songwriterAction.params);
|
navigate(songwriterAction.route, songwriterAction.params);
|
||||||
}
|
}
|
||||||
}, [resetSelectedProject, songwriterAction]);
|
}, [resetSelectedProject, songwriterAction]);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Image, StyleSheet, View } from "react-native";
|
|||||||
import useMinuit from "react-native-minuit/src/hooks/useMinuit.js";
|
import useMinuit from "react-native-minuit/src/hooks/useMinuit.js";
|
||||||
import { ai } from "../../assets";
|
import { ai } from "../../assets";
|
||||||
import BorderGradientButton from "../../components/BorderGradientButton";
|
import BorderGradientButton from "../../components/BorderGradientButton";
|
||||||
import FullscreenIntroVideo from "../../components/FullscreenIntroVideo.web";
|
import FullscreenIntroVideo from "../../components/FullscreenIntroVideo";
|
||||||
import GradientButton from "../../components/GradientButton";
|
import GradientButton from "../../components/GradientButton";
|
||||||
import MusicLandHeader from "../../components/MusicLandHeader";
|
import MusicLandHeader from "../../components/MusicLandHeader";
|
||||||
import Page from "../../layouts/Page";
|
import Page from "../../layouts/Page";
|
||||||
|
|||||||
Reference in New Issue
Block a user