fix: artist name

This commit is contained in:
Victor
2026-02-27 10:15:29 +01:00
parent c6da7acb38
commit a3f03e5a81
4 changed files with 92 additions and 39 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ module.exports = {
'prettier/prettier': [ 'prettier/prettier': [
'error', 'error',
{ {
singleQuote: false, singleQuote: true,
}, },
], ],
}, },
+1 -1
View File
@@ -92,7 +92,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1 versionCode 1
versionName "0.0.2" versionName "2026.02.18"
} }
signingConfigs { signingConfigs {
debug { debug {
+57 -3
View File
@@ -1,6 +1,6 @@
import { BlurView } from 'expo-blur' import { BlurView } from 'expo-blur'
import React, { useCallback, useEffect, useMemo, useState } from 'react' import React, { useCallback, useEffect, useMemo, useState } from 'react'
import { Modal, Pressable, StyleSheet, Text, View } from 'react-native' import { Modal, Platform, Pressable, StyleSheet, Text, View } from 'react-native'
import useMinuit from 'react-native-minuit/src/hooks/useMinuit' import useMinuit from 'react-native-minuit/src/hooks/useMinuit'
import BorderGradientButton from '../../components/BorderGradientButton' import BorderGradientButton from '../../components/BorderGradientButton'
import FullscreenIntroVideo from '../../components/FullscreenIntroVideo' import FullscreenIntroVideo from '../../components/FullscreenIntroVideo'
@@ -18,9 +18,12 @@ import { buildFullName } from '../../utils/artistName'
import { background } from '../../assets' import { background } from '../../assets'
export const ChooseCoverType = () => { export const ChooseCoverType = () => {
const isIOS = Platform.OS === 'ios'
const [showIntro, setShowIntro] = useState(true) const [showIntro, setShowIntro] = useState(true)
const [choiceVisible, setChoiceVisible] = useState(false) const [choiceVisible, setChoiceVisible] = useState(false)
const [pseudoVisible, setPseudoVisible] = useState(false) const [pseudoVisible, setPseudoVisible] = useState(false)
const [choiceDismissAction, setChoiceDismissAction] = useState(null)
const [pseudoDismissAction, setPseudoDismissAction] = useState(null)
const [pseudo, setPseudo] = useState('') const [pseudo, setPseudo] = useState('')
const [pendingAction, setPendingAction] = useState(null) const [pendingAction, setPendingAction] = useState(null)
const [savingChoice, setSavingChoice] = useState(false) const [savingChoice, setSavingChoice] = useState(false)
@@ -115,13 +118,45 @@ export const ChooseCoverType = () => {
const closeChoiceModal = useCallback(() => { const closeChoiceModal = useCallback(() => {
setChoiceVisible(false) setChoiceVisible(false)
setChoiceDismissAction(null)
setPendingAction(null) setPendingAction(null)
}, []) }, [])
const openPseudoModal = useCallback(() => { const openPseudoModal = useCallback(() => {
if (isIOS) {
setChoiceDismissAction('OPEN_PSEUDO')
setChoiceVisible(false)
return
}
setChoiceVisible(false) setChoiceVisible(false)
setPseudoVisible(true) setPseudoVisible(true)
}, []) }, [isIOS])
const handleChoiceModalDismiss = useCallback(async () => {
if (choiceDismissAction === 'OPEN_PSEUDO') {
setChoiceDismissAction(null)
setPseudoVisible(true)
return
}
if (choiceDismissAction === 'RUN_PENDING_ACTION') {
setChoiceDismissAction(null)
await runPendingAction()
return
}
setChoiceDismissAction(null)
}, [choiceDismissAction, runPendingAction])
const handlePseudoModalDismiss = useCallback(async () => {
if (pseudoDismissAction === 'RUN_PENDING_ACTION') {
setPseudoDismissAction(null)
await runPendingAction()
return
}
setPseudoDismissAction(null)
}, [pseudoDismissAction, runPendingAction])
const handleUseRealName = useCallback(async () => { const handleUseRealName = useCallback(async () => {
if (!currentUID) return if (!currentUID) return
@@ -130,8 +165,13 @@ export const ChooseCoverType = () => {
type: 'error', type: 'error',
text: "Renseigne ton prénom et nom dans ton profil ou crée un nom d'artiste.", text: "Renseigne ton prénom et nom dans ton profil ou crée un nom d'artiste.",
}) })
if (isIOS) {
setChoiceDismissAction('OPEN_PSEUDO')
setChoiceVisible(false)
} else {
setChoiceVisible(false) setChoiceVisible(false)
setPseudoVisible(true) setPseudoVisible(true)
}
return return
} }
@@ -146,8 +186,13 @@ export const ChooseCoverType = () => {
await usersRef.doc(currentUID).set(updates, { merge: true }) await usersRef.doc(currentUID).set(updates, { merge: true })
await applyDisplayNameToProjects(realName) await applyDisplayNameToProjects(realName)
setTooltip({ type: 'success', text: "Nom d'artiste mis à jour" }) setTooltip({ type: 'success', text: "Nom d'artiste mis à jour" })
if (isIOS) {
setChoiceDismissAction('RUN_PENDING_ACTION')
setChoiceVisible(false)
} else {
setChoiceVisible(false) setChoiceVisible(false)
await runPendingAction() await runPendingAction()
}
} catch (e) { } catch (e) {
console.log('handleUseRealName error', e?.message) console.log('handleUseRealName error', e?.message)
setTooltip({ setTooltip({
@@ -165,10 +210,12 @@ export const ChooseCoverType = () => {
realName, realName,
runPendingAction, runPendingAction,
setTooltip, setTooltip,
isIOS,
]) ])
const handleCancelPseudo = useCallback(() => { const handleCancelPseudo = useCallback(() => {
setPseudoVisible(false) setPseudoVisible(false)
setPseudoDismissAction(null)
setPendingAction(null) setPendingAction(null)
}, []) }, [])
@@ -195,8 +242,13 @@ export const ChooseCoverType = () => {
) )
await applyDisplayNameToProjects(value) await applyDisplayNameToProjects(value)
setTooltip({ type: 'success', text: 'Pseudo enregistré' }) setTooltip({ type: 'success', text: 'Pseudo enregistré' })
if (isIOS) {
setPseudoDismissAction('RUN_PENDING_ACTION')
setPseudoVisible(false)
} else {
setPseudoVisible(false) setPseudoVisible(false)
await runPendingAction() await runPendingAction()
}
} catch (e) { } catch (e) {
console.log('handleSavePseudo error', e?.message) console.log('handleSavePseudo error', e?.message)
setTooltip({ setTooltip({
@@ -206,7 +258,7 @@ export const ChooseCoverType = () => {
} finally { } finally {
setSavingPseudo(false) setSavingPseudo(false)
} }
}, [applyDisplayNameToProjects, currentUID, pseudo, runPendingAction, setTooltip]) }, [applyDisplayNameToProjects, currentUID, pseudo, runPendingAction, setTooltip, isIOS])
return ( return (
<Page backgroundImg={background.studioBG2} backgroundColor={'#2A2E33'} headerType="NONE"> <Page backgroundImg={background.studioBG2} backgroundColor={'#2A2E33'} headerType="NONE">
@@ -238,6 +290,7 @@ export const ChooseCoverType = () => {
transparent transparent
animationType="fade" animationType="fade"
onRequestClose={closeChoiceModal} onRequestClose={closeChoiceModal}
onDismiss={handleChoiceModalDismiss}
> >
<View style={styles.modalBackdrop}> <View style={styles.modalBackdrop}>
<Pressable <Pressable
@@ -272,6 +325,7 @@ export const ChooseCoverType = () => {
transparent transparent
animationType="fade" animationType="fade"
onRequestClose={handleCancelPseudo} onRequestClose={handleCancelPseudo}
onDismiss={handlePseudoModalDismiss}
> >
<View style={styles.modalBackdrop}> <View style={styles.modalBackdrop}>
<Pressable <Pressable
+27 -28
View File
@@ -1112,14 +1112,14 @@
dependencies: dependencies:
uuid "^8.0.0" uuid "^8.0.0"
"@expo/cli@0.22.26": "@expo/cli@0.22.28":
version "0.22.26" version "0.22.28"
resolved "https://registry.npmjs.org/@expo/cli/-/cli-0.22.26.tgz" resolved "https://registry.yarnpkg.com/@expo/cli/-/cli-0.22.28.tgz#f4b3250164fc13dfefb130971753734984d1b81b"
integrity sha512-I689wc8Fn/AX7aUGiwrh3HnssiORMJtR2fpksX+JIe8Cj/EDleblYMSwRPd0025wrwOV9UN1KM/RuEt/QjCS3Q== integrity sha512-lvt72KNitGuixYD2l3SZmRKVu2G4zJpmg5V7WfUBNpmUU5oODBw/6qmiJ6kSLAlfDozscUk+BBGknBBzxUrwrA==
dependencies: dependencies:
"@0no-co/graphql.web" "^1.0.8" "@0no-co/graphql.web" "^1.0.8"
"@babel/runtime" "^7.20.0" "@babel/runtime" "^7.20.0"
"@expo/code-signing-certificates" "^0.0.5" "@expo/code-signing-certificates" "^0.0.6"
"@expo/config" "~10.0.11" "@expo/config" "~10.0.11"
"@expo/config-plugins" "~9.0.17" "@expo/config-plugins" "~9.0.17"
"@expo/devcert" "^1.1.2" "@expo/devcert" "^1.1.2"
@@ -1161,7 +1161,7 @@
is-wsl "^2.1.1" is-wsl "^2.1.1"
lodash.debounce "^4.0.8" lodash.debounce "^4.0.8"
minimatch "^3.0.4" minimatch "^3.0.4"
node-forge "^1.3.1" node-forge "^1.3.3"
npm-package-arg "^11.0.0" npm-package-arg "^11.0.0"
ora "^3.4.0" ora "^3.4.0"
picomatch "^3.0.1" picomatch "^3.0.1"
@@ -1190,13 +1190,12 @@
wrap-ansi "^7.0.0" wrap-ansi "^7.0.0"
ws "^8.12.1" ws "^8.12.1"
"@expo/code-signing-certificates@^0.0.5": "@expo/code-signing-certificates@^0.0.6":
version "0.0.5" version "0.0.6"
resolved "https://registry.npmjs.org/@expo/code-signing-certificates/-/code-signing-certificates-0.0.5.tgz" resolved "https://registry.yarnpkg.com/@expo/code-signing-certificates/-/code-signing-certificates-0.0.6.tgz#6b7b22830cb69c77a45e357c2f3aa7ab436ac772"
integrity sha512-BNhXkY1bblxKZpltzAx98G2Egj9g1Q+JRcvR7E99DOj862FTCX+ZPsAUtPTr7aHxwtrL7+fL3r0JSmM9kBm+Bw== integrity sha512-iNe0puxwBNEcuua9gmTGzq+SuMDa0iATai1FlFTMHJ/vUmKvN/V//drXoLJkVb5i5H3iE/n/qIJxyoBnXouD0w==
dependencies: dependencies:
node-forge "^1.2.1" node-forge "^1.3.3"
nullthrows "^1.1.1"
"@expo/config-plugins@~9.0.17": "@expo/config-plugins@~9.0.17":
version "9.0.17" version "9.0.17"
@@ -3337,10 +3336,10 @@ babel-preset-current-node-syntax@^1.0.0:
"@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-private-property-in-object" "^7.14.5"
"@babel/plugin-syntax-top-level-await" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5"
babel-preset-expo@~12.0.11: babel-preset-expo@~12.0.12:
version "12.0.11" version "12.0.12"
resolved "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-12.0.11.tgz" resolved "https://registry.yarnpkg.com/babel-preset-expo/-/babel-preset-expo-12.0.12.tgz#9950ed477c076d6fae6b6b1da2797c058a6fbca1"
integrity sha512-4m6D92nKEieg+7DXa8uSvpr0GjfuRfM/G0t0I/Q5hF8HleEv5ms3z4dJ+p52qXSJsm760tMqLdO93Ywuoi7cCQ== integrity sha512-qAuaGGZIN//DyQVackP7Czr1SMq5dYb5tpu/uQqL/f1bRARb74r+kBWQRLJGxQ3QujsEw13SyAodCZIOUoD6KQ==
dependencies: dependencies:
"@babel/plugin-proposal-decorators" "^7.12.9" "@babel/plugin-proposal-decorators" "^7.12.9"
"@babel/plugin-transform-export-namespace-from" "^7.22.11" "@babel/plugin-transform-export-namespace-from" "^7.22.11"
@@ -5234,11 +5233,6 @@ expo-json-utils@~0.14.0:
resolved "https://registry.npmjs.org/expo-json-utils/-/expo-json-utils-0.14.0.tgz" resolved "https://registry.npmjs.org/expo-json-utils/-/expo-json-utils-0.14.0.tgz"
integrity sha512-xjGfK9dL0B1wLnOqNkX0jM9p48Y0I5xEPzHude28LY67UmamUyAACkqhZGaPClyPNfdzczk7Ej6WaRMT3HfXvw== integrity sha512-xjGfK9dL0B1wLnOqNkX0jM9p48Y0I5xEPzHude28LY67UmamUyAACkqhZGaPClyPNfdzczk7Ej6WaRMT3HfXvw==
expo-keep-awake@^15.0.8:
version "15.0.8"
resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-15.0.8.tgz#911c5effeba9baff2ccde79ef0ff5bf856215f8d"
integrity sha512-YK9M1VrnoH1vLJiQzChZgzDvVimVoriibiDIFLbQMpjYBnvyfUeHJcin/Gx1a+XgupNXy92EQJLgI/9ZuXajYQ==
expo-keep-awake@~14.0.3: expo-keep-awake@~14.0.3:
version "14.0.3" version "14.0.3"
resolved "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-14.0.3.tgz" resolved "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-14.0.3.tgz"
@@ -5354,19 +5348,19 @@ expo-web-browser@~14.0.2:
resolved "https://registry.npmjs.org/expo-web-browser/-/expo-web-browser-14.0.2.tgz" resolved "https://registry.npmjs.org/expo-web-browser/-/expo-web-browser-14.0.2.tgz"
integrity sha512-Hncv2yojhTpHbP6SGWARBFdl7P6wBHc1O8IKaNsH0a/IEakq887o1eRhLxZ5IwztPQyRDhpqHdgJ+BjWolOnwA== integrity sha512-Hncv2yojhTpHbP6SGWARBFdl7P6wBHc1O8IKaNsH0a/IEakq887o1eRhLxZ5IwztPQyRDhpqHdgJ+BjWolOnwA==
expo@~52.0.47: expo@~52.0.49:
version "52.0.47" version "52.0.49"
resolved "https://registry.npmjs.org/expo/-/expo-52.0.47.tgz" resolved "https://registry.yarnpkg.com/expo/-/expo-52.0.49.tgz#b73982759b822f5e93dcaa49cf1fbc97d90faea9"
integrity sha512-Mkvl7Qi2k+V3FdNRUD+yDj8GqU4IiYulLfl36BmSZs8lh/kCYPhTiyBLiEGPfz7d25QKbPWG727ESozbkbvatw== integrity sha512-ge3gUnuyGEePWWKzPY7TQ7FsvtFTdmsdYDHeBVUjMr9KIoQig/gf8A03oH26p3UtTL6sUJcyOIg9vwIHGNPSUw==
dependencies: dependencies:
"@babel/runtime" "^7.20.0" "@babel/runtime" "^7.20.0"
"@expo/cli" "0.22.26" "@expo/cli" "0.22.28"
"@expo/config" "~10.0.11" "@expo/config" "~10.0.11"
"@expo/config-plugins" "~9.0.17" "@expo/config-plugins" "~9.0.17"
"@expo/fingerprint" "0.11.11" "@expo/fingerprint" "0.11.11"
"@expo/metro-config" "0.19.12" "@expo/metro-config" "0.19.12"
"@expo/vector-icons" "~14.0.4" "@expo/vector-icons" "~14.0.4"
babel-preset-expo "~12.0.11" babel-preset-expo "~12.0.12"
expo-asset "~11.0.5" expo-asset "~11.0.5"
expo-constants "~17.0.8" expo-constants "~17.0.8"
expo-file-system "~18.0.12" expo-file-system "~18.0.12"
@@ -7970,11 +7964,16 @@ node-fetch@^2.2.0, node-fetch@^2.6.1, node-fetch@^2.7.0:
dependencies: dependencies:
whatwg-url "^5.0.0" whatwg-url "^5.0.0"
node-forge@^1, node-forge@^1.2.1, node-forge@^1.3.1: node-forge@^1:
version "1.3.1" version "1.3.1"
resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz" resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz"
integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==
node-forge@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.3.tgz#0ad80f6333b3a0045e827ac20b7f735f93716751"
integrity sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==
node-int64@^0.4.0: node-int64@^0.4.0:
version "0.4.0" version "0.4.0"
resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz" resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz"