fix: artist name
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ module.exports = {
|
||||
'prettier/prettier': [
|
||||
'error',
|
||||
{
|
||||
singleQuote: false,
|
||||
singleQuote: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -92,7 +92,7 @@ android {
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 1
|
||||
versionName "0.0.2"
|
||||
versionName "2026.02.18"
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { BlurView } from 'expo-blur'
|
||||
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 BorderGradientButton from '../../components/BorderGradientButton'
|
||||
import FullscreenIntroVideo from '../../components/FullscreenIntroVideo'
|
||||
@@ -18,9 +18,12 @@ import { buildFullName } from '../../utils/artistName'
|
||||
import { background } from '../../assets'
|
||||
|
||||
export const ChooseCoverType = () => {
|
||||
const isIOS = Platform.OS === 'ios'
|
||||
const [showIntro, setShowIntro] = useState(true)
|
||||
const [choiceVisible, setChoiceVisible] = useState(false)
|
||||
const [pseudoVisible, setPseudoVisible] = useState(false)
|
||||
const [choiceDismissAction, setChoiceDismissAction] = useState(null)
|
||||
const [pseudoDismissAction, setPseudoDismissAction] = useState(null)
|
||||
const [pseudo, setPseudo] = useState('')
|
||||
const [pendingAction, setPendingAction] = useState(null)
|
||||
const [savingChoice, setSavingChoice] = useState(false)
|
||||
@@ -115,13 +118,45 @@ export const ChooseCoverType = () => {
|
||||
|
||||
const closeChoiceModal = useCallback(() => {
|
||||
setChoiceVisible(false)
|
||||
setChoiceDismissAction(null)
|
||||
setPendingAction(null)
|
||||
}, [])
|
||||
|
||||
const openPseudoModal = useCallback(() => {
|
||||
if (isIOS) {
|
||||
setChoiceDismissAction('OPEN_PSEUDO')
|
||||
setChoiceVisible(false)
|
||||
return
|
||||
}
|
||||
setChoiceVisible(false)
|
||||
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 () => {
|
||||
if (!currentUID) return
|
||||
@@ -130,8 +165,13 @@ export const ChooseCoverType = () => {
|
||||
type: 'error',
|
||||
text: "Renseigne ton prénom et nom dans ton profil ou crée un nom d'artiste.",
|
||||
})
|
||||
setChoiceVisible(false)
|
||||
setPseudoVisible(true)
|
||||
if (isIOS) {
|
||||
setChoiceDismissAction('OPEN_PSEUDO')
|
||||
setChoiceVisible(false)
|
||||
} else {
|
||||
setChoiceVisible(false)
|
||||
setPseudoVisible(true)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -146,8 +186,13 @@ export const ChooseCoverType = () => {
|
||||
await usersRef.doc(currentUID).set(updates, { merge: true })
|
||||
await applyDisplayNameToProjects(realName)
|
||||
setTooltip({ type: 'success', text: "Nom d'artiste mis à jour" })
|
||||
setChoiceVisible(false)
|
||||
await runPendingAction()
|
||||
if (isIOS) {
|
||||
setChoiceDismissAction('RUN_PENDING_ACTION')
|
||||
setChoiceVisible(false)
|
||||
} else {
|
||||
setChoiceVisible(false)
|
||||
await runPendingAction()
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('handleUseRealName error', e?.message)
|
||||
setTooltip({
|
||||
@@ -165,10 +210,12 @@ export const ChooseCoverType = () => {
|
||||
realName,
|
||||
runPendingAction,
|
||||
setTooltip,
|
||||
isIOS,
|
||||
])
|
||||
|
||||
const handleCancelPseudo = useCallback(() => {
|
||||
setPseudoVisible(false)
|
||||
setPseudoDismissAction(null)
|
||||
setPendingAction(null)
|
||||
}, [])
|
||||
|
||||
@@ -195,8 +242,13 @@ export const ChooseCoverType = () => {
|
||||
)
|
||||
await applyDisplayNameToProjects(value)
|
||||
setTooltip({ type: 'success', text: 'Pseudo enregistré' })
|
||||
setPseudoVisible(false)
|
||||
await runPendingAction()
|
||||
if (isIOS) {
|
||||
setPseudoDismissAction('RUN_PENDING_ACTION')
|
||||
setPseudoVisible(false)
|
||||
} else {
|
||||
setPseudoVisible(false)
|
||||
await runPendingAction()
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('handleSavePseudo error', e?.message)
|
||||
setTooltip({
|
||||
@@ -206,7 +258,7 @@ export const ChooseCoverType = () => {
|
||||
} finally {
|
||||
setSavingPseudo(false)
|
||||
}
|
||||
}, [applyDisplayNameToProjects, currentUID, pseudo, runPendingAction, setTooltip])
|
||||
}, [applyDisplayNameToProjects, currentUID, pseudo, runPendingAction, setTooltip, isIOS])
|
||||
|
||||
return (
|
||||
<Page backgroundImg={background.studioBG2} backgroundColor={'#2A2E33'} headerType="NONE">
|
||||
@@ -238,6 +290,7 @@ export const ChooseCoverType = () => {
|
||||
transparent
|
||||
animationType="fade"
|
||||
onRequestClose={closeChoiceModal}
|
||||
onDismiss={handleChoiceModalDismiss}
|
||||
>
|
||||
<View style={styles.modalBackdrop}>
|
||||
<Pressable
|
||||
@@ -272,6 +325,7 @@ export const ChooseCoverType = () => {
|
||||
transparent
|
||||
animationType="fade"
|
||||
onRequestClose={handleCancelPseudo}
|
||||
onDismiss={handlePseudoModalDismiss}
|
||||
>
|
||||
<View style={styles.modalBackdrop}>
|
||||
<Pressable
|
||||
|
||||
@@ -1112,14 +1112,14 @@
|
||||
dependencies:
|
||||
uuid "^8.0.0"
|
||||
|
||||
"@expo/cli@0.22.26":
|
||||
version "0.22.26"
|
||||
resolved "https://registry.npmjs.org/@expo/cli/-/cli-0.22.26.tgz"
|
||||
integrity sha512-I689wc8Fn/AX7aUGiwrh3HnssiORMJtR2fpksX+JIe8Cj/EDleblYMSwRPd0025wrwOV9UN1KM/RuEt/QjCS3Q==
|
||||
"@expo/cli@0.22.28":
|
||||
version "0.22.28"
|
||||
resolved "https://registry.yarnpkg.com/@expo/cli/-/cli-0.22.28.tgz#f4b3250164fc13dfefb130971753734984d1b81b"
|
||||
integrity sha512-lvt72KNitGuixYD2l3SZmRKVu2G4zJpmg5V7WfUBNpmUU5oODBw/6qmiJ6kSLAlfDozscUk+BBGknBBzxUrwrA==
|
||||
dependencies:
|
||||
"@0no-co/graphql.web" "^1.0.8"
|
||||
"@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-plugins" "~9.0.17"
|
||||
"@expo/devcert" "^1.1.2"
|
||||
@@ -1161,7 +1161,7 @@
|
||||
is-wsl "^2.1.1"
|
||||
lodash.debounce "^4.0.8"
|
||||
minimatch "^3.0.4"
|
||||
node-forge "^1.3.1"
|
||||
node-forge "^1.3.3"
|
||||
npm-package-arg "^11.0.0"
|
||||
ora "^3.4.0"
|
||||
picomatch "^3.0.1"
|
||||
@@ -1190,13 +1190,12 @@
|
||||
wrap-ansi "^7.0.0"
|
||||
ws "^8.12.1"
|
||||
|
||||
"@expo/code-signing-certificates@^0.0.5":
|
||||
version "0.0.5"
|
||||
resolved "https://registry.npmjs.org/@expo/code-signing-certificates/-/code-signing-certificates-0.0.5.tgz"
|
||||
integrity sha512-BNhXkY1bblxKZpltzAx98G2Egj9g1Q+JRcvR7E99DOj862FTCX+ZPsAUtPTr7aHxwtrL7+fL3r0JSmM9kBm+Bw==
|
||||
"@expo/code-signing-certificates@^0.0.6":
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/@expo/code-signing-certificates/-/code-signing-certificates-0.0.6.tgz#6b7b22830cb69c77a45e357c2f3aa7ab436ac772"
|
||||
integrity sha512-iNe0puxwBNEcuua9gmTGzq+SuMDa0iATai1FlFTMHJ/vUmKvN/V//drXoLJkVb5i5H3iE/n/qIJxyoBnXouD0w==
|
||||
dependencies:
|
||||
node-forge "^1.2.1"
|
||||
nullthrows "^1.1.1"
|
||||
node-forge "^1.3.3"
|
||||
|
||||
"@expo/config-plugins@~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-top-level-await" "^7.14.5"
|
||||
|
||||
babel-preset-expo@~12.0.11:
|
||||
version "12.0.11"
|
||||
resolved "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-12.0.11.tgz"
|
||||
integrity sha512-4m6D92nKEieg+7DXa8uSvpr0GjfuRfM/G0t0I/Q5hF8HleEv5ms3z4dJ+p52qXSJsm760tMqLdO93Ywuoi7cCQ==
|
||||
babel-preset-expo@~12.0.12:
|
||||
version "12.0.12"
|
||||
resolved "https://registry.yarnpkg.com/babel-preset-expo/-/babel-preset-expo-12.0.12.tgz#9950ed477c076d6fae6b6b1da2797c058a6fbca1"
|
||||
integrity sha512-qAuaGGZIN//DyQVackP7Czr1SMq5dYb5tpu/uQqL/f1bRARb74r+kBWQRLJGxQ3QujsEw13SyAodCZIOUoD6KQ==
|
||||
dependencies:
|
||||
"@babel/plugin-proposal-decorators" "^7.12.9"
|
||||
"@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"
|
||||
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:
|
||||
version "14.0.3"
|
||||
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"
|
||||
integrity sha512-Hncv2yojhTpHbP6SGWARBFdl7P6wBHc1O8IKaNsH0a/IEakq887o1eRhLxZ5IwztPQyRDhpqHdgJ+BjWolOnwA==
|
||||
|
||||
expo@~52.0.47:
|
||||
version "52.0.47"
|
||||
resolved "https://registry.npmjs.org/expo/-/expo-52.0.47.tgz"
|
||||
integrity sha512-Mkvl7Qi2k+V3FdNRUD+yDj8GqU4IiYulLfl36BmSZs8lh/kCYPhTiyBLiEGPfz7d25QKbPWG727ESozbkbvatw==
|
||||
expo@~52.0.49:
|
||||
version "52.0.49"
|
||||
resolved "https://registry.yarnpkg.com/expo/-/expo-52.0.49.tgz#b73982759b822f5e93dcaa49cf1fbc97d90faea9"
|
||||
integrity sha512-ge3gUnuyGEePWWKzPY7TQ7FsvtFTdmsdYDHeBVUjMr9KIoQig/gf8A03oH26p3UtTL6sUJcyOIg9vwIHGNPSUw==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.20.0"
|
||||
"@expo/cli" "0.22.26"
|
||||
"@expo/cli" "0.22.28"
|
||||
"@expo/config" "~10.0.11"
|
||||
"@expo/config-plugins" "~9.0.17"
|
||||
"@expo/fingerprint" "0.11.11"
|
||||
"@expo/metro-config" "0.19.12"
|
||||
"@expo/vector-icons" "~14.0.4"
|
||||
babel-preset-expo "~12.0.11"
|
||||
babel-preset-expo "~12.0.12"
|
||||
expo-asset "~11.0.5"
|
||||
expo-constants "~17.0.8"
|
||||
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:
|
||||
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"
|
||||
resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz"
|
||||
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:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz"
|
||||
|
||||
Reference in New Issue
Block a user