From 87069f5fe46f26ca334c6e730de6a62b742c0bb2 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 9 Apr 2023 22:17:46 +0200 Subject: [PATCH 1/2] Correct some errors :bug: --- src/FLAD/redux/store.tsx | 2 +- src/FLAD/screens/Register.tsx | 23 +++++++++++++++++++++- src/FLAD/screens/Setting.tsx | 36 +++++++++++++++++++---------------- src/FLAD/screens/spot.tsx | 2 +- 4 files changed, 44 insertions(+), 19 deletions(-) diff --git a/src/FLAD/redux/store.tsx b/src/FLAD/redux/store.tsx index 336bd56..663d697 100644 --- a/src/FLAD/redux/store.tsx +++ b/src/FLAD/redux/store.tsx @@ -16,7 +16,7 @@ const store = configureStore({ reducer: reducer, middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: { - ignoredActions: [spotTypes.FETCH_SPOT, spotifyTypes.GET_USER_CURRENT_MUSIC, favoritesTypes.ADD_FAVORITE_MUSICS, favoritesTypes.REMOVE_FAVORITE_MUSICS, spotTypes.REMOVE_SPOT ], + ignoredActions: [spotTypes.FETCH_SPOT, spotifyTypes.GET_USER_CURRENT_MUSIC, favoritesTypes.ADD_FAVORITE_MUSICS, favoritesTypes.REMOVE_FAVORITE_MUSICS, spotTypes.REMOVE_SPOT, userTypes.LOGIN, userTypes.SIGNUP ], ignoredActionPaths: ['appReducer'], ignoredPaths: ['appReducer', 'userReducer'] } diff --git a/src/FLAD/screens/Register.tsx b/src/FLAD/screens/Register.tsx index 1e675ba..d701c84 100644 --- a/src/FLAD/screens/Register.tsx +++ b/src/FLAD/screens/Register.tsx @@ -10,6 +10,8 @@ import { useDispatch, useSelector } from 'react-redux'; import { Audio } from 'expo-av'; import { CredentialsRegister } from '../redux/actions/userActions'; import * as WebBrowser from 'expo-web-browser'; +import { spotArray2 } from '../data/data'; +import { setSpotList } from '../redux/actions/spotActions'; // @ts-ignore const DismissKeyboard = ({ children }) => ( @@ -48,18 +50,37 @@ export default function InscriptionPage() { const dispatch = useDispatch(); + function addMockSpots() { + dispatch(setSpotList(spotArray2)) + } + const submitForm = () => { const credentials: CredentialsRegister = { email: email, password: password, idSpotify: spotifyToken, name: username, - idFlad: "9835698" + idFlad: generateRandomString() }; //@ts-ignore dispatch(registerUser(credentials)) + addMockSpots() playSound() } + + function generateRandomString(): string { + const alphabet = 'abcdefghijklmnopqrstuvwxyz'; + let randomString = ''; + + for (let i = 0; i < 8; i++) { + const randomIndex = Math.floor(Math.random() * alphabet.length); + const randomChar = alphabet[randomIndex]; + randomString += randomChar; + } + + return randomString; + } + const getTokens2 = async () => { try { const redirectUri = AuthSession.makeRedirectUri(); diff --git a/src/FLAD/screens/Setting.tsx b/src/FLAD/screens/Setting.tsx index d312ee0..75ec7fd 100644 --- a/src/FLAD/screens/Setting.tsx +++ b/src/FLAD/screens/Setting.tsx @@ -266,10 +266,10 @@ export default function Setting() { - navigation.navigate('SettingProfil')} - > + > @@ -320,21 +320,25 @@ export default function Setting() { - - - - - - - - - En cours d’écoute... - + {currentMusic ? ( + <> + + + + + + + + + En cours d’écoute... + - - - - + + + + + + ) : <>} diff --git a/src/FLAD/screens/spot.tsx b/src/FLAD/screens/spot.tsx index c5e96f0..92f66e4 100644 --- a/src/FLAD/screens/spot.tsx +++ b/src/FLAD/screens/spot.tsx @@ -159,7 +159,7 @@ export default function SpotPage() { Vous avez explorer toutes les spot autour de vous. - {"\n"}Continuer dans discoverie pour découvrir de nouvelles music basées dur vos gouts musicaux. + {"\n"}Continuer dans discoverie pour découvrir de nouvelles music basées sur vos gouts musicaux. ) } From 7a32502567d6d81d494f823e9990a5439cb148e9 Mon Sep 17 00:00:00 2001 From: David D'ALMEIDA Date: Sun, 9 Apr 2023 22:21:30 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'README.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fbe10d8..39a00ee 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ :information_source: Ce projet est un travail universitaire pour la deuxième année du B.U.T Informatique de Clermont-Ferrand. -## Répartition du Gitlab +## Répartition du Git La racine de notre gitlab est composée de deux dossiers essentiels au projet: