Improvement of the project structure 🎨
continuous-integration/drone/push Build is passing Details

pull/19/head
Emre KARTAL 2 years ago
parent a01fe4120b
commit aa87bf066e

@ -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;

@ -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;
}

@ -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,

@ -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);

@ -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": [
[

@ -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;

@ -1,3 +0,0 @@
<svg width="21" height="19" viewBox="0 0 21 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.85029 4.158C1.85877 3.01308 2.68386 2.08791 3.70044 2.08791H17.2996C18.3214 2.08791 19.1498 3.0227 19.1498 4.17582V4.18139L11.7151 8.74107C11.183 9.06737 10.5432 9.07922 10.0019 8.77281L1.85029 4.158ZM1.85022 6.49388V14.8242C1.85022 15.9773 2.67859 16.9121 3.70044 16.9121H17.2996C18.3214 16.9121 19.1498 15.9773 19.1498 14.8242V6.55774L12.5986 10.5756C11.5345 11.2282 10.2548 11.2519 9.17228 10.639L1.85022 6.49388ZM3.70044 0C1.65674 0 0 1.86958 0 4.17582V14.8242C0 17.1304 1.65674 19 3.70044 19H17.2996C19.3433 19 21 17.1304 21 14.8242V4.17582C21 1.86958 19.3433 0 17.2996 0H3.70044Z" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 757 B

@ -1,6 +0,0 @@
<svg width="20" height="17" viewBox="0 0 20 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="path-1-inside-1_70_52" fill="white">
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.12142 8.63961C1.28389 8.84583 1.46152 9.03956 1.65263 9.21911L8.09971 16.2523C8.8973 17.1224 10.271 17.1161 11.0606 16.2388L17.9089 8.62951L17.8988 8.62763C18.674 7.71412 19.1417 6.53135 19.1417 5.23935C19.1417 2.34574 16.7959 0 13.9023 0C12.0669 0 10.4518 0.943814 9.51612 2.3726C8.56693 1.03408 7.00516 0.16054 5.23935 0.16054C2.34574 0.16054 0 2.50628 0 5.39989C0 6.61822 0.415838 7.73942 1.11332 8.6293L1.11217 8.62951L1.12142 8.63961Z"/>
</mask>
<path d="M1.12142 8.63961L2.69245 7.40192L2.6462 7.34322L2.59571 7.28813L1.12142 8.63961ZM1.65263 9.21911L3.12694 7.86766L3.07648 7.81261L3.02206 7.76148L1.65263 9.21911ZM8.09971 16.2523L9.57402 14.9008L9.57402 14.9008L8.09971 16.2523ZM11.0606 16.2388L12.5472 17.5767L12.5472 17.5767L11.0606 16.2388ZM17.9089 8.62951L19.3955 9.96744L21.7842 7.31332L18.2732 6.66296L17.9089 8.62951ZM17.8988 8.62763L16.3739 7.33352L14.1402 9.96545L17.5345 10.5942L17.8988 8.62763ZM9.51612 2.3726L7.88468 3.5295L9.58181 5.92274L11.1892 3.46835L9.51612 2.3726ZM1.11332 8.6293L1.47049 10.5972L4.73275 10.0051L2.68743 7.39553L1.11332 8.6293ZM1.11217 8.62951L0.755003 6.66166L-2.81154 7.30899L-0.362119 9.98099L1.11217 8.62951ZM-0.449608 9.87729C-0.225421 10.1619 0.0196126 10.4291 0.283205 10.6767L3.02206 7.76148C2.90343 7.65003 2.7932 7.52981 2.69245 7.40192L-0.449608 9.87729ZM9.57402 14.9008L3.12694 7.86766L0.178324 10.5706L6.6254 17.6037L9.57402 14.9008ZM9.57402 14.9008L9.57402 14.9008L6.6254 17.6037C8.22058 19.3439 10.968 19.3314 12.5472 17.5767L9.57402 14.9008ZM16.4223 7.29158L9.57402 14.9008L12.5472 17.5767L19.3955 9.96744L16.4223 7.29158ZM17.5345 10.5942L17.5446 10.5961L18.2732 6.66296L18.263 6.66108L17.5345 10.5942ZM19.4236 9.92175C20.4941 8.6604 21.1417 7.02293 21.1417 5.23935H17.1417C17.1417 6.03977 16.8539 6.76784 16.3739 7.33352L19.4236 9.92175ZM21.1417 5.23935C21.1417 1.24117 17.9005 -2 13.9023 -2V2C15.6914 2 17.1417 3.45031 17.1417 5.23935H21.1417ZM13.9023 -2C11.3642 -2 9.13258 -0.692242 7.843 1.27684L11.1892 3.46835C11.7711 2.57987 12.7695 2 13.9023 2V-2ZM11.1476 1.21569C9.83945 -0.628956 7.68082 -1.83946 5.23935 -1.83946V2.16054C6.32949 2.16054 7.29441 2.69712 7.88468 3.5295L11.1476 1.21569ZM5.23935 -1.83946C1.24117 -1.83946 -2 1.40171 -2 5.39989H2C2 3.61085 3.45031 2.16054 5.23935 2.16054V-1.83946ZM-2 5.39989C-2 7.08121 -1.42438 8.63367 -0.460783 9.86307L2.68743 7.39553C2.25605 6.84516 2 6.15522 2 5.39989H-2ZM1.46933 10.5974L1.47049 10.5972L0.756159 6.66145L0.755003 6.66166L1.46933 10.5974ZM2.59571 7.28813L2.58645 7.27804L-0.362119 9.98099L-0.352865 9.99108L2.59571 7.28813Z" fill="white" mask="url(#path-1-inside-1_70_52)"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

@ -1,3 +0,0 @@
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.88862 0.324035C1.45657 -0.108012 0.756083 -0.108012 0.324036 0.324035C-0.108011 0.756082 -0.108013 1.45657 0.324034 1.88861L5.75471 7.31929L0.324038 12.75C-0.108009 13.182 -0.108009 13.8825 0.324038 14.3145C0.756085 14.7466 1.45657 14.7466 1.88862 14.3145L7.31929 8.88387L12.75 14.3145C13.182 14.7466 13.8825 14.7466 14.3145 14.3145C14.7466 13.8825 14.7466 13.182 14.3145 12.75L8.88387 7.31929L14.3145 1.88863C14.7466 1.45658 14.7466 0.756092 14.3145 0.324045C13.8825 -0.108002 13.182 -0.108004 12.75 0.324043L7.31929 5.75471L1.88862 0.324035Z" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 835 B

@ -1,3 +0,0 @@
<svg width="26" height="18" viewBox="0 0 26 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.837607 0C1.3002 0 1.67521 0.400086 1.67521 0.893617V17.1064C1.67521 17.5999 1.3002 18 0.837607 18C0.375009 18 0 17.5999 0 17.1064V0.893617C0 0.400086 0.375009 0 0.837607 0ZM4.90598 0C5.36858 0 5.74359 0.400086 5.74359 0.893617V17.1064C5.74359 17.5999 5.36858 18 4.90598 18C4.44339 18 4.06838 17.5999 4.06838 17.1064V0.893617C4.06838 0.400086 4.44339 0 4.90598 0ZM9.93162 2.53621V16.2128H12.3248V12.1941C12.62 12.367 12.9968 12.5 13.4468 12.5H14V16.8511C14 17.4856 13.5178 18 12.9231 18H9.33333C8.72658 18 8.25641 17.4699 8.25641 16.8482V1.3651C8.25641 0.464709 9.19429 -0.101539 9.9188 0.39861L13.5077 2.87616C13.813 3.08688 14 3.44946 14 3.84103V6.5H13.4468C12.9968 6.5 12.62 6.63296 12.3248 6.80589V4.18828L9.93162 2.53621ZM13 9.5C13 10.0523 13.2 10.5 13.4468 10.5H14H16.5V13.5532C16.5 13.8 16.9477 14 17.5 14C18.0523 14 18.5 13.8 18.5 13.5532V10.5H21.5532C21.8 10.5 22 10.0523 22 9.5C22 8.94772 21.8 8.5 21.5532 8.5H18.5V5.44681C18.5 5.20004 18.0523 5 17.5 5C16.9477 5 16.5 5.20004 16.5 5.44681V8.5H14H13.4468C13.2 8.5 13 8.94771 13 9.5Z" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

@ -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;

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 284 KiB

After

Width:  |  Height:  |  Size: 284 KiB

Before

Width:  |  Height:  |  Size: 590 KiB

After

Width:  |  Height:  |  Size: 590 KiB

Before

Width:  |  Height:  |  Size: 489 KiB

After

Width:  |  Height:  |  Size: 489 KiB

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before

Width:  |  Height:  |  Size: 557 B

After

Width:  |  Height:  |  Size: 557 B

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 677 B

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 674 B

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

Before

Width:  |  Height:  |  Size: 766 KiB

After

Width:  |  Height:  |  Size: 766 KiB

Before

Width:  |  Height:  |  Size: 760 KiB

After

Width:  |  Height:  |  Size: 760 KiB

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 218 KiB

Before

Width:  |  Height:  |  Size: 756 KiB

After

Width:  |  Height:  |  Size: 756 KiB

Before

Width:  |  Height:  |  Size: 4.1 MiB

After

Width:  |  Height:  |  Size: 4.1 MiB

Before

Width:  |  Height:  |  Size: 778 KiB

After

Width:  |  Height:  |  Size: 778 KiB

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 834 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 963 B

After

Width:  |  Height:  |  Size: 963 B

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 579 KiB

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -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";

@ -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;

@ -157,7 +157,7 @@ const Card = ({ image, onSwipe }: CardProps) => {
}, opacRStyle]}
>
<Image style={[{ alignSelf: "center" }]}
source={require('../assets/icons/icons/icon_dislike.png')}
source={require('../assets/images/dislike_icon.png')}
/>
</Animated.View>
<Animated.View
@ -172,7 +172,7 @@ const Card = ({ image, onSwipe }: CardProps) => {
}, opacLStyle]}
>
<Image style={[{ alignSelf: "center" }]}
source={require('../assets/icons/icons/icon_like.png')}
source={require('../assets/images/like_icon.png')}
/>
</Animated.View>
@ -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')}
/>
</Animated.View>

