Merge branch 'main' into QueryParams

This commit is contained in:
Sid 2023-09-13 08:39:45 +02:00 committed by GitHub
commit 52993a6a27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 7 deletions

View file

@ -10,11 +10,13 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@types/react-router-dom": "^5.3.3",
"git-mob": "^2.4.0", "git-mob": "^2.4.0",
"qjuul": "^1.0.7", "qjuul": "^1.0.7",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-modal": "^3.16.1" "react-modal": "^3.16.1",
"react-router-dom": "^6.15.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20.5.9", "@types/node": "^20.5.9",

View file

@ -1,6 +1,6 @@
import { movieResponse } from '../types/movie' import { movieResponse } from '../types/movie'
const API_MOVIE_KEY = 'd92949d8' const API_MOVIE_KEY = import.meta.env.VITE_MOVIE_API_KEY
export const fetchMovie = async ( export const fetchMovie = async (
title: string, title: string,
@ -21,6 +21,5 @@ export const fetchMovie = async (
.catch((error) => { .catch((error) => {
console.log('Error:', error) console.log('Error:', error)
}) })
return response return response
} }

View file

@ -23,7 +23,7 @@ const Pagination: React.FC<PaginationProps> = ({
setShowRightDots(currentPage < totalPages - 3 ? true : false) setShowRightDots(currentPage < totalPages - 3 ? true : false)
} }
if (!showLeftDots && !showRightDots) { if (!showLeftDots && !showRightDots) {
setShowingNumbers(Array.from(Array(totalPages).keys())) setShowingNumbers(Array.from(Array(totalPages).keys()).map((n) => n + 1))
} }
if (!showLeftDots && showRightDots) { if (!showLeftDots && showRightDots) {
setShowingNumbers([1, 2, 3, 4, 5]) setShowingNumbers([1, 2, 3, 4, 5])