diff --git a/src/FLAD/Model/Artist.tsx b/src/FLAD/Model/Artist.ts similarity index 86% rename from src/FLAD/Model/Artist.tsx rename to src/FLAD/Model/Artist.ts index dac88f0..044b687 100644 --- a/src/FLAD/Model/Artist.tsx +++ b/src/FLAD/Model/Artist.ts @@ -1,7 +1,7 @@ export default class Artist { private id: string; private name: string; - private _url: string; // Image.source + private _url: string; constructor(id: string, name: string, url: string) { this.id = id; diff --git a/src/FLAD/Model/Spot.tsx b/src/FLAD/Model/Spot.ts similarity index 100% rename from src/FLAD/Model/Spot.tsx rename to src/FLAD/Model/Spot.ts diff --git a/src/FLAD/Model/User.tsx b/src/FLAD/Model/User.ts similarity index 80% rename from src/FLAD/Model/User.tsx rename to src/FLAD/Model/User.ts index 52c8896..f960916 100644 --- a/src/FLAD/Model/User.tsx +++ b/src/FLAD/Model/User.ts @@ -1,11 +1,10 @@ export class User { - //attributes from DAFL private _idFlad: string; private _idSpotify: string; private _email: string; private _createdAt: Date; private _name: string; - public image: string = require('../assets/images/jul.png'); + public image: string; //constructors constructor(idFlad: string, idSpotify: string, email: string, createdAt: Date, name: string, image: string) { @@ -33,10 +32,6 @@ export class User { return this._name; } - static empty() { - return new User('', '', '', new Date(), '', require('../assets/images/jul.png')); - } - toString() { return 'User : ' + this.idFlad + ', ' + this.name + ', ' + this.idSpotify; } diff --git a/src/FLAD/Model/factory/MusicFactory.ts b/src/FLAD/Model/mapper/MusicMapper.ts similarity index 88% rename from src/FLAD/Model/factory/MusicFactory.ts rename to src/FLAD/Model/mapper/MusicMapper.ts index 9b548e0..fb91b72 100644 --- a/src/FLAD/Model/factory/MusicFactory.ts +++ b/src/FLAD/Model/mapper/MusicMapper.ts @@ -1,6 +1,6 @@ import Music from "../Music"; -export default class MusicFactory { +export default class MusicMapper { static mapFromSpotifyTrack(jsonMusic: any): Music { const music = new Music( jsonMusic.id, diff --git a/src/FLAD/Model/factory/UserFactory.tsx b/src/FLAD/Model/mapper/UserMapper.ts similarity index 93% rename from src/FLAD/Model/factory/UserFactory.tsx rename to src/FLAD/Model/mapper/UserMapper.ts index 105b4b0..c687481 100644 --- a/src/FLAD/Model/factory/UserFactory.tsx +++ b/src/FLAD/Model/mapper/UserMapper.ts @@ -1,6 +1,6 @@ import { User } from "../User"; -export class UserFactory { +export class UserMapper { public static JsonToModel( jsonUser :any ) : User{ return new User(jsonUser.idFlad, jsonUser.idSpotify, jsonUser.email, jsonUser.createdAt, jsonUser.name, jsonUser.imageUrl); diff --git a/src/FLAD/app.json b/src/FLAD/app.json index 2d685f4..424b35e 100644 --- a/src/FLAD/app.json +++ b/src/FLAD/app.json @@ -4,10 +4,10 @@ "slug": "FLAD", "version": "1.0.0", "orientation": "portrait", - "icon": "./assets/icons/icon.png", + "icon": "./assets/images/icon.png", "userInterfaceStyle": "automatic", "splash": { - "image": "./assets/icons/splash.png", + "image": "./assets/images/splash.png", "resizeMode": "contain", "backgroundColor": "#1d2129" }, @@ -28,12 +28,12 @@ }, "android": { "adaptiveIcon": { - "foregroundImage": "./assets/icons/adaptive-icon.png", + "foregroundImage": "./assets/images/adaptive-icon.png", "backgroundColor": "#FFFFFF" } }, "web": { - "favicon": "./assets/icons/favicon.png" + "favicon": "./assets/images/favicon.png" }, "plugins": [ [ diff --git a/src/FLAD/assets/icon.ts b/src/FLAD/assets/icon.ts new file mode 100644 index 0000000..d721c5e --- /dev/null +++ b/src/FLAD/assets/icon.ts @@ -0,0 +1,12 @@ + +const Icons = { + discovery: require('./images/icon_discovery.png'), + like: require('./images/icon_like.png'), + dislike: require('./images/icon_dislike.png'), + bookmark : require('./images/icon_bookmark.svg'), + share : require('./images/Vector.png'), + + // riveLike : require('./light_like.riv'), +} + +export default Icons; diff --git a/src/FLAD/assets/icons/3869-8114-no-background-like.riv b/src/FLAD/assets/icons/3869-8114-no-background-like.riv deleted file mode 100644 index 6deffd5..0000000 Binary files a/src/FLAD/assets/icons/3869-8114-no-background-like.riv and /dev/null differ diff --git a/src/FLAD/assets/icons/colors/colors.tsx b/src/FLAD/assets/icons/colors/colors.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/src/FLAD/assets/icons/colors/theme.tsx b/src/FLAD/assets/icons/colors/theme.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/src/FLAD/assets/icons/icons/Union-1.svg b/src/FLAD/assets/icons/icons/Union-1.svg deleted file mode 100644 index 9a91058..0000000 --- a/src/FLAD/assets/icons/icons/Union-1.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/FLAD/assets/icons/icons/Union-2.svg b/src/FLAD/assets/icons/icons/Union-2.svg deleted file mode 100644 index e61196d..0000000 --- a/src/FLAD/assets/icons/icons/Union-2.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/FLAD/assets/icons/icons/Union.svg b/src/FLAD/assets/icons/icons/Union.svg deleted file mode 100644 index 1efd231..0000000 --- a/src/FLAD/assets/icons/icons/Union.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/FLAD/assets/icons/icons/Vector.png b/src/FLAD/assets/icons/icons/Vector.png deleted file mode 100644 index 34364fb..0000000 Binary files a/src/FLAD/assets/icons/icons/Vector.png and /dev/null differ diff --git a/src/FLAD/assets/icons/icons/discovery.svg b/src/FLAD/assets/icons/icons/discovery.svg deleted file mode 100644 index cfc5c6e..0000000 --- a/src/FLAD/assets/icons/icons/discovery.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/FLAD/assets/icons/icons/edit.png b/src/FLAD/assets/icons/icons/edit.png deleted file mode 100644 index 5f13961..0000000 Binary files a/src/FLAD/assets/icons/icons/edit.png and /dev/null differ diff --git a/src/FLAD/assets/icons/icons/icon.ts b/src/FLAD/assets/icons/icons/icon.ts deleted file mode 100644 index c34f7bc..0000000 --- a/src/FLAD/assets/icons/icons/icon.ts +++ /dev/null @@ -1,12 +0,0 @@ - -const Icons = { - discovery: require('./icon_discovery.png'), - like: require('./icon_like.png'), - dislike: require('./icon_dislike.png'), - bookmark : require('./icon_bookmark.svg'), - share : require('./Vector.png'), - - // riveLike : require('./light_like.riv'), -} - -export default Icons; diff --git a/src/FLAD/assets/icons/adaptive-icon.png b/src/FLAD/assets/images/adaptive-icon.png similarity index 100% rename from src/FLAD/assets/icons/adaptive-icon.png rename to src/FLAD/assets/images/adaptive-icon.png diff --git a/src/FLAD/assets/icons/icons/next.png b/src/FLAD/assets/images/arrow_forward.png similarity index 100% rename from src/FLAD/assets/icons/icons/next.png rename to src/FLAD/assets/images/arrow_forward.png diff --git a/src/FLAD/assets/images/Background_Start_Page.png b/src/FLAD/assets/images/background_start.png similarity index 100% rename from src/FLAD/assets/images/Background_Start_Page.png rename to src/FLAD/assets/images/background_start.png diff --git a/src/FLAD/assets/images/Board_Image.png b/src/FLAD/assets/images/board_1.png similarity index 100% rename from src/FLAD/assets/images/Board_Image.png rename to src/FLAD/assets/images/board_1.png diff --git a/src/FLAD/assets/images/Board_Image2.png b/src/FLAD/assets/images/board_2.png similarity index 100% rename from src/FLAD/assets/images/Board_Image2.png rename to src/FLAD/assets/images/board_2.png diff --git a/src/FLAD/assets/images/Board_Image3.png b/src/FLAD/assets/images/board_3.png similarity index 100% rename from src/FLAD/assets/images/Board_Image3.png rename to src/FLAD/assets/images/board_3.png diff --git a/src/FLAD/assets/icons/icons/icon_bookmark.svg b/src/FLAD/assets/images/bookmark_icon.svg similarity index 100% rename from src/FLAD/assets/icons/icons/icon_bookmark.svg rename to src/FLAD/assets/images/bookmark_icon.svg diff --git a/src/FLAD/assets/icons/Check.png b/src/FLAD/assets/images/check_icon.png similarity index 100% rename from src/FLAD/assets/icons/Check.png rename to src/FLAD/assets/images/check_icon.png diff --git a/src/FLAD/assets/icons/icons/buttonProfil_Inverse.png b/src/FLAD/assets/images/chevron_left_icon.png similarity index 100% rename from src/FLAD/assets/icons/icons/buttonProfil_Inverse.png rename to src/FLAD/assets/images/chevron_left_icon.png diff --git a/src/FLAD/assets/icons/icons/buttonProfil.png b/src/FLAD/assets/images/chevron_right_icon.png similarity index 100% rename from src/FLAD/assets/icons/icons/buttonProfil.png rename to src/FLAD/assets/images/chevron_right_icon.png diff --git a/src/FLAD/assets/icons/icons/croix.png b/src/FLAD/assets/images/cross_icon.png similarity index 100% rename from src/FLAD/assets/icons/icons/croix.png rename to src/FLAD/assets/images/cross_icon.png diff --git a/src/FLAD/assets/icons/icons/icon_discovery.png b/src/FLAD/assets/images/discovery_icon.png similarity index 100% rename from src/FLAD/assets/icons/icons/icon_discovery.png rename to src/FLAD/assets/images/discovery_icon.png diff --git a/src/FLAD/assets/icons/icons/icon_discovery_no_text.png b/src/FLAD/assets/images/discovery_icon_no_text.png similarity index 100% rename from src/FLAD/assets/icons/icons/icon_discovery_no_text.png rename to src/FLAD/assets/images/discovery_icon_no_text.png diff --git a/src/FLAD/assets/icons/icons/icon_dislike.png b/src/FLAD/assets/images/dislike_icon.png similarity index 100% rename from src/FLAD/assets/icons/icons/icon_dislike.png rename to src/FLAD/assets/images/dislike_icon.png diff --git a/src/FLAD/assets/icons/icons/icon_dislike_no_text.png b/src/FLAD/assets/images/dislike_icon_no_text.png similarity index 100% rename from src/FLAD/assets/icons/icons/icon_dislike_no_text.png rename to src/FLAD/assets/images/dislike_icon_no_text.png diff --git a/src/FLAD/assets/icons/favicon.png b/src/FLAD/assets/images/favicon.png similarity index 100% rename from src/FLAD/assets/icons/favicon.png rename to src/FLAD/assets/images/favicon.png diff --git a/src/FLAD/assets/icons/Logo_White_Flad.png b/src/FLAD/assets/images/flad_logo.png similarity index 100% rename from src/FLAD/assets/icons/Logo_White_Flad.png rename to src/FLAD/assets/images/flad_logo.png diff --git a/src/FLAD/assets/icons/Spotify_-_Animation_1.gif b/src/FLAD/assets/images/flad_logo_animation.gif similarity index 100% rename from src/FLAD/assets/icons/Spotify_-_Animation_1.gif rename to src/FLAD/assets/images/flad_logo_animation.gif diff --git a/src/FLAD/assets/images/FLADYHate.png b/src/FLAD/assets/images/flady_angry.png similarity index 100% rename from src/FLAD/assets/images/FLADYHate.png rename to src/FLAD/assets/images/flady_angry.png diff --git a/src/FLAD/assets/images/FLADYCry.png b/src/FLAD/assets/images/flady_cry.png similarity index 100% rename from src/FLAD/assets/images/FLADYCry.png rename to src/FLAD/assets/images/flady_cry.png diff --git a/src/FLAD/assets/images/RedFlady.png b/src/FLAD/assets/images/flady_icon.png similarity index 100% rename from src/FLAD/assets/images/RedFlady.png rename to src/FLAD/assets/images/flady_icon.png diff --git a/src/FLAD/assets/images/FLADYLove.png b/src/FLAD/assets/images/flady_love.png similarity index 100% rename from src/FLAD/assets/images/FLADYLove.png rename to src/FLAD/assets/images/flady_love.png diff --git a/src/FLAD/assets/images/FladyShadow.png b/src/FLAD/assets/images/flady_shadow.png similarity index 100% rename from src/FLAD/assets/images/FladyShadow.png rename to src/FLAD/assets/images/flady_shadow.png diff --git a/src/FLAD/assets/images/FLADYStar.png b/src/FLAD/assets/images/flady_star.png similarity index 100% rename from src/FLAD/assets/images/FLADYStar.png rename to src/FLAD/assets/images/flady_star.png diff --git a/src/FLAD/assets/icons/icon.png b/src/FLAD/assets/images/icon.png similarity index 100% rename from src/FLAD/assets/icons/icon.png rename to src/FLAD/assets/images/icon.png diff --git a/src/FLAD/assets/images/jul.png b/src/FLAD/assets/images/jul.png deleted file mode 100644 index 9ef32e1..0000000 Binary files a/src/FLAD/assets/images/jul.png and /dev/null differ diff --git a/src/FLAD/assets/icons/icons/icon_like.png b/src/FLAD/assets/images/like_icon.png similarity index 100% rename from src/FLAD/assets/icons/icons/icon_like.png rename to src/FLAD/assets/images/like_icon.png diff --git a/src/FLAD/assets/icons/icons/lock.png b/src/FLAD/assets/images/lock_icon.png similarity index 100% rename from src/FLAD/assets/icons/icons/lock.png rename to src/FLAD/assets/images/lock_icon.png diff --git a/src/FLAD/assets/icons/icons/icon_messages.png b/src/FLAD/assets/images/message_icon.png similarity index 100% rename from src/FLAD/assets/icons/icons/icon_messages.png rename to src/FLAD/assets/images/message_icon.png diff --git a/src/FLAD/assets/images/pnl.png b/src/FLAD/assets/images/pnl.png deleted file mode 100644 index 73bfc5d..0000000 Binary files a/src/FLAD/assets/images/pnl.png and /dev/null differ diff --git a/src/FLAD/assets/icons/icons/IconProfil.png b/src/FLAD/assets/images/profil_icon_asupp.png similarity index 100% rename from src/FLAD/assets/icons/icons/IconProfil.png rename to src/FLAD/assets/images/profil_icon_asupp.png diff --git a/src/FLAD/assets/icons/splash.png b/src/FLAD/assets/images/splash.png similarity index 100% rename from src/FLAD/assets/icons/splash.png rename to src/FLAD/assets/images/splash.png diff --git a/src/FLAD/assets/icons/icons/Spotify.png b/src/FLAD/assets/images/spotify_icon.png similarity index 100% rename from src/FLAD/assets/icons/icons/Spotify.png rename to src/FLAD/assets/images/spotify_icon.png diff --git a/src/FLAD/assets/icons/icons/User.png b/src/FLAD/assets/images/user_icon.png similarity index 100% rename from src/FLAD/assets/icons/icons/User.png rename to src/FLAD/assets/images/user_icon.png diff --git a/src/FLAD/components/Artist.tsx b/src/FLAD/components/Artist.tsx index e2b67c5..7d57764 100644 --- a/src/FLAD/components/Artist.tsx +++ b/src/FLAD/components/Artist.tsx @@ -8,7 +8,7 @@ import Animated, { const { width } = Dimensions.get("window"); const SIZE = width / 3; import { Feather as Icon } from "@expo/vector-icons"; -import Music from "../Model/Music"; +import Music from "../model/Music"; import { useState } from "react"; diff --git a/src/FLAD/components/ArtistChip.tsx b/src/FLAD/components/ArtistChip.tsx index 8decee0..f55d800 100644 --- a/src/FLAD/components/ArtistChip.tsx +++ b/src/FLAD/components/ArtistChip.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react'; import { View, Text, Image, Pressable, Linking, Alert } from 'react-native' -import Artist from '../Model/Artist'; +import Artist from '../model/Artist'; interface ArtistChipProps { backgroundColor: string; diff --git a/src/FLAD/components/Card.tsx b/src/FLAD/components/Card.tsx index cf6903f..87b5f2f 100644 --- a/src/FLAD/components/Card.tsx +++ b/src/FLAD/components/Card.tsx @@ -157,7 +157,7 @@ const Card = ({ image, onSwipe }: CardProps) => { }, opacRStyle]} > { }, opacLStyle]} > @@ -191,7 +191,7 @@ const Card = ({ image, onSwipe }: CardProps) => { alignSelf: "center", width: 126.27, height: 118.64, }]} - source={require('../assets/icons/icons/icon_discovery.png')} + source={require('../assets/images/discovery_icon.png')} /> diff --git a/src/FLAD/components/CardMusic.tsx b/src/FLAD/components/CardMusic.tsx index 7b16f4e..bcdcddd 100644 --- a/src/FLAD/components/CardMusic.tsx +++ b/src/FLAD/components/CardMusic.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { StyleSheet, Text, View, Image } from 'react-native'; import { useSelector } from 'react-redux'; -import { GraphicalCharterDark } from '../assets/GraphicalCharterDark'; -import { GraphicalCharterLight } from '../assets/GraphicalCharterLight'; +import { colorsDark } from '../constants/colorsDark'; +import { colorsLight } from '../constants/colorsLight'; import normalize from '../components/Normalize'; @@ -17,7 +17,7 @@ type CustomCardMusic = { //Props export default function CardMusic(CBP: CustomCardMusic) { // @ts-ignore const isDark = useSelector(state => state.userReducer.dark); - const style = isDark ? GraphicalCharterDark : GraphicalCharterLight; + const style = isDark ? colorsDark : colorsLight; const source = typeof CBP.image === 'string' ? { uri: CBP.image } : CBP.image; const styles = StyleSheet.create({ diff --git a/src/FLAD/components/FladLoadingScreen.tsx b/src/FLAD/components/FladLoadingScreen.tsx index 7043aa9..3f118ec 100644 --- a/src/FLAD/components/FladLoadingScreen.tsx +++ b/src/FLAD/components/FladLoadingScreen.tsx @@ -38,7 +38,7 @@ const FladLoading = () => { - + diff --git a/src/FLAD/components/Friend.tsx b/src/FLAD/components/Friend.tsx index 80e1d65..1aaa924 100644 --- a/src/FLAD/components/Friend.tsx +++ b/src/FLAD/components/Friend.tsx @@ -2,8 +2,8 @@ import React from 'react'; import { StyleSheet, Text, View, Image } from 'react-native'; import { color } from 'react-native-reanimated'; import { useSelector } from 'react-redux'; -import { GraphicalCharterDark } from '../assets/GraphicalCharterDark'; -import { GraphicalCharterLight } from '../assets/GraphicalCharterLight'; +import { colorsDark } from '../constants/colorsDark'; +import { colorsLight } from '../constants/colorsLight'; import normalize from './Normalize'; type FriendProps = { @@ -16,7 +16,7 @@ export default function Friend(friend: FriendProps) { // @ts-ignore const isDark = useSelector(state => state.userReducer.dark); - const style = isDark ? GraphicalCharterDark : GraphicalCharterLight; + const style = isDark ? colorsDark : colorsLight; const source = typeof friend.image === 'string' ? { uri: friend.image } : friend.image; @@ -78,7 +78,7 @@ export default function Friend(friend: FriendProps) { · 1sem - + ) } diff --git a/src/FLAD/components/Genre.tsx b/src/FLAD/components/Genre.tsx index 6bf423a..0997783 100644 --- a/src/FLAD/components/Genre.tsx +++ b/src/FLAD/components/Genre.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { ScrollView, StyleSheet } from "react-native"; -import Music from "../Model/Music"; +import Music from "../model/Music"; import { Artist } from "./Artist"; export const ArtistLayout = () => { diff --git a/src/FLAD/components/Messaging.tsx b/src/FLAD/components/Messaging.tsx deleted file mode 100644 index 566b5dd..0000000 --- a/src/FLAD/components/Messaging.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function Messaging() { - -} \ No newline at end of file diff --git a/src/FLAD/components/NextButton.tsx b/src/FLAD/components/NextButton.tsx index 3090ef7..c33927f 100644 --- a/src/FLAD/components/NextButton.tsx +++ b/src/FLAD/components/NextButton.tsx @@ -2,13 +2,13 @@ import React, { useRef, useEffect } from 'react'; import { View, StyleSheet, TouchableOpacity, Animated, useColorScheme } from 'react-native'; import Svg, { G, Circle } from 'react-native-svg'; import { AntDesign } from '@expo/vector-icons'; -import { GraphicalCharterDark } from '../assets/GraphicalCharterDark'; -import { GraphicalCharterLight } from '../assets/GraphicalCharterLight'; +import { colorsDark } from '../constants/colorsDark'; +import { colorsLight } from '../constants/colorsLight'; import normalize from '../components/Normalize'; // @ts-ignore export default function NextButton({ percentage, scrollTo }) { - const style = useColorScheme() == 'light' ? GraphicalCharterLight : GraphicalCharterDark; + const style = useColorScheme() == 'light' ? colorsLight : colorsDark; const size = normalize(148); const strokeWidth = 2; diff --git a/src/FLAD/components/OnboardingItem.tsx b/src/FLAD/components/OnboardingComponent.tsx similarity index 80% rename from src/FLAD/components/OnboardingItem.tsx rename to src/FLAD/components/OnboardingComponent.tsx index 9feb16f..41ae818 100644 --- a/src/FLAD/components/OnboardingItem.tsx +++ b/src/FLAD/components/OnboardingComponent.tsx @@ -1,12 +1,12 @@ import React from 'react'; import { View, StyleSheet, Text, Image, useWindowDimensions, useColorScheme } from 'react-native'; -import normalize from '../components/Normalize'; -import { GraphicalCharterDark } from '../assets/GraphicalCharterDark'; -import { GraphicalCharterLight } from '../assets/GraphicalCharterLight'; +import normalize from './Normalize'; +import { colorsDark } from '../constants/colorsDark'; +import { colorsLight } from '../constants/colorsLight'; // @ts-ignore -export default function Onboarding({ item }) { - const style = useColorScheme() == 'light' ? GraphicalCharterLight : GraphicalCharterDark; +export default function OnboardingComponent({ item }) { + const style = useColorScheme() == 'light' ? colorsLight : colorsDark; const { width, height } = useWindowDimensions(); const styles = StyleSheet.create({ container: { diff --git a/src/FLAD/components/SelectedCard.tsx b/src/FLAD/components/SelectedCard.tsx index 8ec8557..e7dded2 100644 --- a/src/FLAD/components/SelectedCard.tsx +++ b/src/FLAD/components/SelectedCard.tsx @@ -8,7 +8,7 @@ import Animated, { const { width } = Dimensions.get("window"); const SIZE = width / 3; import { Feather as Icon } from "@expo/vector-icons"; -import Music from "../Model/Music"; +import Music from "../model/Music"; import { useState } from "react"; diff --git a/src/FLAD/components/button/button.tsx b/src/FLAD/components/buttons/Button.tsx similarity index 100% rename from src/FLAD/components/button/button.tsx rename to src/FLAD/components/buttons/Button.tsx diff --git a/src/FLAD/assets/GraphicalCharterDark.tsx b/src/FLAD/constants/colorsDark.ts similarity index 69% rename from src/FLAD/assets/GraphicalCharterDark.tsx rename to src/FLAD/constants/colorsDark.ts index 9095c3a..acfde99 100644 --- a/src/FLAD/assets/GraphicalCharterDark.tsx +++ b/src/FLAD/constants/colorsDark.ts @@ -1,4 +1,4 @@ -export const GraphicalCharterDark = { +export const colorsDark = { "body": "#141414", "Text": "white", "Card": "#232123", diff --git a/src/FLAD/assets/GraphicalCharterLight.tsx b/src/FLAD/constants/colorsLight.ts similarity index 68% rename from src/FLAD/assets/GraphicalCharterLight.tsx rename to src/FLAD/constants/colorsLight.ts index 0d748b1..199168d 100644 --- a/src/FLAD/assets/GraphicalCharterLight.tsx +++ b/src/FLAD/constants/colorsLight.ts @@ -1,4 +1,4 @@ -export const GraphicalCharterLight = { +export const colorsLight = { "body": "#f2f2f6", "Text": "black", "Card": "#fff", diff --git a/src/FLAD/assets/icons/config-dev.ts b/src/FLAD/constants/config-dev.ts similarity index 100% rename from src/FLAD/assets/icons/config-dev.ts rename to src/FLAD/constants/config-dev.ts diff --git a/src/FLAD/fladConfig.tsx b/src/FLAD/constants/config.ts similarity index 92% rename from src/FLAD/fladConfig.tsx rename to src/FLAD/constants/config.ts index 0c6f028..dee9ff6 100644 --- a/src/FLAD/fladConfig.tsx +++ b/src/FLAD/constants/config.ts @@ -1 +1 @@ -export const API_URL = "https://flad-api-production.up.railway.app" +export const API_URL = "https://flad-api-production.up.railway.app" \ No newline at end of file diff --git a/src/FLAD/data/data.ts b/src/FLAD/data/data.ts index 1902083..a3b5819 100644 --- a/src/FLAD/data/data.ts +++ b/src/FLAD/data/data.ts @@ -1,57 +1,7 @@ -import Music from "../Model/Music"; -import { Spot } from "../Model/Spot"; +import Music from "../model/Music"; +import { Spot } from "../model/Spot"; -export const cards = [{ - name: "blue", - sourceUrl: "https://th.bing.com/th/id/R.dbf87f0d8cbfd078ab6a589a5d921994?rik=1%2f6KliMpOAeh8A&pid=ImgRaw&r=0", - index: 4 -}, -{ - musicName: "Breathin", - name: "Ariana Grande", - sourceUrl: "https://i.ebayimg.com/images/g/rY0AAOSw97djEo2C/s-l500.jpg", - index: 9 -}, -{ - musicName: "Zombies", - name: "gambino", - sourceUrl: "https://th.bing.com/th/id/R.0b2d1a59bfda9b1a49ecb561e08535a8?rik=Xyc35OZU%2f6VOVw&pid=ImgRaw&r=0", - index: 3 -}, -{ - musicName: "Bambina", - name: "PNL", - sourceUrl: "https://upload.wikimedia.org/wikipedia/en/a/a0/PNL_-_Dans_la_l%C3%A9gende.png", - index: 10 -}, -{ - musicName: "Freeze Raël", - name: "Freeze Corleone", - sourceUrl: "https://intrld.com/wp-content/uploads/2020/08/freeze-corleone-la-menace-fanto%CC%82me.png", - index: 23 -}, -{ - musicName: "Autobahn", - name: "Sch", - sourceUrl: "https://images.genius.com/83b6c98680d38bde1571f6b4093244b5.1000x1000x1.jpg", - index: 44 -}, -{ - musicName: "Lakehouse", - name: "Stratos", - sourceUrl: "https://images.genius.com/ddc9cadedd1d4cef0860aaa85af9cd46.705x705x1.png", - index: 89 -}, -] - -const spotArray: Spot[] = [ - new Spot("1", new Music("1", "Title 1", "Bio 1", "Image 1", "TrackPreviewUrl 1")), - new Spot("2", new Music("2", "Title 2", "Bio 2", "Image 2", "TrackPreviewUrl 2")), - new Spot("3", new Music("3", "Title 3", "Bio 3", "Image 3", "TrackPreviewUrl 3")), - new Spot("4", new Music("4", "Title 4", "Bio 4", "Image 4", "TrackPreviewUrl 4")), - new Spot("5", new Music("5", "Title 5", "Bio 5", "Image 5", "TrackPreviewUrl 5")), -]; export const spotArray2: Spot[] = [ new Spot("1", new Music("6KNw3UKRp3QRsO7Cf4ASVE", "MOLLY - A COLORS SHOW", diff --git a/src/FLAD/data/slides.tsx b/src/FLAD/data/slides.tsx index 610d95e..0104654 100644 --- a/src/FLAD/data/slides.tsx +++ b/src/FLAD/data/slides.tsx @@ -3,18 +3,18 @@ export default [ id: '1', title: 'Bienvenue sur Flad', description: 'L\'application pour découvrir de nouvelles musiques et vous faire de nouveaux amis', - image: require('../assets/images/Board_Image.png') + image: require('../assets/images/board_1.png') }, { id: '2', title: 'Tous les jours de nouvelles musiques qui peuvent vous plaire', description: 'L\'application apprends de vous et de vos amis pour vous suggérer des albums et des musics', - image: require('../assets/images/Board_Image2.png') + image: require('../assets/images/board_2.png') }, { id: '3', title: 'La musique ça se partage', description: 'Faites connaissances avec de nouvelles personnes et partagez vos critiques', - image: require('../assets/images/Board_Image3.png') + image: require('../assets/images/board_3.png') } ] \ No newline at end of file diff --git a/src/FLAD/navigation/AuthNavigation.tsx b/src/FLAD/navigation/AuthNavigation.tsx index 479e0a9..d41aa38 100644 --- a/src/FLAD/navigation/AuthNavigation.tsx +++ b/src/FLAD/navigation/AuthNavigation.tsx @@ -1,4 +1,4 @@ -import Navigation from './Navigation'; +import HomeNavigation from './HomeNavigation'; import AsyncStorage from '@react-native-async-storage/async-storage'; import { SafeAreaProvider } from 'react-native-safe-area-context'; import StartNavigation from './StartNavigation'; @@ -11,7 +11,7 @@ export default function AuthNavigation() { //@ts-ignore const tokenProcesed: boolean = useSelector(state => state.userReducer.loading); //@ts-ignore - const isLogin: boolean = useSelector(state => state.userReducer.isLogedIn); + const isLogin: boolean = useSelector(state => state.userReducer.isLogedIn); const [appIsReady, setAppIsReady] = useState(false); const dispatch = useDispatch(); async function prepare() { @@ -29,9 +29,9 @@ export default function AuthNavigation() { const newValue = JSON.stringify(JSON.parse(currentValue)); //@ts-ignore dispatch(ChangeMode(JSON.parse(newValue))) - } + } } catch (error) { - console.log(`Une erreur s'est produite lors de la mise à jour de la valeur booléenne pour la clé 'dark': `, error); + console.log("An error occurred while updating the boolean value for the 'dark' key: ", error); } } useEffect(() => { @@ -40,18 +40,18 @@ export default function AuthNavigation() { }, [appIsReady, tokenProcesed]); - + if (tokenProcesed == false) { return null; } return ( - + setAppIsReady(true)}> {isLogin ? ( - + ) : - + } ) diff --git a/src/FLAD/navigation/FavoriteNavigation.tsx b/src/FLAD/navigation/FavoriteNavigation.tsx index 29a671b..4f2f0ef 100644 --- a/src/FLAD/navigation/FavoriteNavigation.tsx +++ b/src/FLAD/navigation/FavoriteNavigation.tsx @@ -1,8 +1,7 @@ import React from 'react'; -import Favorite from '../screens/Favorite'; -import MusicDetail from '../screens/MusicDetail'; +import Favorite from '../screens/FavoriteScreen'; +import DetailScreen from '../screens/DetailScreen'; import { createSharedElementStackNavigator } from 'react-navigation-shared-element'; -import CurrentMusic from '../components/CurrentMusic'; const Stack = createSharedElementStackNavigator(); export default function MusicNavigation() { @@ -14,8 +13,8 @@ export default function MusicNavigation() { /> { return [route.params.music.id] }} /> diff --git a/src/FLAD/navigation/Navigation.tsx b/src/FLAD/navigation/HomeNavigation.tsx similarity index 94% rename from src/FLAD/navigation/Navigation.tsx rename to src/FLAD/navigation/HomeNavigation.tsx index 6eab3b0..0b6b715 100644 --- a/src/FLAD/navigation/Navigation.tsx +++ b/src/FLAD/navigation/HomeNavigation.tsx @@ -11,17 +11,17 @@ import FontAwesome from 'react-native-vector-icons/FontAwesome'; import SpotNavigation from './SpotNavigation'; import MessagingNavigation from './MessagingNavigation'; import { useDispatch, useSelector } from 'react-redux'; -import { GraphicalCharterDark } from '../assets/GraphicalCharterDark'; -import { GraphicalCharterLight } from '../assets/GraphicalCharterLight'; +import { colorsDark } from '../constants/colorsDark'; +import { colorsLight } from '../constants/colorsLight'; import { getCurrentUserMusic, getSpotList } from '../redux/thunk/spotThunk'; import SpotifyService from '../services/spotify/spotify.service'; import * as SecureStore from 'expo-secure-store'; -import { MY_SECURE_AUTH_STATE_KEY } from '../screens/Register'; +import { MY_SECURE_AUTH_STATE_KEY } from '../screens/RegisterScreen'; import * as Location from 'expo-location'; import axios from 'axios'; import qs from 'qs'; -export default function Navigation() { +export default function HomeNavigation() { const [setErrorMsg] = useState(''); const [location, setLocation] = useState(); //@ts-ignore @@ -98,7 +98,7 @@ const tokenSend: string = useSelector(state => state.userReducer.userFladToken); // @ts-ignore const isDark = useSelector(state => state.userReducer.dark); - const style = isDark ? GraphicalCharterDark : GraphicalCharterLight; + const style = isDark ? colorsDark : colorsLight; const BottomTabNavigator = createBottomTabNavigator(); const MyTheme = { dark: false, diff --git a/src/FLAD/navigation/MessagingNavigation.tsx b/src/FLAD/navigation/MessagingNavigation.tsx index 09ac13d..db11753 100644 --- a/src/FLAD/navigation/MessagingNavigation.tsx +++ b/src/FLAD/navigation/MessagingNavigation.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { createStackNavigator } from '@react-navigation/stack'; -import Conversation from '../screens/Conversation' -import Chat from '../screens/Chat'; +import ConversationScreen from '../screens/ConversationScreen' +import ChatScreen from '../screens/ChatScreen'; export default function MessagingNavigation() { const Stack = createStackNavigator(); @@ -10,12 +10,12 @@ export default function MessagingNavigation() { diff --git a/src/FLAD/navigation/SettingNavigation.tsx b/src/FLAD/navigation/SettingNavigation.tsx index e7a27c8..7f502b8 100644 --- a/src/FLAD/navigation/SettingNavigation.tsx +++ b/src/FLAD/navigation/SettingNavigation.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import Setting from '../screens/Setting'; -import SettingProfil from '../screens/SettingProfil'; +import SettingScreen from '../screens/SettingScreen'; +import ProfilScreen from '../screens/ProfilScreen'; import { createStackNavigator } from '@react-navigation/stack'; export default function SettingNavigation() { @@ -9,12 +9,12 @@ export default function SettingNavigation() { diff --git a/src/FLAD/navigation/SpotNavigation.tsx b/src/FLAD/navigation/SpotNavigation.tsx index af8a5ac..23d5b65 100644 --- a/src/FLAD/navigation/SpotNavigation.tsx +++ b/src/FLAD/navigation/SpotNavigation.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { createStackNavigator } from '@react-navigation/stack'; -import SpotPage from '../screens/spot' -import MusicDetail from '../screens/MusicDetail'; +import SpotScreen from '../screens/SpotScreen' +import DetailScreen from '../screens/DetailScreen'; export default function SpotNavigation() { @@ -16,12 +16,12 @@ export default function SpotNavigation() { }} > ) diff --git a/src/FLAD/navigation/StartNavigation.tsx b/src/FLAD/navigation/StartNavigation.tsx index c0c755a..2358fea 100644 --- a/src/FLAD/navigation/StartNavigation.tsx +++ b/src/FLAD/navigation/StartNavigation.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import Login from '../screens/LoginPage'; -import Register from '../screens/Register'; -import Onboarding from '../components/Onboarding'; +import LoginScreen from '../screens/LoginScreen'; +import RegisterScreen from '../screens/RegisterScreen'; +import StartScreen from '../screens/StartScreen'; import { createStackNavigator } from '@react-navigation/stack'; import { NavigationContainer } from '@react-navigation/native'; @@ -11,18 +11,18 @@ export default function StartNavigation() { diff --git a/src/FLAD/package.json b/src/FLAD/package.json index 0cc7b14..d5da819 100644 --- a/src/FLAD/package.json +++ b/src/FLAD/package.json @@ -12,21 +12,18 @@ "@react-native-async-storage/async-storage": "~1.17.3", "@react-navigation/bottom-tabs": "^6.5.4", "@react-navigation/native": "^6.1.4", - "@react-navigation/native-stack": "^6.9.8", "@react-navigation/stack": "^6.3.12", "@reduxjs/toolkit": "^1.9.2", "@types/react-redux": "^7.1.25", "axios": "^1.2.6", - "buffer": "^6.0.3", "expo": "~47.0.12", - "expo-asset": "~8.7.0", "expo-auth-session": "~3.8.0", "expo-av": "~13.0.3", - "expo-blur": "~12.0.1", - "expo-cli": "^6.3.0", + "expo-cli": "^6.3.10", "expo-haptics": "~12.0.1", "expo-image-picker": "~14.0.2", "expo-linear-gradient": "~12.0.1", + "expo-linking": "~3.3.1", "expo-location": "~15.0.1", "expo-random": "~13.0.0", "expo-secure-store": "~12.0.0", @@ -36,7 +33,7 @@ "lottie-react-native": "5.1.4", "react": "18.1.0", "react-dom": "18.1.0", - "react-native": "0.70.5", + "react-native": "0.70.8", "react-native-gesture-handler": "~2.8.0", "react-native-gifted-chat": "^2.0.1", "react-native-modal": "^13.0.1", @@ -49,13 +46,12 @@ "react-native-web": "~0.18.9", "react-navigation-shared-element": "^3.1.3", "react-redux": "^8.0.5", - "redux": "^4.2.1", - "expo-linking": "~3.3.1" + "redux": "^4.2.1" }, "devDependencies": { "@babel/core": "^7.12.9", "@types/react": "~18.0.14", - "@types/react-native": "~0.70.6", + "@types/react-native": "~0.70.8", "typescript": "^4.6.3" }, "private": true diff --git a/src/FLAD/redux/actions/appActions.ts b/src/FLAD/redux/actions/appActions.ts index 40e617b..dfe3c2d 100644 --- a/src/FLAD/redux/actions/appActions.ts +++ b/src/FLAD/redux/actions/appActions.ts @@ -1,4 +1,4 @@ -import Music from "../../Model/Music"; +import Music from "../../model/Music"; import { favoritesTypes } from "../types/favoritesTypes"; export const getFavoritesMusic = (music: Music[]) => { diff --git a/src/FLAD/redux/actions/spotActions.tsx b/src/FLAD/redux/actions/spotActions.tsx index 6276b10..332abb4 100644 --- a/src/FLAD/redux/actions/spotActions.tsx +++ b/src/FLAD/redux/actions/spotActions.tsx @@ -1,5 +1,5 @@ -import Music from "../../Model/Music"; -import { Spot } from "../../Model/Spot"; +import Music from "../../model/Music"; +import { Spot } from "../../model/Spot"; import { spotifyTypes } from "../types/spotifyTypes"; import { spotTypes } from "../types/spotTypes"; diff --git a/src/FLAD/redux/actions/userActions.tsx b/src/FLAD/redux/actions/userActions.tsx index 605e8be..5b30c6e 100644 --- a/src/FLAD/redux/actions/userActions.tsx +++ b/src/FLAD/redux/actions/userActions.tsx @@ -1,4 +1,4 @@ -import { User } from "../../Model/User"; +import { User } from "../../model/User"; import { userTypes } from "../types/userTypes"; @@ -14,7 +14,7 @@ export interface CredentialsRegister { idSpotify: string } export const setLoginState = (userJson: any) => { - const user = new User(userJson.data.idFlad, userJson.data.idSpotify, userJson.data.email, new Date(), userJson.data.name, require('../../assets/images/jul.png')); + const user = new User(userJson.data.idFlad, userJson.data.idSpotify, userJson.data.email, new Date(), userJson.data.name, userJson.data.image); return { type: userTypes.LOGIN, payload: user diff --git a/src/FLAD/redux/reducers/appReducer.tsx b/src/FLAD/redux/reducers/appReducer.tsx index 95db813..107dff6 100644 --- a/src/FLAD/redux/reducers/appReducer.tsx +++ b/src/FLAD/redux/reducers/appReducer.tsx @@ -1,5 +1,5 @@ -import Music from "../../Model/Music"; -import { Spot } from "../../Model/Spot"; +import Music from "../../model/Music"; +import { Spot } from "../../model/Spot"; import { discoveriesTypes } from "../types/discoverieTypes"; import { favoritesTypes } from "../types/favoritesTypes"; import { spotifyTypes } from "../types/spotifyTypes"; diff --git a/src/FLAD/redux/reducers/userReducer.tsx b/src/FLAD/redux/reducers/userReducer.tsx index f177d98..9e2460e 100644 --- a/src/FLAD/redux/reducers/userReducer.tsx +++ b/src/FLAD/redux/reducers/userReducer.tsx @@ -1,5 +1,5 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; -import { User } from "../../Model/User"; +import { User } from "../../model/User"; import { userTypes } from "../types/userTypes"; const initialState = { diff --git a/src/FLAD/redux/thunk/authThunk.tsx b/src/FLAD/redux/thunk/authThunk.tsx index 82ee547..8d8aaa2 100644 --- a/src/FLAD/redux/thunk/authThunk.tsx +++ b/src/FLAD/redux/thunk/authThunk.tsx @@ -1,8 +1,8 @@ import axios from "axios"; -import { API_URL } from "../../fladConfig"; +import { API_URL } from "../../assets/constants/config"; import { Credentials, CredentialsRegister, restoreToken, setLoginState, UserLogout, userChangeMode, userSignUp, ChangeErrorLogin, ChangeErrorSignup } from "../actions/userActions"; import * as SecureStore from 'expo-secure-store'; -import { UserFactory } from "../../Model/factory/UserFactory"; +import { UserMapper } from "../../model/mapper/UserMapper"; const key = 'userToken'; @@ -35,7 +35,7 @@ export const registerUser = (resgisterCredential: CredentialsRegister) => { "https://flad-api-production.up.railway.app/api/users", { headers } ) - dispatch(userSignUp(UserFactory.JsonToModel(user.data))); + dispatch(userSignUp(UserMapper.JsonToModel(user.data))); } else { console.log('Login Failed', 'Username or Password is incorrect'); } diff --git a/src/FLAD/redux/thunk/socialThunk.tsx b/src/FLAD/redux/thunk/socialThunk.tsx index 558cc9f..a03f1e0 100644 --- a/src/FLAD/redux/thunk/socialThunk.tsx +++ b/src/FLAD/redux/thunk/socialThunk.tsx @@ -1,5 +1,5 @@ import axios from "axios"; -import { Spot } from "../../Model/Spot"; +import { Spot } from "../../model/Spot"; export const likeSpot = async (spot: Spot) => { return async (dispatch) => { diff --git a/src/FLAD/redux/thunk/spotThunk.tsx b/src/FLAD/redux/thunk/spotThunk.tsx index 4451c06..28f6365 100644 --- a/src/FLAD/redux/thunk/spotThunk.tsx +++ b/src/FLAD/redux/thunk/spotThunk.tsx @@ -1,6 +1,6 @@ import axios from "axios"; import * as SecureStore from 'expo-secure-store'; -import { Spot } from "../../Model/Spot"; +import { Spot } from "../../model/Spot"; import SpotifyService from "../../services/spotify/spotify.service"; import { setSpotList, setUserCurrentMusic } from "../actions/spotActions"; const key = 'userToken'; diff --git a/src/FLAD/screens/Chat.tsx b/src/FLAD/screens/ChatScreen.tsx similarity index 92% rename from src/FLAD/screens/Chat.tsx rename to src/FLAD/screens/ChatScreen.tsx index 053a21f..2e8cd6c 100644 --- a/src/FLAD/screens/Chat.tsx +++ b/src/FLAD/screens/ChatScreen.tsx @@ -2,7 +2,7 @@ import { useNavigation } from "@react-navigation/native"; import React, { useEffect } from "react"; import { GiftedChat } from "react-native-gifted-chat"; -export default function Chat() { +export default function ChatScreen() { const navigation = useNavigation(); diff --git a/src/FLAD/screens/Conversation.tsx b/src/FLAD/screens/ConversationScreen.tsx similarity index 72% rename from src/FLAD/screens/Conversation.tsx rename to src/FLAD/screens/ConversationScreen.tsx index dd979c5..e9744fc 100644 --- a/src/FLAD/screens/Conversation.tsx +++ b/src/FLAD/screens/ConversationScreen.tsx @@ -1,12 +1,12 @@ import { useNavigation } from "@react-navigation/native"; import { SafeAreaView, StyleSheet, Text, View, FlatList, TouchableOpacity } from "react-native"; import { useSelector } from "react-redux"; -import { GraphicalCharterDark } from '../assets/GraphicalCharterDark'; -import { GraphicalCharterLight } from '../assets/GraphicalCharterLight'; +import { colorsDark } from '../constants/colorsDark'; +import { colorsLight } from '../constants/colorsLight'; import Friend from "../components/Friend"; import normalize from '../components/Normalize'; -export default function ConversationList() { +export default function ConversationScreen() { // @ts-ignore const isDark = useSelector(state => state.userReducer.dark); @@ -14,13 +14,13 @@ export default function ConversationList() { const navigation = useNavigation(); const friends = [ - { id: 1, name: "Lucas", lastMessage: "J'en ai marre de provot", source: require('../assets/images/jul.png') }, - { id: 2, name: "Louison", lastMessage: "Tu vien piscine ?", source: require('../assets/images/jul.png') }, - { id: 3, name: "Dave", lastMessage: "Ok c noté !", source: require('../assets/images/pnl.png') }, - { id: 4, name: "Valentin", lastMessage: "Haha react native c incroyable !!!", source: require('../assets/images/jul.png') }, + { id: 1, name: "Lucas", lastMessage: "J'en ai marre de provot", source: "https://yt3.googleusercontent.com/CgPFZUSWbFj9txLG_8l48YRCwnrlfQya8sw_UCB-s3NGkQEnLj--KZI0CqSCyP2XqPfOB-j9yQ=s900-c-k-c0x00ffffff-no-rj" }, + { id: 2, name: "Louison", lastMessage: "Tu vien piscine ?", source: "https://yt3.googleusercontent.com/CgPFZUSWbFj9txLG_8l48YRCwnrlfQya8sw_UCB-s3NGkQEnLj--KZI0CqSCyP2XqPfOB-j9yQ=s900-c-k-c0x00ffffff-no-rj" }, + { id: 3, name: "Dave", lastMessage: "Ok c noté !", source: "https://img.lemde.fr/2019/04/05/0/0/960/960/664/0/75/0/18299d3_tUvp2AZPH_jnsIL2ypVFGUro.jpg" }, + { id: 4, name: "Valentin", lastMessage: "Haha react native c incroyable !!!", source: "https://yt3.googleusercontent.com/CgPFZUSWbFj9txLG_8l48YRCwnrlfQya8sw_UCB-s3NGkQEnLj--KZI0CqSCyP2XqPfOB-j9yQ=s900-c-k-c0x00ffffff-no-rj" }, ]; - const style = isDark ? GraphicalCharterDark : GraphicalCharterLight; + const style = isDark ? colorsDark : colorsLight; const styles = StyleSheet.create({ mainSafeArea: { diff --git a/src/FLAD/screens/MusicDetail.tsx b/src/FLAD/screens/DetailScreen.tsx similarity index 98% rename from src/FLAD/screens/MusicDetail.tsx rename to src/FLAD/screens/DetailScreen.tsx index f1226b5..89b030a 100644 --- a/src/FLAD/screens/MusicDetail.tsx +++ b/src/FLAD/screens/DetailScreen.tsx @@ -5,7 +5,7 @@ import Animated, { interpolate, SensorType, useAnimatedSensor, useAnimatedStyle, import { Audio } from 'expo-av'; import { useEffect, useState } from "react"; import normalize from '../components/Normalize'; -import Music from "../Model/Music"; +import Music from "../model/Music"; import SpotifyService from "../services/spotify/spotify.service"; import { LinearGradient } from "expo-linear-gradient"; import FontAwesome from 'react-native-vector-icons/FontAwesome'; @@ -13,13 +13,13 @@ import { Feather as Icon } from "@expo/vector-icons"; import { HorizontalFlatList } from "../components/HorizontalFlatList"; import { LittleCard } from "../components/littleCard"; import * as SecureStore from 'expo-secure-store'; -import { MY_SECURE_AUTH_STATE_KEY } from "./Register"; +import { MY_SECURE_AUTH_STATE_KEY } from "./RegisterScreen"; const halfPi = Math.PI / 2; //@ts-ignore -const MusicDetail = ({ route }) => { +const DetailScreen = ({ route }) => { const music: Music = route.params.music; const [currentspot] = useState(music); const [simularMusic, setSimularMusic] = useState([]); @@ -188,7 +188,7 @@ const MusicDetail = ({ route }) => { ); }; -export default MusicDetail; +export default DetailScreen; const styles = StyleSheet.create({ mainSafeArea: { diff --git a/src/FLAD/screens/Favorite.tsx b/src/FLAD/screens/FavoriteScreen.tsx similarity index 86% rename from src/FLAD/screens/Favorite.tsx rename to src/FLAD/screens/FavoriteScreen.tsx index 1da3675..f6e55b7 100644 --- a/src/FLAD/screens/Favorite.tsx +++ b/src/FLAD/screens/FavoriteScreen.tsx @@ -2,28 +2,28 @@ import React from 'react'; import { Image, StyleSheet, Text, View, FlatList, TouchableOpacity, TouchableHighlight, SafeAreaView } from 'react-native'; import CardMusic from '../components/CardMusic'; import normalize from '../components/Normalize'; -import Music from '../Model/Music' +import Music from '../model/Music' import FladyComponent from '../components/FladyComponent'; import { useNavigation } from "@react-navigation/native"; import { useSelector } from 'react-redux'; import { SharedElement } from 'react-navigation-shared-element'; -import { GraphicalCharterDark } from '../assets/GraphicalCharterDark'; -import { GraphicalCharterLight } from '../assets/GraphicalCharterLight'; +import { colorsDark } from '../constants/colorsDark'; +import { colorsLight } from '../constants/colorsLight'; -export default function FavoritePage() { +export default function FavoriteScreen() { // @ts-ignore const isDark = useSelector(state => state.userReducer.dark); - const style = isDark ? GraphicalCharterDark : GraphicalCharterLight; + const style = isDark ? colorsDark : colorsLight; const navigation = useNavigation(); //@ts-ignore const favoritesMusic = useSelector(state => state.appReducer.favoriteMusic); const images = [ - { id: 1, source: require('../assets/images/FLADYLove.png') }, - { id: 2, source: require('../assets/images/FLADYStar.png') }, - { id: 3, source: require('../assets/images/FLADYHate.png') }, - { id: 4, source: require('../assets/images/FLADYCry.png') }, + { id: 1, source: require('../assets/images/flady_love.png') }, + { id: 2, source: require('../assets/images/flady_star.png') }, + { id: 3, source: require('../assets/images/flady_angry.png') }, + { id: 4, source: require('../assets/images/flady_cry.png') }, ]; const navigueToDetail = (music: any) => { // @ts-ignore diff --git a/src/FLAD/screens/LoginPage.tsx b/src/FLAD/screens/LoginScreen.tsx similarity index 93% rename from src/FLAD/screens/LoginPage.tsx rename to src/FLAD/screens/LoginScreen.tsx index 8dd07df..e47b649 100644 --- a/src/FLAD/screens/LoginPage.tsx +++ b/src/FLAD/screens/LoginScreen.tsx @@ -14,7 +14,7 @@ const DismissKeyboard = ({ children }) => ( ) -export default function LoginPage() { +export default function LoginScreen() { const [sound, setSound] = useState(); const [rememberMe, setRememberMe] = useState(false); const navigation = useNavigation(); @@ -50,11 +50,11 @@ export default function LoginPage() { return ( - + v2.0 - + SE CONNECTER {failedLogin && ( Email ou mot de passe incorrect! @@ -64,7 +64,7 @@ export default function LoginPage() { placeholderTextColor="#B8B4B8" value={username} onChangeText={setUsername} style={[styles.input, styles.shadow]} /> - + SE SOUVENIR DE MOI - + Tu n'as pas de compte? diff --git a/src/FLAD/screens/SettingProfil.tsx b/src/FLAD/screens/ProfilScreen.tsx similarity index 92% rename from src/FLAD/screens/SettingProfil.tsx rename to src/FLAD/screens/ProfilScreen.tsx index 81d75e8..4d94971 100644 --- a/src/FLAD/screens/SettingProfil.tsx +++ b/src/FLAD/screens/ProfilScreen.tsx @@ -9,8 +9,8 @@ import { useSelector } from 'react-redux'; import normalize from '../components/Normalize'; import * as ImagePicker from 'expo-image-picker'; import { SafeAreaView } from 'react-native-safe-area-context'; -import { GraphicalCharterDark } from '../assets/GraphicalCharterDark'; -import { GraphicalCharterLight } from '../assets/GraphicalCharterLight'; +import { colorsDark } from '../constants/colorsDark'; +import { colorsLight } from '../constants/colorsLight'; // @ts-ignore const DismissKeyboard = ({ children }) => ( @@ -19,13 +19,12 @@ const DismissKeyboard = ({ children }) => ( ) - -export default function SettingProfil() { +export default function ProfilScreen() { // @ts-ignore const isDark = useSelector(state => state.userReducer.dark); // @ts-ignore const UserCurrent = useSelector(state => state.userReducer.user); - const style = isDark ? GraphicalCharterDark : GraphicalCharterLight; + const style = isDark ? colorsDark : colorsLight; const navigation = useNavigation(); const [isModalVisible, setIsModalVisible] = React.useState(false); @@ -109,14 +108,6 @@ export default function SettingProfil() { width: 120, height: 120, }, - editButton: { - width: 50, - height: 50, - borderRadius: 25, - backgroundColor: '#7C7C7C', - alignItems: 'center', - justifyContent: 'center' - }, body: { paddingVertical: 9, paddingLeft: normalize(10), @@ -266,22 +257,17 @@ export default function SettingProfil() { // @ts-ignore onPress={() => navigation.navigate('Setting')}> - + Exit Profil - - - - - - - - + + + + + diff --git a/src/FLAD/screens/Register.tsx b/src/FLAD/screens/RegisterScreen.tsx similarity index 91% rename from src/FLAD/screens/Register.tsx rename to src/FLAD/screens/RegisterScreen.tsx index 3d1d85e..167c58d 100644 --- a/src/FLAD/screens/Register.tsx +++ b/src/FLAD/screens/RegisterScreen.tsx @@ -29,7 +29,7 @@ WebBrowser.maybeCompleteAuthSession(); async function save(key: string, value: string) { await SecureStore.setItemAsync(key, value); } -export default function InscriptionPage() { +export default function RegisterScreen() { const [sound, setSound] = useState(); const navigation = useNavigation(); const [spotifyToken, setSpotifyToken] = useState(''); @@ -38,7 +38,7 @@ export default function InscriptionPage() { async function playSound() { const { sound } = await Audio.Sound.createAsync( - require('../assets/sounds/Click.mp3') + require('../assets/sounds/click.mp3') ); setSound(sound); await sound.playAsync(); @@ -105,11 +105,11 @@ export default function InscriptionPage() { return ( - + v2.0 - + S'INSCRIRE {failedSignup && ( Email ou mot de passe incorrect! @@ -119,31 +119,31 @@ export default function InscriptionPage() { placeholderTextColor="#B8B4B8" value={username} onChangeText={setUsername} /> - + - + - + { await getTokens2(); }} style={[styles.buttonSpotify, styles.shadow]}> Lier compte - + submitForm()}> - + Tu as déjà un compte? diff --git a/src/FLAD/screens/Setting.tsx b/src/FLAD/screens/SettingScreen.tsx similarity index 97% rename from src/FLAD/screens/Setting.tsx rename to src/FLAD/screens/SettingScreen.tsx index 75ec7fd..061e3c7 100644 --- a/src/FLAD/screens/Setting.tsx +++ b/src/FLAD/screens/SettingScreen.tsx @@ -8,8 +8,8 @@ import normalize from '../components/Normalize'; import { ScrollView, Switch, TextInput } from 'react-native-gesture-handler'; import CardMusic from '../components/CardMusic'; import { ChangeMode, DeleteToken } from '../redux/thunk/authThunk'; -import { GraphicalCharterDark } from '../assets/GraphicalCharterDark'; -import { GraphicalCharterLight } from '../assets/GraphicalCharterLight'; +import { colorsDark } from '../constants/colorsDark'; +import { colorsLight } from '../constants/colorsLight'; // @ts-ignore const DismissKeyboard = ({ children }) => ( @@ -18,7 +18,7 @@ const DismissKeyboard = ({ children }) => ( ) -export default function Setting() { +export default function SettingScreen() { const textInputRef = useRef(null); const dispatch = useDispatch(); const navigation = useNavigation(); @@ -33,7 +33,7 @@ export default function Setting() { // @ts-ignore const isDark = useSelector(state => state.userReducer.dark); - const style = isDark ? GraphicalCharterDark : GraphicalCharterLight; + const style = isDark ? colorsDark : colorsLight; async function ChangeDarkMode() { try { @@ -268,15 +268,15 @@ export default function Setting() { navigation.navigate('SettingProfil')} + onPress={() => navigation.navigate('Profil')} > - + Emre KARTAL id. Spotify, mail et mot de passe - + @@ -335,7 +335,7 @@ export default function Setting() { - + ) : <>} diff --git a/src/FLAD/screens/SpotDetailsPage.tsx b/src/FLAD/screens/SpotDetailsPage.tsx deleted file mode 100644 index 6ab1a62..0000000 --- a/src/FLAD/screens/SpotDetailsPage.tsx +++ /dev/null @@ -1,142 +0,0 @@ -import { View, Text, StyleSheet, Button, TouchableOpacity, SafeAreaView } from "react-native"; -import Animated, { interpolate, SensorType, useAnimatedSensor, useAnimatedStyle, useSharedValue, withSpring } from "react-native-reanimated"; -import { Audio } from 'expo-av'; -import { useEffect, useState } from "react"; -import { theService } from "../App"; - -const halfPi = Math.PI / 2; - -//@ts-ignore -const SpotDetailsPage = ({ route }) => { - console.log(route); - - const spot: { name: string, sourceUrl: string, index: number } = route.params.spot; - const [currentspot] = useState(spot); - const [sound, setSound] = useState(null); - - const [isPlaying, setIsPlaying] = useState(false); - const loader = useSharedValue(0); - useEffect(() => { - loader.value = isPlaying ? 1 : 0 - }, [isPlaying, loader]); - - - const trackPreviewUrl = 'https://p.scdn.co/mp3-preview/08ef3b9d6dbd6bab233f5e9ca564091902767f71?cid=774b29d4f13844c495f206cafdad9c86'; - - - const handlePlaySound = async () => { - if (sound === null) { - const { sound: newSound } = await Audio.Sound.createAsync( - { uri: trackPreviewUrl }, - { shouldPlay: true } - ); - setSound(newSound); - - } else { - //@ts-ignore - await sound.playAsync(); - } - }; - - const handleStopSound = async () => { - if (sound !== null) { - //@ts-ignore - await sound.stopAsync(); - } - else { - setIsPlaying(true); - } - }; - useEffect(() => { - return sound ? () => { - //@ts-ignore - sound.unloadAsync(); - } - : undefined; - }, [sound]); - - const sensor = useAnimatedSensor(SensorType.ROTATION); - const styleAniamatedImage = useAnimatedStyle(() => { - const { pitch, roll } = sensor.sensor.value; - const verticalAxis = interpolate( - pitch, - [-halfPi, halfPi], - [-45, 45] - ) - const horizontalAxis = interpolate( - roll, - [-halfPi * 2, halfPi * 2], - [-45, 45] - ) - return { - top: withSpring(verticalAxis), - left: withSpring(horizontalAxis), - }; - - }) - const id = '0cFS3AMF9Lhj3CNoFvwjvY' - - const getCurrentTrack = async () => { - theService.getMusicById(id); - } - - return ( - - - - - -