From 4248e0de0920fb99e891f79a6bd1300e1f6aa57a Mon Sep 17 00:00:00 2001 From: Lucas Delanier Date: Sat, 18 Mar 2023 00:11:55 +0100 Subject: [PATCH] clean code smells :cop: --- model/Movie.tsx | 31 ++++++++++++++----------------- redux/reducers/appReducer.tsx | 2 +- screens/HomeScreen.tsx | 1 - 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/model/Movie.tsx b/model/Movie.tsx index c9aa89a..64a916f 100644 --- a/model/Movie.tsx +++ b/model/Movie.tsx @@ -1,22 +1,19 @@ class Movie { - public id: number - public original_title: string - public poster_path: string - - public poster_path_min: string - public runtime: number - public vote_average: number - public release_date: string - public overview: string - public genres: string[] - - public backdrop_path: string - - public full_date; - - - constructor(id: number, original_title: string, poster_path: string, runtime: number, vote_average: number, release_date: string, genres: string[], overview: string, backdrop_path: string) { + public poster_path_min : string + + public full_date : string + constructor( + public id: number, + public original_title: string, + public poster_path: string, + public runtime: number, + public vote_average: number, + public release_date: string, + public genres: string[], + public overview: string, + public backdrop_path: string + ) { this.id = id; this.original_title = original_title; this.poster_path = 'https://image.tmdb.org/t/p/w780' + poster_path; diff --git a/redux/reducers/appReducer.tsx b/redux/reducers/appReducer.tsx index 05c6de9..e17c6cb 100644 --- a/redux/reducers/appReducer.tsx +++ b/redux/reducers/appReducer.tsx @@ -8,7 +8,7 @@ const initialState = { favouriteMovies: [] as Movie[], } // @ts-ignore -export default appReducer = (state = initialState, action) => { +export default (state = initialState, action) => { switch (action.type) { case LOAD_WATCHLATER: // @ts-ignore diff --git a/screens/HomeScreen.tsx b/screens/HomeScreen.tsx index b3ab1e8..e68e520 100644 --- a/screens/HomeScreen.tsx +++ b/screens/HomeScreen.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import {TouchableOpacity, View, Text, StyleSheet, Image, ImageBackground, SafeAreaView} from 'react-native'; -import {RootStackScreenProps} from "../types"; import {useEffect, useState} from "react"; import {useSafeAreaInsets} from "react-native-safe-area-context"; import {addMovieToWatchLater, addMovieToFavourite, removeMovieTrending,} from "../redux/actions/actions";