Merge Conflict
continuous-integration/drone/push Build is passing
Details
Before Width: | Height: | Size: 131 KiB |
After Width: | Height: | Size: 208 KiB |
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 136 KiB |
@ -1,112 +1,112 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import SpotifyService from "../services/spotify/spotify.service";
|
import SpotifyService from "../services/spotify/spotify.service";
|
||||||
|
|
||||||
class Manager{
|
class Manager {
|
||||||
|
|
||||||
// injection de dépences
|
// injection de dépences
|
||||||
spotifyService = new SpotifyService();
|
spotifyService = new SpotifyService();
|
||||||
userService = new userService();
|
userService = new userService();
|
||||||
|
|
||||||
private currentUser = useState(null);
|
private currentUser = useState(null);
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// spotify methods
|
// spotify methods
|
||||||
apiAuthorization(url : string) {
|
apiAuthorization(url: string) {
|
||||||
this.spotifyService.apiAuthorization(url);
|
this.spotifyService.apiAuthorization(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
getCompleteMusic = async (id : string) :Promise<Music> =>{
|
getCompleteMusic = async (id: string): Promise<Music> => {
|
||||||
// Map info = await spotifyService.getTrackInfo(id);
|
// Map info = await spotifyService.getTrackInfo(id);
|
||||||
// return Music(id, info['name'], info['artist'], info['cover']);
|
// return Music(id, info['name'], info['artist'], info['cover']);
|
||||||
}
|
}
|
||||||
|
|
||||||
removeFromPlaylist(id : string) {
|
removeFromPlaylist(id: string) {
|
||||||
this.spotifyService.removeFromPlaylist(id);
|
this.spotifyService.removeFromPlaylist(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
addToPlaylist(id : string) {
|
addToPlaylist(id: string) {
|
||||||
this.spotifyService.addToPlaylist(id);
|
this.spotifyService.addToPlaylist(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
playTrack(id : string) {
|
playTrack(id: string) {
|
||||||
this.spotifyService.playTrack(id);
|
this.spotifyService.playTrack(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
|
|
||||||
// private readonly getTaskById: RequestHandler = async (
|
// private readonly getTaskById: RequestHandler = async (
|
||||||
// req: Request,
|
// req: Request,
|
||||||
// res: Response,
|
// res: Response,
|
||||||
// next: NextFunction
|
// next: NextFunction
|
||||||
// ): Promise<Response | void> => {
|
// ): Promise<Response | void> => {
|
||||||
// try {
|
// try {
|
||||||
// const id = req.params.taskId;
|
// const id = req.params.taskId;
|
||||||
// const userId = req.params.userId;
|
// const userId = req.params.userId;
|
||||||
|
|
||||||
// const data = await this.Taskservice.getTaskById(id, userId);
|
// const data = await this.Taskservice.getTaskById(id, userId);
|
||||||
// res.status(201).send(data);
|
// res.status(201).send(data);
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// catch(error){
|
// catch(error){
|
||||||
// next(new HttpException(400, 'Cannot create post'));
|
// next(new HttpException(400, 'Cannot create post'));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// private delete = async (
|
// private delete = async (
|
||||||
// req: Request,
|
// req: Request,
|
||||||
// res: Response,
|
// res: Response,
|
||||||
// next: NextFunction
|
// next: NextFunction
|
||||||
// ): Promise<Response | void> => {
|
// ): Promise<Response | void> => {
|
||||||
// try {
|
// try {
|
||||||
// const id = req.params.taskId;
|
// const id = req.params.taskId;
|
||||||
// const userId = req.params.userId;
|
// const userId = req.params.userId;
|
||||||
// await this.Taskservice.DeleteTask(id, userId);
|
// await this.Taskservice.DeleteTask(id, userId);
|
||||||
// return res.status(200).send({ status: "Success", msg: "Data Removed" });
|
// return res.status(200).send({ status: "Success", msg: "Data Removed" });
|
||||||
// } catch (error) {
|
// } catch (error) {
|
||||||
// next(new HttpException(400, 'Cannot create post'));
|
// next(new HttpException(400, 'Cannot create post'));
|
||||||
// }
|
// }
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// private updateTask = async (
|
// private updateTask = async (
|
||||||
// req: Request,
|
// req: Request,
|
||||||
// res: Response,
|
// res: Response,
|
||||||
// next: NextFunction
|
// next: NextFunction
|
||||||
// ): Promise<Response | void> => {
|
// ): Promise<Response | void> => {
|
||||||
// try {
|
// try {
|
||||||
|
|
||||||
// const taskId = req.params.taskId;
|
// const taskId = req.params.taskId;
|
||||||
// const userId = req.params.userId;
|
// const userId = req.params.userId;
|
||||||
// const reqBody:CreateTaskReqBody = Object.assign({}, req.body);
|
// const reqBody:CreateTaskReqBody = Object.assign({}, req.body);
|
||||||
|
|
||||||
// const updatedTask = await this.Taskservice.UpdateTask(
|
// const updatedTask = await this.Taskservice.UpdateTask(
|
||||||
// // req.auth!.uid,
|
// // req.auth!.uid,
|
||||||
// taskId,
|
// taskId,
|
||||||
// userId,
|
// userId,
|
||||||
// // firebase.auth().currentUser.getIdToken()
|
// // firebase.auth().currentUser.getIdToken()
|
||||||
// reqBody.nom,
|
// reqBody.nom,
|
||||||
// reqBody.description,
|
// reqBody.description,
|
||||||
// reqBody.logo,
|
// reqBody.logo,
|
||||||
// reqBody.duration,
|
// reqBody.duration,
|
||||||
// reqBody.done,
|
// reqBody.done,
|
||||||
// // reqBody.tags,
|
// // reqBody.tags,
|
||||||
// reqBody.repepat,
|
// reqBody.repepat,
|
||||||
// reqBody.deb,
|
// reqBody.deb,
|
||||||
// reqBody.fin
|
// reqBody.fin
|
||||||
// );
|
// );
|
||||||
// // res.send('Success add');
|
// // res.send('Success add');
|
||||||
// // res.status(201).json({ task });
|
// // res.status(201).json({ task });
|
||||||
// res.status(204).send(`Update a new contact: ${updatedTask}`);
|
// res.status(204).send(`Update a new contact: ${updatedTask}`);
|
||||||
// } catch (error) {
|
// } catch (error) {
|
||||||
// console.log(error);
|
// console.log(error);
|
||||||
// next(new HttpException(403, 'Cannot create post'));
|
// next(new HttpException(403, 'Cannot create post'));
|
||||||
// }
|
// }
|
||||||
// };
|
// };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
import Music from "./Music";
|
import Music from "./Music";
|
||||||
|
|
||||||
export class Spot {
|
export class Spot {
|
||||||
private _userId : string;
|
private _userId: string;
|
||||||
private _music : Music;
|
private _music: Music;
|
||||||
constructor(userId : string, music : Music){
|
constructor(userId: string, music: Music) {
|
||||||
this._userId = userId;
|
this._userId = userId;
|
||||||
this._music = music;
|
this._music = music;
|
||||||
}
|
}
|
||||||
get userSpotifyId(): string {
|
get userSpotifyId(): string {
|
||||||
return this._userId;
|
return this._userId;
|
||||||
}
|
}
|
||||||
set userSpotifyId(value: string) {
|
set userSpotifyId(value: string) {
|
||||||
this._userId = value;
|
this._userId = value;
|
||||||
}
|
}
|
||||||
get music(): Music {
|
get music(): Music {
|
||||||
return this._music;
|
return this._music;
|
||||||
}
|
}
|
||||||
set music(value: Music) {
|
set music(value: Music) {
|
||||||
this._music = value;
|
this._music = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,34 +1,34 @@
|
|||||||
class TokenSpotify {
|
class TokenSpotify {
|
||||||
String _accessToken;
|
String _accessToken;
|
||||||
final String _refreshToken;
|
final String _refreshToken;
|
||||||
late DateTime _tokenEnd;
|
late DateTime _tokenEnd;
|
||||||
|
|
||||||
// TokenSpotify(this._accessToken, this._refreshToken, int expiresIn) {
|
// TokenSpotify(this._accessToken, this._refreshToken, int expiresIn) {
|
||||||
// _setTokenEnd(expiresIn);
|
// _setTokenEnd(expiresIn);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// _setTokenEnd(int expiresIn) {
|
// _setTokenEnd(int expiresIn) {
|
||||||
// _tokenEnd = DateTime.now().add(Duration(seconds: expiresIn));
|
// _tokenEnd = DateTime.now().add(Duration(seconds: expiresIn));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Future<String> getAccessToken() async {
|
// Future<String> getAccessToken() async {
|
||||||
// if (DateTime.now().isAfter(_tokenEnd)) {
|
// if (DateTime.now().isAfter(_tokenEnd)) {
|
||||||
// await _actualiseToken();
|
// await _actualiseToken();
|
||||||
// }
|
// }
|
||||||
// return _accessToken;
|
// return _accessToken;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// _actualiseToken() async {
|
// _actualiseToken() async {
|
||||||
// var urlToken = Uri.https('accounts.spotify.com', 'api/token', {
|
// var urlToken = Uri.https('accounts.spotify.com', 'api/token', {
|
||||||
// 'grant_type': 'refresh_token',
|
// 'grant_type': 'refresh_token',
|
||||||
// 'refresh_token': _refreshToken,
|
// 'refresh_token': _refreshToken,
|
||||||
// 'client_id': ApiSpotifyIdentification.clientId
|
// 'client_id': ApiSpotifyIdentification.clientId
|
||||||
// });
|
// });
|
||||||
// setResponse(await http.post(urlToken, headers: <String, String>{
|
// setResponse(await http.post(urlToken, headers: <String, String>{
|
||||||
// 'Content-Type': 'application/x-www-form-urlencoded'
|
// 'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
// }));
|
// }));
|
||||||
// var decodedResponse = jsonDecode(utf8.decode(response.bodyBytes)) as Map;
|
// var decodedResponse = jsonDecode(utf8.decode(response.bodyBytes)) as Map;
|
||||||
// _accessToken = decodedResponse['access_token'];
|
// _accessToken = decodedResponse['access_token'];
|
||||||
// _setTokenEnd(decodedResponse['expires_in']);
|
// _setTokenEnd(decodedResponse['expires_in']);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
@ -1,42 +1,42 @@
|
|||||||
export class User {
|
export class User {
|
||||||
//attributes from DAFL
|
//attributes from DAFL
|
||||||
private _idFlad : string;
|
private _idFlad: string;
|
||||||
private _idSpotify : string;
|
private _idSpotify: string;
|
||||||
private _email : string;
|
private _email: string;
|
||||||
private _createdAt : Date;
|
private _createdAt: Date;
|
||||||
private _name : string;
|
private _name: string;
|
||||||
public image : string = require('../assets/images/jul.png');
|
public image: string = require('../assets/images/jul.png');
|
||||||
//constructors
|
//constructors
|
||||||
constructor(idFlad : string, idSpotify : string, email : string, createdAt : Date, name : string, image : string){
|
constructor(idFlad: string, idSpotify: string, email: string, createdAt: Date, name: string, image: string) {
|
||||||
this._name = name;
|
this._name = name;
|
||||||
this._idFlad = idFlad;
|
this._idFlad = idFlad;
|
||||||
this._idSpotify = idSpotify;
|
this._idSpotify = idSpotify;
|
||||||
this._createdAt = createdAt;
|
this._createdAt = createdAt;
|
||||||
this._email = email;
|
this._email = email;
|
||||||
this.image = image;
|
this.image = image;
|
||||||
}
|
}
|
||||||
|
|
||||||
get idFlad(): string {
|
|
||||||
return this._idFlad;
|
|
||||||
}
|
|
||||||
get idSpotify(): string {
|
|
||||||
return this._idSpotify;
|
|
||||||
}
|
|
||||||
get email(): string {
|
|
||||||
return this._email;
|
|
||||||
}
|
|
||||||
get createAt(): Date {
|
|
||||||
return this._createdAt;
|
|
||||||
}
|
|
||||||
get name(): string {
|
|
||||||
return this._name;
|
|
||||||
}
|
|
||||||
|
|
||||||
static empty() {
|
get idFlad(): string {
|
||||||
return new User('','','',new Date(),'',require('../assets/images/jul.png'));
|
return this._idFlad;
|
||||||
}
|
}
|
||||||
|
get idSpotify(): string {
|
||||||
|
return this._idSpotify;
|
||||||
|
}
|
||||||
|
get email(): string {
|
||||||
|
return this._email;
|
||||||
|
}
|
||||||
|
get createAt(): Date {
|
||||||
|
return this._createdAt;
|
||||||
|
}
|
||||||
|
get name(): string {
|
||||||
|
return this._name;
|
||||||
|
}
|
||||||
|
|
||||||
toString() {
|
static empty() {
|
||||||
return 'User : ' + this.idFlad + ', ' + this.name + ', ' + this.idSpotify;
|
return new User('', '', '', new Date(), '', require('../assets/images/jul.png'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toString() {
|
||||||
|
return 'User : ' + this.idFlad + ', ' + this.name + ', ' + this.idSpotify;
|
||||||
}
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
export const GraphicalCharterDark = {
|
||||||
|
"body": "#141414",
|
||||||
|
"Text": "white",
|
||||||
|
"Card": "#232123",
|
||||||
|
"Line": "#403F3F"
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
export const GraphicalCharterLight = {
|
||||||
|
"body": "#f2f2f6",
|
||||||
|
"Text": "black",
|
||||||
|
"Card": "#fff",
|
||||||
|
"Line": "#e2e2e3"
|
||||||
|
}
|
Before Width: | Height: | Size: 322 KiB After Width: | Height: | Size: 329 KiB |
Before Width: | Height: | Size: 298 KiB After Width: | Height: | Size: 284 KiB |
Before Width: | Height: | Size: 569 KiB After Width: | Height: | Size: 590 KiB |
After Width: | Height: | Size: 760 KiB |
After Width: | Height: | Size: 766 KiB |
After Width: | Height: | Size: 756 KiB |
After Width: | Height: | Size: 778 KiB |
@ -0,0 +1,10 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
export default function AdjustSize(Text: String) {
|
||||||
|
const titleLength = Text.length;
|
||||||
|
const minFontSize = 23;
|
||||||
|
const maxFontSize = 48;
|
||||||
|
const fontRatio = 1.1;
|
||||||
|
const fontSize = Math.max(minFontSize, maxFontSize - (titleLength * fontRatio));
|
||||||
|
return fontSize;
|
||||||
|
}
|
@ -1,49 +1,49 @@
|
|||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
import { View, StyleSheet ,Text,Image, Pressable, Linking, Alert} from 'react-native'
|
import { View, StyleSheet, Text, Image, Pressable, Linking, Alert } from 'react-native'
|
||||||
|
|
||||||
interface ArtistChipProps {
|
interface ArtistChipProps {
|
||||||
backgroundColor : string;
|
backgroundColor: string;
|
||||||
artist : Artist;
|
artist: Artist;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ArtistChip = ({artist} : ArtistChipProps) => {
|
const ArtistChip = ({ artist }: ArtistChipProps) => {
|
||||||
const handlePress = useCallback(async () => {
|
const handlePress = useCallback(async () => {
|
||||||
// Checking if the link is supported for links with custom URL scheme.
|
// Checking if the link is supported for links with custom URL scheme.
|
||||||
const supported = await Linking.canOpenURL(artist.url);
|
const supported = await Linking.canOpenURL(artist.url);
|
||||||
|
|
||||||
if (supported) {
|
if (supported) {
|
||||||
// Opening the link with some app, if the URL scheme is "http" the web link should be opened
|
// Opening the link with some app, if the URL scheme is "http" the web link should be opened
|
||||||
// by some browser in the mobile
|
// by some browser in the mobile
|
||||||
await Linking.openURL(artist.url);
|
await Linking.openURL(artist.url);
|
||||||
} else {
|
} else {
|
||||||
Alert.alert(`Don't know how to open this URL: ${artist.url}`);
|
Alert.alert(`Don't know how to open this URL: ${artist.url}`);
|
||||||
}
|
}
|
||||||
}, [artist.url]);
|
}, [artist.url]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<View>
|
||||||
|
<Pressable onPress={handlePress}>
|
||||||
<View>
|
<View>
|
||||||
<Pressable onPress={handlePress}>
|
<Image
|
||||||
<View>
|
source={{
|
||||||
<Image
|
uri: artist.image,
|
||||||
source={{
|
}}
|
||||||
uri: artist.image,
|
></Image>
|
||||||
}}
|
</View>
|
||||||
></Image>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<View>
|
<View>
|
||||||
<Text>ii</Text>
|
<Text>ii</Text>
|
||||||
</View>
|
|
||||||
</Pressable>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
</Pressable>
|
||||||
};
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
input : {
|
input: {
|
||||||
justifyContent : 'center',
|
justifyContent: 'center',
|
||||||
alignItems : 'center',
|
alignItems: 'center',
|
||||||
placeholder : "placeholde"
|
placeholder: "placeholde"
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1,75 +1,78 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StyleSheet, Text, View , Image } from 'react-native';
|
import { StyleSheet, Text, View, Image } from 'react-native';
|
||||||
import { SharedElement } from 'react-navigation-shared-element';
|
import { SharedElement } from 'react-navigation-shared-element';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
import { GraphicalCharterDark } from '../assets/GraphicalCharterDark';
|
||||||
|
import { GraphicalCharterLight } from '../assets/GraphicalCharterLight';
|
||||||
|
|
||||||
import normalize from '../components/Normalize';
|
import normalize from '../components/Normalize';
|
||||||
|
|
||||||
type CustomCardMusic = { //Props
|
type CustomCardMusic = { //Props
|
||||||
image: string;
|
image: string;
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
id : string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default function CardMusic(CBP: CustomCardMusic) {
|
export default function CardMusic(CBP: CustomCardMusic) {
|
||||||
|
const isDark = useSelector(state => state.userReducer.dark);
|
||||||
const currentMusic = useSelector(state => state.appReducer.currentMusic);
|
const style = isDark ? GraphicalCharterLight : GraphicalCharterDark;
|
||||||
|
const currentMusic = useSelector(state => state.appReducer.currentMusic);
|
||||||
|
|
||||||
const source = typeof CBP.image === 'string' ? { uri: CBP.image } : CBP.image;
|
const source = typeof CBP.image === 'string' ? { uri: CBP.image } : CBP.image;
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
marginBottom: 15
|
||||||
|
},
|
||||||
|
imageContainer: {
|
||||||
|
width: normalize(92),
|
||||||
|
height: normalize(92),
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
marginRight: 20,
|
||||||
|
marginLeft: 20
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
borderRadius: 10
|
||||||
|
|
||||||
|
},
|
||||||
|
textContainer: {
|
||||||
|
flex: 1,
|
||||||
|
alignItems: 'flex-start',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
fontWeight: 'bold',
|
||||||
|
color: style.Text,
|
||||||
|
fontSize: normalize(23),
|
||||||
|
marginBottom: 10
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
color: style.Text,
|
||||||
|
fontSize: normalize(18)
|
||||||
|
},
|
||||||
|
currentMusic: {
|
||||||
|
color: 'red'
|
||||||
|
}
|
||||||
|
});
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<View style={styles.imageContainer}>
|
<View style={styles.imageContainer}>
|
||||||
<Image source={source} style={styles.image}/>
|
<Image source={source} style={styles.image} />
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.textContainer}>
|
<View style={styles.textContainer}>
|
||||||
{/* currentMusic.id === CBP.id && styles.currentMusic */}
|
{/* currentMusic.id === CBP.id && styles.currentMusic */}
|
||||||
<Text style={[styles.title]}>{CBP.title}</Text>
|
<Text style={[styles.title]}>{CBP.title}</Text>
|
||||||
<Text style={[styles.description]}>{CBP.description}</Text>
|
<Text style={[styles.description]}>{CBP.description}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
marginBottom: 15
|
|
||||||
},
|
|
||||||
imageContainer: {
|
|
||||||
width: normalize(92),
|
|
||||||
height: normalize(92),
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
marginRight: 20,
|
|
||||||
marginLeft: 20
|
|
||||||
},
|
|
||||||
image: {
|
|
||||||
width: '100%',
|
|
||||||
height: '100%',
|
|
||||||
borderRadius: 10
|
|
||||||
|
|
||||||
},
|
|
||||||
textContainer: {
|
|
||||||
flex: 1,
|
|
||||||
alignItems: 'flex-start',
|
|
||||||
justifyContent: 'center',
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
fontWeight: 'bold',
|
|
||||||
color: 'white',
|
|
||||||
fontSize: normalize(23),
|
|
||||||
marginBottom: 10
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
color: 'white',
|
|
||||||
fontSize: normalize(18)
|
|
||||||
},
|
|
||||||
currentMusic: {
|
|
||||||
color: 'red'
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,75 +1,75 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { View, Text, Image ,PanResponder, Dimensions, StyleSheet, ImageBackground, Button, Pressable, TextInput } from 'react-native'
|
import { View, Text, Image, PanResponder, Dimensions, StyleSheet, ImageBackground, Button, Pressable, TextInput } from 'react-native'
|
||||||
import Animated, { interpolate, lessThan, multiply, useAnimatedStyle } from 'react-native-reanimated';
|
import Animated, { interpolate, lessThan, multiply, useAnimatedStyle } from 'react-native-reanimated';
|
||||||
import HalfCirlce from './HalfCircle';
|
import HalfCirlce from './HalfCircle';
|
||||||
|
|
||||||
interface CircularProps {
|
interface CircularProps {
|
||||||
background : string,
|
background: string,
|
||||||
foreground : string,
|
foreground: string,
|
||||||
progress : Animated.Value<number>,
|
progress: Animated.Value<number>,
|
||||||
radius : number;
|
radius: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PI= Math.PI;
|
const PI = Math.PI;
|
||||||
const FladInput = ({background, foreground, progress} : CircularProps) => {
|
const FladInput = ({ background, foreground, progress }: CircularProps) => {
|
||||||
const [focused, setFocused] = useState<boolean>(false);
|
const [focused, setFocused] = useState<boolean>(false);
|
||||||
const theta = multiply(progress,2*PI);
|
const theta = multiply(progress, 2 * PI);
|
||||||
const rotateTop = theta;
|
const rotateTop = theta;
|
||||||
const opacity = lessThan(theta, PI);
|
const opacity = lessThan(theta, PI);
|
||||||
|
|
||||||
|
|
||||||
const rotateAnimation = useAnimatedStyle(() => {
|
const rotateAnimation = useAnimatedStyle(() => {
|
||||||
const rotate = interpolate
|
const rotate = interpolate
|
||||||
( theta,
|
(theta,
|
||||||
[PI, 2*PI],
|
[PI, 2 * PI],
|
||||||
[0,PI]);
|
[0, PI]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...StyleSheet.absoluteFillObject,
|
...StyleSheet.absoluteFillObject,
|
||||||
transform: [
|
transform: [
|
||||||
{rotate: rotate},
|
{ rotate: rotate },
|
||||||
{translateX: RADUIS/2},
|
{ translateX: RADUIS / 2 },
|
||||||
{translateY: RADUIS/2}
|
{ translateY: RADUIS / 2 }
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const rotateAnimation2 = useAnimatedStyle(() => {
|
const rotateAnimation2 = useAnimatedStyle(() => {
|
||||||
const rotate = interpolate
|
const rotate = interpolate
|
||||||
( theta,
|
(theta,
|
||||||
[PI, 2*PI],
|
[PI, 2 * PI],
|
||||||
[0,PI]);
|
[0, PI]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...StyleSheet.absoluteFillObject,
|
...StyleSheet.absoluteFillObject,
|
||||||
transform: [
|
transform: [
|
||||||
{rotate: theta},
|
{ rotate: theta },
|
||||||
{translateX: RADUIS/2},
|
{ translateX: RADUIS / 2 },
|
||||||
{translateY: RADUIS/2}
|
{ translateY: RADUIS / 2 }
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View style={{zIndex : 1}}>
|
<View style={{ zIndex: 1 }}>
|
||||||
<HalfCirlce backgroundColor={background}/>
|
<HalfCirlce backgroundColor={background} />
|
||||||
<Animated.View style={{...StyleSheet.absoluteFillObject, transform : [{rotate : '180%'}], opacity}}>
|
<Animated.View style={{ ...StyleSheet.absoluteFillObject, transform: [{ rotate: '180%' }], opacity }}>
|
||||||
<HalfCirlce backgroundColor={background}/>
|
<HalfCirlce backgroundColor={background} />
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ transform : [{rotate : '180%'}]}}>
|
<View style={{ transform: [{ rotate: '180%' }] }}>
|
||||||
<HalfCirlce backgroundColor={background}/>
|
<HalfCirlce backgroundColor={background} />
|
||||||
<Animated.View style={{}}>
|
<Animated.View style={{}}>
|
||||||
<HalfCirlce backgroundColor={background}/>
|
<HalfCirlce backgroundColor={background} />
|
||||||
</Animated.View> </View>
|
</Animated.View> </View>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
input : {
|
input: {
|
||||||
justifyContent : 'center',
|
justifyContent: 'center',
|
||||||
alignItems : 'center',
|
alignItems: 'center',
|
||||||
placeholder : "placeholde"
|
placeholder: "placeholde"
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { View, Image, StyleSheet } from 'react-native';
|
||||||
|
import normalize from './Normalize';
|
||||||
|
|
||||||
|
type Flady = {
|
||||||
|
image: string | object;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function FladyComponent(monFlady: Flady) {
|
||||||
|
const source = typeof monFlady.image === 'string' ? { uri: monFlady.image } : monFlady.image;
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Image source={source} style={styles.image} />
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
width: normalize(152),
|
||||||
|
height: normalize(152),
|
||||||
|
borderRadius: 90,
|
||||||
|
marginHorizontal: normalize(15),
|
||||||
|
overflow: 'hidden',
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
width: normalize(220),
|
||||||
|
height: normalize(220),
|
||||||
|
marginLeft: -1
|
||||||
|
}
|
||||||
|
})
|
@ -1,29 +1,29 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { View, Text, Image, Animated ,PanResponder, Dimensions, StyleSheet, ImageBackground, Button, Pressable, TextInput } from 'react-native'
|
import { View, Text, Image, Animated, PanResponder, Dimensions, StyleSheet, ImageBackground, Button, Pressable, TextInput } from 'react-native'
|
||||||
|
|
||||||
interface InputProps {
|
interface InputProps {
|
||||||
name : string;
|
name: string;
|
||||||
placeholder : string;
|
placeholder: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FladInput = ({name, placeholder} : InputProps) => {
|
const FladInput = ({ name, placeholder }: InputProps) => {
|
||||||
const [focused, setFocused] = useState<boolean>(false);
|
const [focused, setFocused] = useState<boolean>(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<Text></Text>
|
<Text></Text>
|
||||||
<TextInput style={[styles.input]}>
|
<TextInput style={[styles.input]}>
|
||||||
|
|
||||||
</TextInput>
|
</TextInput>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
input : {
|
input: {
|
||||||
justifyContent : 'center',
|
justifyContent: 'center',
|
||||||
alignItems : 'center',
|
alignItems: 'center',
|
||||||
placeholder : "placeholde"
|
placeholder: "placeholde"
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
id: '1',
|
id: '1',
|
||||||
title: 'Bienvenue sur Flad',
|
title: 'Bienvenue sur Flad',
|
||||||
description: 'L\'application pour découvrir de nouvelles musiques et vous faire de nouveaux amis',
|
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_Image.png')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '2',
|
id: '2',
|
||||||
title: 'Tous les jours de nouvelles musiques qui peuvent vous plaire',
|
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',
|
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_Image2.png')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '3',
|
id: '3',
|
||||||
title: 'La musique ça se partage',
|
title: 'La musique ça se partage',
|
||||||
description: 'Faites connaissances avec de nouvelles personnes et partagez vos critiques',
|
description: 'Faites connaissances avec de nouvelles personnes et partagez vos critiques',
|
||||||
image: require('../assets/images/Board_Image3.png')
|
image: require('../assets/images/Board_Image3.png')
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -1,18 +0,0 @@
|
|||||||
|
|
||||||
Uri getApiUrlAuthorize() => _api.identification.urlAuthorize;
|
|
||||||
|
|
||||||
String getApiRedirectUrl() => _api.identification.redirectUri;
|
|
||||||
|
|
||||||
String getIdSpotify() => _currentUser.idSpotify;
|
|
||||||
|
|
||||||
String getIdFlad() => _currentUser.idFlad;
|
|
||||||
|
|
||||||
|
|
||||||
case getCompleteMusic
|
|
||||||
|
|
||||||
playTrack(String id)
|
|
||||||
|
|
||||||
case addToPlaylist:
|
|
||||||
return {...state, spot: action.payload}
|
|
||||||
|
|
||||||
case removeFromPlaylist:
|
|
@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
export const userTypes = {
|
export const userTypes = {
|
||||||
LOGIN: 'LOGIN',
|
LOGIN: 'LOGIN',
|
||||||
SIGNUP: 'SIGNUP',
|
SIGNUP: 'SIGNUP',
|
||||||
SAVE_SPOTIFY :'SAVE_SPOTIFY',
|
SAVE_SPOTIFY: 'SAVE_SPOTIFY',
|
||||||
UPDATE_USER: 'UPDATE_USER',
|
UPDATE_USER: 'UPDATE_USER',
|
||||||
UPDATE_PROFILE_PICTURE: 'UPDATE_PROFILE_PICTURE',
|
UPDATE_PROFILE_PICTURE: 'UPDATE_PROFILE_PICTURE',
|
||||||
USER_LOGOUT : 'USER_LOGOUT',
|
USER_LOGOUT: 'USER_LOGOUT',
|
||||||
RESTORE_TOKEN : "RESTORE_TOKEN"
|
RESTORE_TOKEN: "RESTORE_TOKEN",
|
||||||
}
|
CHANGE_MODE: "CHANGE_MODE"
|
||||||
|
}
|