diff --git a/data/ApiDataManager.tsx b/data/ApiDataManager.tsx deleted file mode 100644 index a08be79..0000000 --- a/data/ApiDataManager.tsx +++ /dev/null @@ -1,14 +0,0 @@ - -// export class ApiDataManager{ - - -// public async getCards() : Promise { - - -// const CardPromise = await fetch('https://omgvamp-hearthstone-v1.p.rapidapi.com/cards') - -// const CardListJson = await CardPromise.json(); -// const CardList: String[] = Array.of(CardListJson); -// return CardList; -// } -// } diff --git a/data/stub.ts b/data/stub.ts deleted file mode 100644 index f700882..0000000 --- a/data/stub.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Card } from "../models/Card" - -export class StubLib { - - public getCards(): Card[] { - const NOUNOURS_LIST : Card[] = [ - - - ] - return NOUNOURS_LIST - } -} - diff --git a/screens/ListScreen.tsx b/screens/ListScreen.tsx index 33d6fce..860c5f4 100644 --- a/screens/ListScreen.tsx +++ b/screens/ListScreen.tsx @@ -1,33 +1,36 @@ - -import { StyleSheet, Text, View, Button, TouchableHighlight } from 'react-native'; +import { StyleSheet, Text, View, Button, TouchableHighlight, ImageBackground } from 'react-native'; import { StatusBar } from 'expo-status-bar'; import React, { useState, useEffect } from "react"; import { FlatList } from 'react-native-gesture-handler'; import {useDispatch, useSelector} from 'react-redux'; - +import { FontAwesome } from '@expo/vector-icons'; import { ThunkAction } from 'redux-thunk'; //? possiblement à supprimer import { getAllCards } from "../redux/actions/actionSelection" - -import { StubLib } from '../data/stub'; import { Card } from '../models/Card'; import { Image } from 'react-native'; import { ImageURISource } from 'react-native'; //@ts-ignore -const Item = ({url}) => ( - // - // {title} - // - - - +const Item = ({url}) => { // a mettre dans components et definir une props pour passer le param + + const HandleAddFav = () => { + console.log('addfavorite'); + } + return( + + + + + + + + -); + ); +} //@ts-ignore export default function ListScreen({navigation}){ @@ -114,10 +117,15 @@ const styles = StyleSheet.create({ justifyContent: 'center', }, item: { - borderRadius : 15, - backgroundColor: '#efefef', - padding: 20, - margin : 10, + + }, + favoriteButton: { + position: 'absolute', + top: 10, + right: 10, + backgroundColor: 'transparent', + borderRadius: 50, + padding: 10, }, title: { fontStyle: "italic", diff --git a/service/AsyncStorage.tsx b/service/AsyncStorage.tsx index 84ec2a6..c7c237b 100644 --- a/service/AsyncStorage.tsx +++ b/service/AsyncStorage.tsx @@ -1,6 +1,7 @@ import { Card } from "../models/Card"; import AsyncStorage from "@react-native-async-storage/async-storage"; + export class AsyncStorageCard{ static AddCardStorage(name : string, cards : Card[]){