@ -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({

@ -38,7 +38,7 @@ const FladLoading = () => {
<View style={{ justifyContent: 'center', alignItems: 'center' }}>
<Animated.View style={[{ backgroundColor: '#B40404', justifyContent: 'center', alignItems: 'center' }, breatheStyleSquare]}>
<Animated.Image source={require('../assets/icons/icon.png')} style={[{ height: size, width: size, borderColor: '#fff', borderRadius: size / 2 }]} />
<Animated.Image source={require('../assets/images/icon.png')} style={[{ height: size, width: size, borderColor: '#fff', borderRadius: size / 2 }]} />
</Animated.View>
</View>

@ -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) {
<Text style={styles.time}> · 1sem</Text>
</View>
</View>
<Image style={styles.button} source={require('../assets/icons/icons/buttonProfil.png')} />
<Image style={styles.button} source={require('../assets/images/chevron_right_icon.png')} />
</View>
)
}

@ -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 = () => {

@ -1,3 +0,0 @@
export default function Messaging() {
}

@ -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;

@ -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: {

@ -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";

@ -1,4 +1,4 @@
export const GraphicalCharterDark = {
export const colorsDark = {
"body": "#141414",
"Text": "white",
"Card": "#232123",

@ -1,4 +1,4 @@
export const GraphicalCharterLight = {
export const colorsLight = {
"body": "#f2f2f6",
"Text": "black",
"Card": "#fff",

@ -1 +1 @@
export const API_URL = "https://flad-api-production.up.railway.app"
export const API_URL = "https://flad-api-production.up.railway.app"

@ -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",

@ -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')
}
]

@ -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 (
<SafeAreaProvider onLayout={() => setAppIsReady(true)}>
{isLogin ? (
<Navigation />
<HomeNavigation />
) :
<StartNavigation/>
<HomeNavigation />
}
</SafeAreaProvider>
)

@ -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() {
/>
<Stack.Screen
name="MusicDetail"
component={MusicDetail}
name="Detail"
component={DetailScreen}
sharedElements={(route) => { return [route.params.music.id] }}
/>
</Stack.Navigator>

@ -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<Location.LocationObject>();
//@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,

@ -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() {
<Stack.Navigator initialRouteName="Conversation" screenOptions={{ gestureEnabled: true, headerShown: false, cardOverlayEnabled: true, cardStyle: { backgroundColor: "transparent" } }}>
<Stack.Screen
name="Conversation"
component={Conversation}
component={ConversationScreen}
/>
<Stack.Screen
name="Chat"
component={Chat}
options = {{
component={ChatScreen}
options={{
headerShown: true
}}
/>

@ -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() {
<Stack.Navigator initialRouteName="Setting">
<Stack.Screen
name="Setting"
component={Setting}
component={SettingScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="SettingProfil"
component={SettingProfil}
name="Profil"
component={ProfilScreen}
options={{ headerShown: false }}
/>
</Stack.Navigator>

@ -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() {
}}
>
<Stack.Screen
name="SpotsPage"
component={SpotPage}
name="Spot"
component={SpotScreen}
/>
<Stack.Screen
name="DetailsSpot"
component={MusicDetail}
name="Detail"
component={DetailScreen}
/>
</Stack.Navigator>
)

@ -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() {
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={Onboarding}
name="Start"
component={StartScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Login"
component={Login}
component={LoginScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Register"
component={Register}
component={RegisterScreen}
options={{ headerShown: false }}
/>
</Stack.Navigator>

@ -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

@ -1,4 +1,4 @@
import Music from "../../Model/Music";
import Music from "../../model/Music";
import { favoritesTypes } from "../types/favoritesTypes";
export const getFavoritesMusic = (music: Music[]) => {

@ -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";

@ -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

@ -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";

@ -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 = {

@ -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');
}

@ -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) => {

@ -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';

@ -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();

@ -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: {

@ -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<Music[]>([]);
@ -188,7 +188,7 @@ const MusicDetail = ({ route }) => {
);
};
export default MusicDetail;
export default DetailScreen;
const styles = StyleSheet.create({
mainSafeArea: {

@ -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

@ -14,7 +14,7 @@ const DismissKeyboard = ({ children }) => (
</TouchableWithoutFeedback>
)
export default function LoginPage() {
export default function LoginScreen() {
const [sound, setSound] = useState<Audio.Sound>();
const [rememberMe, setRememberMe] = useState(false);
const navigation = useNavigation();
@ -50,11 +50,11 @@ export default function LoginPage() {
return (
<DismissKeyboard>
<View style={styles.container}>
<ImageBackground source={require("../assets/images/Background.png")} resizeMode="cover" style={styles.image}>
<ImageBackground source={require("../assets/images/background.png")} resizeMode="cover" style={styles.image}>
<Text style={styles.versionText}>
v2.0
</Text>
<Image source={require("../assets/icons/Logo_White_Flad.png")} style={styles.imageLogo} />
<Image source={require("../assets/images/flad_logo.png")} style={styles.imageLogo} />
<Text style={styles.text}>SE CONNECTER</Text>
{failedLogin && (
<Text style={styles.textError}>Email ou mot de passe incorrect!</Text>
@ -64,7 +64,7 @@ export default function LoginPage() {
placeholderTextColor="#B8B4B8"
value={username}
onChangeText={setUsername} style={[styles.input, styles.shadow]} />
<Image source={require('../assets/icons/icons/User.png')} style={styles.iconUser} />
<Image source={require('../assets/images/user_icon.png')} style={styles.iconUser} />
</View>
<View>
<TextInput placeholder="Password"
@ -79,7 +79,7 @@ export default function LoginPage() {
<Text style={styles.rememberMeText}>SE SOUVENIR DE MOI</Text>
</View>
<TouchableOpacity style={[styles.button, styles.shadow]} onPress={submitForm}>
<Image source={require("../assets/icons/Check.png")} style={styles.buttonImage} />
<Image source={require("../assets/images/check_icon.png")} style={styles.buttonImage} />
</TouchableOpacity>
<View style={styles.inscriptionText}>
<Text style={{ fontSize: normalize(18), color: 'white' }}>Tu n'as pas de compte? </Text>

@ -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 }) => (
</TouchableWithoutFeedback>
)
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')}>
<View style={styles.exit}>
<Image style={styles.buttonSetting} source={require('../assets/icons/icons/buttonProfil_Inverse.png')} />
<Image style={styles.buttonSetting} source={require('../assets/images/chevron_right_icon.png')} />
<Text style={styles.textExit}>Exit</Text>
</View>
</TouchableOpacity>
<View style={styles.profilHead}>
<Text style={styles.title}>Profil</Text>
<View style={styles.imageWrapper}>
<Image source={{ uri: UserCurrent.image }} style={styles.imageProfil} />
</View>
<View style={styles.editButton}>
<TouchableOpacity onPress={pickImage} >
<Image
source={require('../assets/icons/icons/edit.png')} style={{ resizeMode: "stretch", height: '85%', aspectRatio: 1 }}
/>
</TouchableOpacity>
</View>
<TouchableOpacity onPress={pickImage} >
<View style={styles.imageWrapper}>
<Image source={{ uri: UserCurrent.image }} style={styles.imageProfil} />
</View>
</TouchableOpacity>
</View>
<View style={styles.body}>
<View style={styles.optionId}>

@ -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<Audio.Sound>();
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 (
<DismissKeyboard>
<View style={styles.container}>
<ImageBackground source={require("../assets/images/Background.png")} resizeMode="cover" style={styles.image}>
<ImageBackground source={require("../assets/images/background.png")} resizeMode="cover" style={styles.image}>
<Text style={styles.versionText}>
v2.0
</Text>
<Image source={require("../assets/icons/Logo_White_Flad.png")} style={styles.imageLogo} />
<Image source={require("../assets/images/flad_logo.png")} style={styles.imageLogo} />
<Text style={styles.text}>S'INSCRIRE</Text>
{failedSignup && (
<Text style={styles.textError}>Email ou mot de passe incorrect!</Text>
@ -119,31 +119,31 @@ export default function InscriptionPage() {
placeholderTextColor="#B8B4B8"
value={username}
onChangeText={setUsername} />
<Image source={require('../assets/icons/icons/User.png')} style={styles.iconUser} />
<Image source={require('../assets/images/user_icon.png')} style={styles.iconUser} />
</View>
<View>
<TextInput style={[styles.input, styles.shadow]} placeholder="Email"
placeholderTextColor="#B8B4B8"
value={email}
onChangeText={setEmail} />
<Image source={require('../assets/icons/icons/lock.png')} style={styles.iconLock} />
<Image source={require('../assets/images/lock_icon.png')} style={styles.iconLock} />
</View>
<View>
<TextInput style={[styles.input, styles.shadow]} placeholder="Password"
placeholderTextColor="#B8B4B8"
value={password} secureTextEntry={true}
onChangeText={setPassword} />
<Image source={require('../assets/icons/icons/lock.png')} style={styles.iconLock} />
<Image source={require('../assets/images/lock_icon.png')} style={styles.iconLock} />
</View>
<TouchableOpacity onPress={async () => {
await getTokens2();
}} style={[styles.buttonSpotify, styles.shadow]}>
<Text style={styles.textIntoButton}>Lier compte</Text>
<Image source={require("../assets/icons/icons/Spotify.png")} style={{ width: normalize(35), height: normalize(35) }} />
<Image source={require("../assets/images/spotify_icon.png")} style={{ width: normalize(35), height: normalize(35) }} />
</TouchableOpacity>
<TouchableOpacity style={[styles.button, styles.shadow]} onPress={() => submitForm()}>
<Image source={require("../assets/icons/icons/next.png")} style={styles.buttonImage} />
<Image source={require("../assets/images/arrow_forward.png")} style={styles.buttonImage} />
</TouchableOpacity>
<View style={styles.connectionText}>
<Text style={{ fontSize: normalize(18), color: 'white' }}>Tu as déjà un compte? </Text>

@ -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 }) => (
</TouchableWithoutFeedback>
)
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() {
<TouchableOpacity
// @ts-ignore
onPress={() => navigation.navigate('SettingProfil')}
onPress={() => navigation.navigate('Profil')}
>
<View style={styles.profil}>
<Image source={require('../assets/icons/icons/IconProfil.png')} style={styles.imageProfil} />
<Image source={require('../assets/images/profil_icon_asupp.png')} style={styles.imageProfil} />
<View style={styles.profilContainer}>
<Text style={styles.NameProfil}>Emre KARTAL</Text>
<Text style={styles.description}>id. Spotify, mail et mot de passe</Text>
</View>
<Image style={styles.buttonSetting} source={require('../assets/icons/icons/buttonProfil.png')} />
<Image style={styles.buttonSetting} source={require('../assets/images/chevron_right_icon.png')} />
</View>
</TouchableOpacity>
@ -335,7 +335,7 @@ export default function Setting() {
<View style={styles.musicActually}>
<CardMusic image={currentMusic.image} title={currentMusic.title} description={currentMusic.bio} id='1' />
<Image source={require("../assets/images/FladyShadow.png")} style={styles.mascot} />
<Image source={require("../assets/images/flady_shadow.png")} style={styles.mascot} />
</View>
</>
) : <></>}

@ -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 (
<SafeAreaView style={styles.mainSafeArea}>
<View style={{ flex: 1, justifyContent: 'flex-start', alignItems: 'center' }}>
<View style={{ borderWidth: 1, borderColor: 'red' }}>
<Animated.Image
source={{
uri: currentspot.sourceUrl,
}}
style={[
{
width: 370,
height: 370,
borderRadius: 24,
resizeMode: 'stretch',
}, styleAniamatedImage
]}
/>
<Button title="Current Track"
onPress={() => {
getCurrentTrack()
}}
/>
</View>
<Animated.View>
<TouchableOpacity style={{
backgroundColor: '#1DB954',
paddingVertical: 12,
paddingHorizontal: 24,
borderRadius: 24,
}} onPressIn={handlePlaySound}
onPressOut={handleStopSound}
onLongPress={handlePlaySound}
delayLongPress={1000}>
<Text style={{
color: '#fff',
fontSize: 16,
fontWeight: 'bold',
}}>
{isPlaying ? 'Playing...' : 'Play'}
</Text>
</TouchableOpacity>
</Animated.View>
</View>
</SafeAreaView>
);
};
export default SpotDetailsPage;
const styles = StyleSheet.create({
mainSafeArea: {
flex: 1,
backgroundColor: "#141414",
}
})

@ -1,205 +1,205 @@
import { View, Text, Dimensions, StyleSheet, ImageBackground, Image, Pressable, TouchableOpacity, SafeAreaView } from 'react-native'
import React, { useCallback,useEffect, useRef, useState } from 'react'
import { LinearGradient } from 'expo-linear-gradient';
import * as Haptics from 'expo-haptics';
import Animated from 'react-native-reanimated';
import Card from '../components/Card';
import { cards as cardArray, spotArray2 } from '../data/data'
import AdjustSize from '../components/AdjustSize';
import normalize from '../components/Normalize';
import LottieView from 'lottie-react-native'
import Lotties from '../assets/lottie/Lottie';
import FladLoading from '../components/FladLoadingScreen';
import { useNavigation } from '@react-navigation/native';
import Music from '../Model/Music';
import { addFavoritesMusic } from '../redux/actions/appActions';
import { useDispatch, useSelector } from 'react-redux';
import { Spot } from '../Model/Spot';
import { removeFromSpotList, setSpotList } from '../redux/actions/spotActions';
export default function SpotPage() {
//@ts-ignore
const spotReducer = useSelector(state => state.appReducer.spot)
const [cards, setCards] = useState<Spot[]>(spotReducer);
const [currentCard, setcurrentCard] = useState(cards[cards.length - 1]);
useEffect(() => {
setCards(spotReducer);
setcurrentCard(spotReducer[spotReducer.length - 1]);
}, [spotReducer]);
const onSwipe = (direction: 'left' | 'right' | 'down') => {
if (direction === 'right') {
// Swiped right
addLike(currentCard);
} else if (direction === 'left') {
// Swiped left
console.log('Swiped left');
removeSpots(currentCard);
}
else if (direction === 'down') {
// Swiped down
addMockSpots();
console.log('Swiped down');
}
};
const likeButtonref = useRef<LottieView>(null);
const onLike = useCallback(() => {
likeButtonref.current?.reset();
likeButtonref.current?.play(0, 55);
likeButtonref.current?.play(55, 0);
}, [])
const dispatch = useDispatch();
function addLike(spot: Spot) {
onLike();
dispatch(addFavoritesMusic(spot.music))
dispatch(removeFromSpotList(spot));
}
function removeSpots(spot: Spot) {
dispatch(removeFromSpotList(spot));
}
function addMockSpots() {
//@ts-ignore
dispatch(setSpotList(spotArray2))
}
const navigator = useNavigation();
const { width: wWidht } = Dimensions.get("window");
const hapti = (card: Spot) => {
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy)
// @ts-ignore
navigator.navigate("DetailsSpot", { "music": card.music })
};
return (
<View style={{
flex: 1,
}}>
{cards.length > 0 ? (
<>
<ImageBackground blurRadius={7}
style={{
position: 'absolute',
width: "100%",
height: "100%",
justifyContent: "center",
alignItems: "center",
}}
source={{
uri: currentCard.music.image,
}}
></ImageBackground>
<SafeAreaView style={styles.mainSafeArea}>
<LinearGradient colors={['rgba(2, 2, 2, 0.58) 0%', 'rgba(0, 0, 0, 0) 100.56%']} style={styles.gradient}>
<Text
style={{
fontStyle: 'normal',
left: wWidht / 9,
top: normalize(87),
color: "#FFFFFF",
fontSize: normalize(AdjustSize(currentCard.music.title)),
fontWeight: "800",
}}>{currentCard.music.title}</Text>
<Text
style={{
fontStyle: 'normal',
left: wWidht / 9,
top: normalize(87),
color: "#FFFFFF",
fontSize: normalize(20),
}}>{currentCard.music.bio}</Text>
</LinearGradient>
</SafeAreaView>
<View style={{ flex: 8.35 }}>
<View style={{ flex: 1.83, justifyContent: 'center', alignItems: 'center' }}>
{cards.map((card) => (
<View key={card.userSpotifyId} style={{ position: 'absolute' }} >
<Pressable onLongPress={() => { hapti(card) }} >
<Card
title={card.music.title}
image={card.music.image}
onSwipe={(direction) => { onSwipe(direction) }}
/>
</Pressable>
</View>
))
}
</View>
<View style={{ flex: 1, flexDirection: 'row', alignItems: "flex-start", justifyContent: 'center' }}>
<Animated.View style={{ flexDirection: 'row', width: '92%', alignItems: "center", justifyContent: 'space-evenly' }}>
<TouchableOpacity style={styles.button} onPress={() => onSwipe('left')}>
<Image source={require("../assets/icons/icons/icon_dislike_no_text.png")} style={{width: '45%', height: '40%'}}/>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => onSwipe('down')}>
<Image source={require("../assets/icons/icons/icon_discovery_no_text.png")} style={{width: '58%', height: '50%', marginLeft: '7%'}}/>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => onSwipe('right')}>
<LottieView autoPlay={false} loop={false} ref={likeButtonref} speed={2} source={Lotties.likeAnimation} style={styles.lottie} />
</TouchableOpacity>
</Animated.View>
</View>
</View>
</>
)
: (<View style={{ justifyContent: 'center', alignItems: 'center', flex: 1, backgroundColor: "#141414" }}>
<View style={{ position: "absolute" }}>
<FladLoading />
</View>
<Text style={{ color: "grey", fontWeight: "400", textAlign: "center", top: 100 }}>Vous avez explorer toutes les spot autour de vous.
{"\n"}Continuer dans discoverie pour découvrir de nouvelles music basées sur vos gouts musicaux.</Text>
</View>)
}
</View>
);
};
const styles = StyleSheet.create({
mainSafeArea: {
flex: 1,
},
spot: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
alignContent: 'center',
flexDirection: 'column',
backgroundColor: '#000'
},
lottie: {
width: '100%',
},
button: {
setOpacityTo: 0.8,
alignItems: 'center',
borderRadius: 100,
justifyContent: 'center',
width: 61,
height: 61,
backgroundColor: '#24243A',
opacity: 0.8,
shadowRadius: 2,
},
gradient: {
position: "absolute",
top: 0,
left: 0,
right: 0,
height: 209,
},
})
import { View, Text, Dimensions, StyleSheet, ImageBackground, Image, Pressable, TouchableOpacity, SafeAreaView } from 'react-native'
import React, { useCallback,useEffect, useRef, useState } from 'react'
import { LinearGradient } from 'expo-linear-gradient';
import * as Haptics from 'expo-haptics';
import Animated from 'react-native-reanimated';
import Card from '../components/Card';
import { cards as cardArray, spotArray2 } from '../data/data'
import AdjustSize from '../components/AdjustSize';
import normalize from '../components/Normalize';
import LottieView from 'lottie-react-native'
import Lotties from '../assets/lottie/Lottie';
import FladLoading from '../components/FladLoadingScreen';
import { useNavigation } from '@react-navigation/native';
import Music from '../model/Music';
import { addFavoritesMusic } from '../redux/actions/appActions';
import { useDispatch, useSelector } from 'react-redux';
import { Spot } from '../model/Spot';
import { removeFromSpotList, setSpotList } from '../redux/actions/spotActions';
export default function SpotScreen() {
//@ts-ignore
const spotReducer = useSelector(state => state.appReducer.spot)
const [cards, setCards] = useState<Spot[]>(spotReducer);
const [currentCard, setcurrentCard] = useState(cards[cards.length - 1]);
useEffect(() => {
setCards(spotReducer);
setcurrentCard(spotReducer[spotReducer.length - 1]);
}, [spotReducer]);
const onSwipe = (direction: 'left' | 'right' | 'down') => {
if (direction === 'right') {
// Swiped right
addLike(currentCard);
} else if (direction === 'left') {
// Swiped left
console.log('Swiped left');
removeSpots(currentCard);
}
else if (direction === 'down') {
// Swiped down
addMockSpots();
console.log('Swiped down');
}
};
const likeButtonref = useRef<LottieView>(null);
const onLike = useCallback(() => {
likeButtonref.current?.reset();
likeButtonref.current?.play(0, 55);
likeButtonref.current?.play(55, 0);
}, [])
const dispatch = useDispatch();
function addLike(spot: Spot) {
onLike();
dispatch(addFavoritesMusic(spot.music))
dispatch(removeFromSpotList(spot));
}
function removeSpots(spot: Spot) {
dispatch(removeFromSpotList(spot));
}
function addMockSpots() {
//@ts-ignore
dispatch(setSpotList(spotArray2))
}
const navigator = useNavigation();
const { width: wWidht } = Dimensions.get("window");
const hapti = (card: Spot) => {
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy)
// @ts-ignore
navigator.navigate("DetailsSpot", { "music": card.music })
};
return (
<View style={{
flex: 1,
}}>
{cards.length > 0 ? (
<>
<ImageBackground blurRadius={7}
style={{
position: 'absolute',
width: "100%",
height: "100%",
justifyContent: "center",
alignItems: "center",
}}
source={{
uri: currentCard.music.image,
}}
></ImageBackground>
<SafeAreaView style={styles.mainSafeArea}>
<LinearGradient colors={['rgba(2, 2, 2, 0.58) 0%', 'rgba(0, 0, 0, 0) 100.56%']} style={styles.gradient}>
<Text
style={{
fontStyle: 'normal',
left: wWidht / 9,
top: normalize(87),
color: "#FFFFFF",
fontSize: normalize(AdjustSize(currentCard.music.title)),
fontWeight: "800",
}}>{currentCard.music.title}</Text>
<Text
style={{
fontStyle: 'normal',
left: wWidht / 9,
top: normalize(87),
color: "#FFFFFF",
fontSize: normalize(20),
}}>{currentCard.music.bio}</Text>
</LinearGradient>
</SafeAreaView>
<View style={{ flex: 8.35 }}>
<View style={{ flex: 1.83, justifyContent: 'center', alignItems: 'center' }}>
{cards.map((card) => (
<View key={card.userSpotifyId} style={{ position: 'absolute' }} >
<Pressable onLongPress={() => { hapti(card) }} >
<Card
title={card.music.title}
image={card.music.image}
onSwipe={(direction) => { onSwipe(direction) }}
/>
</Pressable>
</View>
))
}
</View>
<View style={{ flex: 1, flexDirection: 'row', alignItems: "flex-start", justifyContent: 'center' }}>
<Animated.View style={{ flexDirection: 'row', width: '92%', alignItems: "center", justifyContent: 'space-evenly' }}>
<TouchableOpacity style={styles.button} onPress={() => onSwipe('left')}>
<Image source={require("../assets/images/dislike_icon_no_text.png")} style={{width: '45%', height: '40%'}}/>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => onSwipe('down')}>
<Image source={require("../assets/images/discovery_icon_no_text.png")} style={{width: '58%', height: '50%', marginLeft: '7%'}}/>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => onSwipe('right')}>
<LottieView autoPlay={false} loop={false} ref={likeButtonref} speed={2} source={Lotties.likeAnimation} style={styles.lottie} />
</TouchableOpacity>
</Animated.View>
</View>
</View>
</>
)
: (<View style={{ justifyContent: 'center', alignItems: 'center', flex: 1, backgroundColor: "#141414" }}>
<View style={{ position: "absolute" }}>
<FladLoading />
</View>
<Text style={{ color: "grey", fontWeight: "400", textAlign: "center", top: 100 }}>Vous avez explorer toutes les spot autour de vous.
{"\n"}Continuer dans discoverie pour découvrir de nouvelles music basées sur vos gouts musicaux.</Text>
</View>)
}
</View>
);
};
const styles = StyleSheet.create({
mainSafeArea: {
flex: 1,
},
spot: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
alignContent: 'center',
flexDirection: 'column',
backgroundColor: '#000'
},
lottie: {
width: '100%',
},
button: {
setOpacityTo: 0.8,
alignItems: 'center',
borderRadius: 100,
justifyContent: 'center',
width: 61,
height: 61,
backgroundColor: '#24243A',
opacity: 0.8,
shadowRadius: 2,
},
gradient: {
position: "absolute",
top: 0,
left: 0,
right: 0,
height: 209,
},
})

@ -2,15 +2,15 @@ import React, { useState, useRef } from 'react';
import { Modal, View, StyleSheet, useColorScheme, Text, FlatList, Animated, TouchableOpacity, ImageBackground, Image } from 'react-native';
import { useNavigation } from "@react-navigation/native";
import normalize from '../components/Normalize';
import OnboardingItem from './OnboardingItem';
import Paginator from './Paginator';
import NextButton from './NextButton';
import OnboardingItem from '../components/OnboardingComponent';
import Paginator from '../components/Paginator';
import NextButton from '../components/NextButton';
import slides from '../data/slides';
import { GraphicalCharterDark } from '../assets/GraphicalCharterDark';
import { GraphicalCharterLight } from '../assets/GraphicalCharterLight';
import { colorsDark } from '../constants/colorsDark';
import { colorsLight } from '../constants/colorsLight';
export default function Onboarding() {
const style = useColorScheme() == 'light' ? GraphicalCharterLight : GraphicalCharterDark;
export default function StartScreen() {
const style = useColorScheme() == 'light' ? colorsLight : colorsDark;
const [currentIndex, setCurrentIndex] = useState(0);
const scrollX = useRef(new Animated.Value(0)).current;
const slidesRef = useRef(null);
@ -164,7 +164,7 @@ export default function Onboarding() {
</View>
<Modal animationType="slide" visible={isModalVisible} presentationStyle={'pageSheet'}>
<View style={styles.modalContent}>
<ImageBackground source={require("../assets/images/Background_Start_Page.png")} style={styles.backgroundImage}>
<ImageBackground source={require("../assets/images/background_start.png")} style={styles.backgroundImage}>
<View style={styles.modalView}>
<Text style={styles.versionText}>
v2.0
@ -174,7 +174,7 @@ export default function Onboarding() {
<Image source={require("../assets/icons/icons/croix.png")} style={styles.imageButton} />
</View>
</TouchableOpacity>
<Image source={require("../assets/icons/Logo_White_Flad.png")} style={styles.imageLogo} />
<Image source={require("../assets/images/flad_logo.png")} style={styles.imageLogo} />
<TouchableOpacity
style={styles.buttonConnection}
onPress={() => {
@ -191,7 +191,7 @@ export default function Onboarding() {
>
<Text style={styles.text}>SINSCRIRE MAINTENANT</Text>
</TouchableOpacity>
<Image source={require("../assets/images/Flady.gif")} style={styles.mascot} />
<Image source={require("../assets/images/flady.gif")} style={styles.mascot} />
<TouchableOpacity
style={styles.button2Connection}
// @ts-ignore

@ -1,6 +1,6 @@
import axios from "axios";
import MusicFactory from "../../Model/factory/MusicFactory";
import Music from "../../Model/Music";
import MusicMapper from "../../model/mapper/MusicMapper";
import Music from "../../model/Music";
import { FetchOptions, RequestHandler } from "./spotifyRequestHandler/utils";
export class MusicMinimal {
public id: string;

@ -1,5 +1,5 @@
import axios, { AxiosResponse } from "axios";
import { MY_SECURE_AUTH_STATE_KEY, MY_SECURE_AUTH_STATE_KEY_REFRESH } from "../../../screens/Register";
import { MY_SECURE_AUTH_STATE_KEY, MY_SECURE_AUTH_STATE_KEY_REFRESH } from "../../../screens/RegisterScreen";
import * as SecureStore from 'expo-secure-store';
export type Methods = 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH';

Loading…
Cancel
Save