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,12 +1,12 @@
|
||||
export default class Artist {
|
||||
private id : string;
|
||||
private name : string;
|
||||
private url : string; // Image.source
|
||||
|
||||
constructor(id : string, name : string, url : string){
|
||||
private id: string;
|
||||
private name: string;
|
||||
private url: string; // Image.source
|
||||
|
||||
constructor(id: string, name: string, url: string) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,112 +1,112 @@
|
||||
import { useState } from "react";
|
||||
import SpotifyService from "../services/spotify/spotify.service";
|
||||
|
||||
class Manager{
|
||||
|
||||
// injection de dépences
|
||||
spotifyService = new SpotifyService();
|
||||
userService = new userService();
|
||||
|
||||
private currentUser = useState(null);
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
// spotify methods
|
||||
apiAuthorization(url : string) {
|
||||
this.spotifyService.apiAuthorization(url);
|
||||
}
|
||||
|
||||
getCompleteMusic = async (id : string) :Promise<Music> =>{
|
||||
// Map info = await spotifyService.getTrackInfo(id);
|
||||
// return Music(id, info['name'], info['artist'], info['cover']);
|
||||
}
|
||||
|
||||
removeFromPlaylist(id : string) {
|
||||
this.spotifyService.removeFromPlaylist(id);
|
||||
}
|
||||
|
||||
|
||||
addToPlaylist(id : string) {
|
||||
this.spotifyService.addToPlaylist(id);
|
||||
}
|
||||
|
||||
playTrack(id : string) {
|
||||
this.spotifyService.playTrack(id);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////
|
||||
|
||||
// private readonly getTaskById: RequestHandler = async (
|
||||
// req: Request,
|
||||
// res: Response,
|
||||
// next: NextFunction
|
||||
// ): Promise<Response | void> => {
|
||||
// try {
|
||||
// const id = req.params.taskId;
|
||||
// const userId = req.params.userId;
|
||||
|
||||
// const data = await this.Taskservice.getTaskById(id, userId);
|
||||
// res.status(201).send(data);
|
||||
|
||||
// }
|
||||
// catch(error){
|
||||
// next(new HttpException(400, 'Cannot create post'));
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// private delete = async (
|
||||
// req: Request,
|
||||
// res: Response,
|
||||
// next: NextFunction
|
||||
// ): Promise<Response | void> => {
|
||||
// try {
|
||||
// const id = req.params.taskId;
|
||||
// const userId = req.params.userId;
|
||||
// await this.Taskservice.DeleteTask(id, userId);
|
||||
// return res.status(200).send({ status: "Success", msg: "Data Removed" });
|
||||
// } catch (error) {
|
||||
// next(new HttpException(400, 'Cannot create post'));
|
||||
// }
|
||||
// };
|
||||
|
||||
// private updateTask = async (
|
||||
// req: Request,
|
||||
// res: Response,
|
||||
// next: NextFunction
|
||||
// ): Promise<Response | void> => {
|
||||
// try {
|
||||
|
||||
// const taskId = req.params.taskId;
|
||||
// const userId = req.params.userId;
|
||||
// const reqBody:CreateTaskReqBody = Object.assign({}, req.body);
|
||||
|
||||
// const updatedTask = await this.Taskservice.UpdateTask(
|
||||
// // req.auth!.uid,
|
||||
// taskId,
|
||||
// userId,
|
||||
// // firebase.auth().currentUser.getIdToken()
|
||||
// reqBody.nom,
|
||||
// reqBody.description,
|
||||
// reqBody.logo,
|
||||
// reqBody.duration,
|
||||
// reqBody.done,
|
||||
// // reqBody.tags,
|
||||
// reqBody.repepat,
|
||||
// reqBody.deb,
|
||||
// reqBody.fin
|
||||
// );
|
||||
// // res.send('Success add');
|
||||
// // res.status(201).json({ task });
|
||||
// res.status(204).send(`Update a new contact: ${updatedTask}`);
|
||||
// } catch (error) {
|
||||
// console.log(error);
|
||||
// next(new HttpException(403, 'Cannot create post'));
|
||||
// }
|
||||
// };
|
||||
class Manager {
|
||||
|
||||
// injection de dépences
|
||||
spotifyService = new SpotifyService();
|
||||
userService = new userService();
|
||||
|
||||
private currentUser = useState(null);
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
// spotify methods
|
||||
apiAuthorization(url: string) {
|
||||
this.spotifyService.apiAuthorization(url);
|
||||
}
|
||||
|
||||
getCompleteMusic = async (id: string): Promise<Music> => {
|
||||
// Map info = await spotifyService.getTrackInfo(id);
|
||||
// return Music(id, info['name'], info['artist'], info['cover']);
|
||||
}
|
||||
|
||||
removeFromPlaylist(id: string) {
|
||||
this.spotifyService.removeFromPlaylist(id);
|
||||
}
|
||||
|
||||
|
||||
addToPlaylist(id: string) {
|
||||
this.spotifyService.addToPlaylist(id);
|
||||
}
|
||||
|
||||
playTrack(id: string) {
|
||||
this.spotifyService.playTrack(id);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////
|
||||
|
||||
// private readonly getTaskById: RequestHandler = async (
|
||||
// req: Request,
|
||||
// res: Response,
|
||||
// next: NextFunction
|
||||
// ): Promise<Response | void> => {
|
||||
// try {
|
||||
// const id = req.params.taskId;
|
||||
// const userId = req.params.userId;
|
||||
|
||||
// const data = await this.Taskservice.getTaskById(id, userId);
|
||||
// res.status(201).send(data);
|
||||
|
||||
// }
|
||||
// catch(error){
|
||||
// next(new HttpException(400, 'Cannot create post'));
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// private delete = async (
|
||||
// req: Request,
|
||||
// res: Response,
|
||||
// next: NextFunction
|
||||
// ): Promise<Response | void> => {
|
||||
// try {
|
||||
// const id = req.params.taskId;
|
||||
// const userId = req.params.userId;
|
||||
// await this.Taskservice.DeleteTask(id, userId);
|
||||
// return res.status(200).send({ status: "Success", msg: "Data Removed" });
|
||||
// } catch (error) {
|
||||
// next(new HttpException(400, 'Cannot create post'));
|
||||
// }
|
||||
// };
|
||||
|
||||
// private updateTask = async (
|
||||
// req: Request,
|
||||
// res: Response,
|
||||
// next: NextFunction
|
||||
// ): Promise<Response | void> => {
|
||||
// try {
|
||||
|
||||
// const taskId = req.params.taskId;
|
||||
// const userId = req.params.userId;
|
||||
// const reqBody:CreateTaskReqBody = Object.assign({}, req.body);
|
||||
|
||||
// const updatedTask = await this.Taskservice.UpdateTask(
|
||||
// // req.auth!.uid,
|
||||
// taskId,
|
||||
// userId,
|
||||
// // firebase.auth().currentUser.getIdToken()
|
||||
// reqBody.nom,
|
||||
// reqBody.description,
|
||||
// reqBody.logo,
|
||||
// reqBody.duration,
|
||||
// reqBody.done,
|
||||
// // reqBody.tags,
|
||||
// reqBody.repepat,
|
||||
// reqBody.deb,
|
||||
// reqBody.fin
|
||||
// );
|
||||
// // res.send('Success add');
|
||||
// // res.status(201).json({ task });
|
||||
// res.status(204).send(`Update a new contact: ${updatedTask}`);
|
||||
// } catch (error) {
|
||||
// console.log(error);
|
||||
// next(new HttpException(403, 'Cannot create post'));
|
||||
// }
|
||||
// };
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,22 +1,22 @@
|
||||
import Music from "./Music";
|
||||
|
||||
export class Spot {
|
||||
private _userId : string;
|
||||
private _music : Music;
|
||||
constructor(userId : string, music : Music){
|
||||
this._userId = userId;
|
||||
this._music = music;
|
||||
}
|
||||
get userSpotifyId(): string {
|
||||
return this._userId;
|
||||
}
|
||||
set userSpotifyId(value: string) {
|
||||
this._userId = value;
|
||||
}
|
||||
get music(): Music {
|
||||
return this._music;
|
||||
}
|
||||
set music(value: Music) {
|
||||
this._music = value;
|
||||
}
|
||||
private _userId: string;
|
||||
private _music: Music;
|
||||
constructor(userId: string, music: Music) {
|
||||
this._userId = userId;
|
||||
this._music = music;
|
||||
}
|
||||
get userSpotifyId(): string {
|
||||
return this._userId;
|
||||
}
|
||||
set userSpotifyId(value: string) {
|
||||
this._userId = value;
|
||||
}
|
||||
get music(): Music {
|
||||
return this._music;
|
||||
}
|
||||
set music(value: Music) {
|
||||
this._music = value;
|
||||
}
|
||||
}
|
@ -1,34 +1,34 @@
|
||||
class TokenSpotify {
|
||||
class TokenSpotify {
|
||||
String _accessToken;
|
||||
final String _refreshToken;
|
||||
late DateTime _tokenEnd;
|
||||
|
||||
// TokenSpotify(this._accessToken, this._refreshToken, int expiresIn) {
|
||||
// _setTokenEnd(expiresIn);
|
||||
// }
|
||||
// TokenSpotify(this._accessToken, this._refreshToken, int expiresIn) {
|
||||
// _setTokenEnd(expiresIn);
|
||||
// }
|
||||
|
||||
// _setTokenEnd(int expiresIn) {
|
||||
// _tokenEnd = DateTime.now().add(Duration(seconds: expiresIn));
|
||||
// }
|
||||
// _setTokenEnd(int expiresIn) {
|
||||
// _tokenEnd = DateTime.now().add(Duration(seconds: expiresIn));
|
||||
// }
|
||||
|
||||
// Future<String> getAccessToken() async {
|
||||
// if (DateTime.now().isAfter(_tokenEnd)) {
|
||||
// await _actualiseToken();
|
||||
// }
|
||||
// return _accessToken;
|
||||
// }
|
||||
// Future<String> getAccessToken() async {
|
||||
// if (DateTime.now().isAfter(_tokenEnd)) {
|
||||
// await _actualiseToken();
|
||||
// }
|
||||
// return _accessToken;
|
||||
// }
|
||||
|
||||
// _actualiseToken() async {
|
||||
// var urlToken = Uri.https('accounts.spotify.com', 'api/token', {
|
||||
// 'grant_type': 'refresh_token',
|
||||
// 'refresh_token': _refreshToken,
|
||||
// 'client_id': ApiSpotifyIdentification.clientId
|
||||
// });
|
||||
// setResponse(await http.post(urlToken, headers: <String, String>{
|
||||
// 'Content-Type': 'application/x-www-form-urlencoded'
|
||||
// }));
|
||||
// var decodedResponse = jsonDecode(utf8.decode(response.bodyBytes)) as Map;
|
||||
// _accessToken = decodedResponse['access_token'];
|
||||
// _setTokenEnd(decodedResponse['expires_in']);
|
||||
// }
|
||||
// _actualiseToken() async {
|
||||
// var urlToken = Uri.https('accounts.spotify.com', 'api/token', {
|
||||
// 'grant_type': 'refresh_token',
|
||||
// 'refresh_token': _refreshToken,
|
||||
// 'client_id': ApiSpotifyIdentification.clientId
|
||||
// });
|
||||
// setResponse(await http.post(urlToken, headers: <String, String>{
|
||||
// 'Content-Type': 'application/x-www-form-urlencoded'
|
||||
// }));
|
||||
// var decodedResponse = jsonDecode(utf8.decode(response.bodyBytes)) as Map;
|
||||
// _accessToken = decodedResponse['access_token'];
|
||||
// _setTokenEnd(decodedResponse['expires_in']);
|
||||
// }
|
||||
}
|
@ -1,42 +1,42 @@
|
||||
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');
|
||||
//constructors
|
||||
constructor(idFlad : string, idSpotify : string, email : string, createdAt : Date, name : string, image : string){
|
||||
this._name = name;
|
||||
this._idFlad = idFlad;
|
||||
this._idSpotify = idSpotify;
|
||||
this._createdAt = createdAt;
|
||||
this._email = email;
|
||||
this.image = image;
|
||||
}
|
||||
//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');
|
||||
//constructors
|
||||
constructor(idFlad: string, idSpotify: string, email: string, createdAt: Date, name: string, image: string) {
|
||||
this._name = name;
|
||||
this._idFlad = idFlad;
|
||||
this._idSpotify = idSpotify;
|
||||
this._createdAt = createdAt;
|
||||
this._email = email;
|
||||
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;
|
||||
}
|
||||
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() {
|
||||
return new User('','','',new Date(),'',require('../assets/images/jul.png'));
|
||||
}
|
||||
static empty() {
|
||||
return new User('', '', '', new Date(), '', require('../assets/images/jul.png'));
|
||||
}
|
||||
|
||||
toString() {
|
||||
return 'User : ' + this.idFlad + ', ' + this.name + ', ' + this.idSpotify;
|
||||
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 { View, StyleSheet ,Text,Image, Pressable, Linking, Alert} from 'react-native'
|
||||
import { View, StyleSheet, Text, Image, Pressable, Linking, Alert } from 'react-native'
|
||||
|
||||
interface ArtistChipProps {
|
||||
backgroundColor : string;
|
||||
artist : Artist;
|
||||
backgroundColor: string;
|
||||
artist: Artist;
|
||||
}
|
||||
|
||||
const ArtistChip = ({artist} : ArtistChipProps) => {
|
||||
const handlePress = useCallback(async () => {
|
||||
// Checking if the link is supported for links with custom URL scheme.
|
||||
const supported = await Linking.canOpenURL(artist.url);
|
||||
|
||||
if (supported) {
|
||||
// Opening the link with some app, if the URL scheme is "http" the web link should be opened
|
||||
// by some browser in the mobile
|
||||
await Linking.openURL(artist.url);
|
||||
} else {
|
||||
Alert.alert(`Don't know how to open this URL: ${artist.url}`);
|
||||
}
|
||||
}, [artist.url]);
|
||||
|
||||
return (
|
||||
|
||||
const ArtistChip = ({ artist }: ArtistChipProps) => {
|
||||
const handlePress = useCallback(async () => {
|
||||
// Checking if the link is supported for links with custom URL scheme.
|
||||
const supported = await Linking.canOpenURL(artist.url);
|
||||
|
||||
if (supported) {
|
||||
// Opening the link with some app, if the URL scheme is "http" the web link should be opened
|
||||
// by some browser in the mobile
|
||||
await Linking.openURL(artist.url);
|
||||
} else {
|
||||
Alert.alert(`Don't know how to open this URL: ${artist.url}`);
|
||||
}
|
||||
}, [artist.url]);
|
||||
|
||||
return (
|
||||
<View>
|
||||
<Pressable onPress={handlePress}>
|
||||
<View>
|
||||
<Pressable onPress={handlePress}>
|
||||
<View>
|
||||
<Image
|
||||
source={{
|
||||
uri: artist.image,
|
||||
}}
|
||||
></Image>
|
||||
</View>
|
||||
<Image
|
||||
source={{
|
||||
uri: artist.image,
|
||||
}}
|
||||
></Image>
|
||||
</View>
|
||||
|
||||
<View>
|
||||
<Text>ii</Text>
|
||||
</View>
|
||||
</Pressable>
|
||||
<View>
|
||||
<Text>ii</Text>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
</Pressable>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
input : {
|
||||
justifyContent : 'center',
|
||||
alignItems : 'center',
|
||||
placeholder : "placeholde"
|
||||
input: {
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
placeholder: "placeholde"
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -1,75 +1,78 @@
|
||||
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 { useSelector } from 'react-redux';
|
||||
import { GraphicalCharterDark } from '../assets/GraphicalCharterDark';
|
||||
import { GraphicalCharterLight } from '../assets/GraphicalCharterLight';
|
||||
|
||||
import normalize from '../components/Normalize';
|
||||
|
||||
type CustomCardMusic = { //Props
|
||||
image: string;
|
||||
title: string;
|
||||
description: string;
|
||||
id : string;
|
||||
image: string;
|
||||
title: string;
|
||||
description: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
|
||||
export default function CardMusic(CBP: CustomCardMusic) {
|
||||
|
||||
const currentMusic = useSelector(state => state.appReducer.currentMusic);
|
||||
const isDark = useSelector(state => state.userReducer.dark);
|
||||
const style = isDark ? GraphicalCharterLight : GraphicalCharterDark;
|
||||
const currentMusic = useSelector(state => state.appReducer.currentMusic);
|
||||
|
||||
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 (
|
||||
|
||||
<View style={styles.container}>
|
||||
<View style={styles.imageContainer}>
|
||||
<Image source={source} style={styles.image}/>
|
||||
</View>
|
||||
<View style={styles.textContainer}>
|
||||
{/* currentMusic.id === CBP.id && styles.currentMusic */}
|
||||
<Text style={[styles.title]}>{CBP.title}</Text>
|
||||
<Text style={[styles.description]}>{CBP.description}</Text>
|
||||
</View>
|
||||
<View style={styles.imageContainer}>
|
||||
<Image source={source} style={styles.image} />
|
||||
</View>
|
||||
<View style={styles.textContainer}>
|
||||
{/* currentMusic.id === CBP.id && styles.currentMusic */}
|
||||
<Text style={[styles.title]}>{CBP.title}</Text>
|
||||
<Text style={[styles.description]}>{CBP.description}</Text>
|
||||
</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 { 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 HalfCirlce from './HalfCircle';
|
||||
|
||||
interface CircularProps {
|
||||
background : string,
|
||||
foreground : string,
|
||||
progress : Animated.Value<number>,
|
||||
radius : number;
|
||||
background: string,
|
||||
foreground: string,
|
||||
progress: Animated.Value<number>,
|
||||
radius: number;
|
||||
}
|
||||
|
||||
const PI= Math.PI;
|
||||
const FladInput = ({background, foreground, progress} : CircularProps) => {
|
||||
const [focused, setFocused] = useState<boolean>(false);
|
||||
const theta = multiply(progress,2*PI);
|
||||
const rotateTop = theta;
|
||||
const opacity = lessThan(theta, PI);
|
||||
const PI = Math.PI;
|
||||
const FladInput = ({ background, foreground, progress }: CircularProps) => {
|
||||
const [focused, setFocused] = useState<boolean>(false);
|
||||
const theta = multiply(progress, 2 * PI);
|
||||
const rotateTop = theta;
|
||||
const opacity = lessThan(theta, PI);
|
||||
|
||||
|
||||
const rotateAnimation = useAnimatedStyle(() => {
|
||||
const rotate = interpolate
|
||||
( theta,
|
||||
[PI, 2*PI],
|
||||
[0,PI]);
|
||||
const rotateAnimation = useAnimatedStyle(() => {
|
||||
const rotate = interpolate
|
||||
(theta,
|
||||
[PI, 2 * PI],
|
||||
[0, PI]);
|
||||
|
||||
return {
|
||||
...StyleSheet.absoluteFillObject,
|
||||
transform: [
|
||||
{ rotate: rotate },
|
||||
{ translateX: RADUIS / 2 },
|
||||
{ translateY: RADUIS / 2 }
|
||||
],
|
||||
};
|
||||
});
|
||||
const rotateAnimation2 = useAnimatedStyle(() => {
|
||||
const rotate = interpolate
|
||||
(theta,
|
||||
[PI, 2 * PI],
|
||||
[0, PI]);
|
||||
|
||||
return {
|
||||
...StyleSheet.absoluteFillObject,
|
||||
transform: [
|
||||
{ rotate: theta },
|
||||
{ translateX: RADUIS / 2 },
|
||||
{ translateY: RADUIS / 2 }
|
||||
],
|
||||
};
|
||||
});
|
||||
return (
|
||||
<>
|
||||
<View style={{ zIndex: 1 }}>
|
||||
<HalfCirlce backgroundColor={background} />
|
||||
<Animated.View style={{ ...StyleSheet.absoluteFillObject, transform: [{ rotate: '180%' }], opacity }}>
|
||||
<HalfCirlce backgroundColor={background} />
|
||||
</Animated.View>
|
||||
</View>
|
||||
<View style={{ transform: [{ rotate: '180%' }] }}>
|
||||
<HalfCirlce backgroundColor={background} />
|
||||
<Animated.View style={{}}>
|
||||
<HalfCirlce backgroundColor={background} />
|
||||
</Animated.View> </View>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
return {
|
||||
...StyleSheet.absoluteFillObject,
|
||||
transform: [
|
||||
{rotate: rotate},
|
||||
{translateX: RADUIS/2},
|
||||
{translateY: RADUIS/2}
|
||||
],
|
||||
};
|
||||
});
|
||||
const rotateAnimation2 = useAnimatedStyle(() => {
|
||||
const rotate = interpolate
|
||||
( theta,
|
||||
[PI, 2*PI],
|
||||
[0,PI]);
|
||||
|
||||
return {
|
||||
...StyleSheet.absoluteFillObject,
|
||||
transform: [
|
||||
{rotate: theta},
|
||||
{translateX: RADUIS/2},
|
||||
{translateY: RADUIS/2}
|
||||
],
|
||||
};
|
||||
});
|
||||
return (
|
||||
<>
|
||||
<View style={{zIndex : 1}}>
|
||||
<HalfCirlce backgroundColor={background}/>
|
||||
<Animated.View style={{...StyleSheet.absoluteFillObject, transform : [{rotate : '180%'}], opacity}}>
|
||||
<HalfCirlce backgroundColor={background}/>
|
||||
</Animated.View>
|
||||
</View>
|
||||
<View style={{ transform : [{rotate : '180%'}]}}>
|
||||
<HalfCirlce backgroundColor={background}/>
|
||||
<Animated.View style={{}}>
|
||||
<HalfCirlce backgroundColor={background}/>
|
||||
</Animated.View> </View>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
input : {
|
||||
justifyContent : 'center',
|
||||
alignItems : 'center',
|
||||
placeholder : "placeholde"
|
||||
input: {
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
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 { 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 {
|
||||
name : string;
|
||||
placeholder : string;
|
||||
name: string;
|
||||
placeholder: string;
|
||||
}
|
||||
|
||||
const FladInput = ({name, placeholder} : InputProps) => {
|
||||
const [focused, setFocused] = useState<boolean>(false);
|
||||
|
||||
return (
|
||||
<View>
|
||||
<Text></Text>
|
||||
<TextInput style={[styles.input]}>
|
||||
const FladInput = ({ name, placeholder }: InputProps) => {
|
||||
const [focused, setFocused] = useState<boolean>(false);
|
||||
|
||||
return (
|
||||
<View>
|
||||
<Text></Text>
|
||||
<TextInput style={[styles.input]}>
|
||||
|
||||
</TextInput>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
</TextInput>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
input : {
|
||||
justifyContent : 'center',
|
||||
alignItems : 'center',
|
||||
placeholder : "placeholde"
|
||||
input: {
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
placeholder: "placeholde"
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
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')
|
||||
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')
|
||||
},
|
||||
{
|
||||
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')
|
||||
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')
|
||||
},
|
||||
{
|
||||
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')
|
||||
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')
|
||||
}
|
||||
]
|
@ -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 = {
|
||||
LOGIN: 'LOGIN',
|
||||
SIGNUP: 'SIGNUP',
|
||||
SAVE_SPOTIFY :'SAVE_SPOTIFY',
|
||||
SAVE_SPOTIFY: 'SAVE_SPOTIFY',
|
||||
UPDATE_USER: 'UPDATE_USER',
|
||||
UPDATE_PROFILE_PICTURE: 'UPDATE_PROFILE_PICTURE',
|
||||
USER_LOGOUT : 'USER_LOGOUT',
|
||||
RESTORE_TOKEN : "RESTORE_TOKEN"
|
||||
}
|
||||
USER_LOGOUT: 'USER_LOGOUT',
|
||||
RESTORE_TOKEN: "RESTORE_TOKEN",
|
||||
CHANGE_MODE: "CHANGE_MODE"
|
||||
}
|