Skip to content

Commit

Permalink
feat: Settings is shown after first login/signup; fixes...
Browse files Browse the repository at this point in the history
  • Loading branch information
ErickLimaS authored Mar 24, 2024
2 parents 05efcca + fb361d2 commit e0b49df
Show file tree
Hide file tree
Showing 26 changed files with 246 additions and 142 deletions.
28 changes: 21 additions & 7 deletions api/anilist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ export default {
}
catch (error) {

return console.log((error as ErrorTypes).response.data.errors)
console.log((error as ErrorTypes).response.data.errors)

return null

}
}),
Expand Down Expand Up @@ -114,8 +116,9 @@ export default {

}
catch (error) {
console.log((error as ErrorTypes).response.data.errors)

return console.log((error as ErrorTypes).response.data.errors)
return null

}
}),
Expand Down Expand Up @@ -152,7 +155,9 @@ export default {
}
catch (error) {

return console.log((error as ErrorTypes).response.data.errors)
console.log((error as ErrorTypes).response.data.errors)

return null

}

Expand Down Expand Up @@ -194,7 +199,9 @@ export default {
}
catch (error) {

return console.log((error as ErrorTypes).response.data.errors)
console.log((error as ErrorTypes).response.data.errors)

return null

}

Expand Down Expand Up @@ -231,7 +238,9 @@ export default {
}
catch (error) {

return console.log((error as ErrorTypes).response.data.errors)
console.log((error as ErrorTypes).response.data.errors)

return null

}

Expand Down Expand Up @@ -266,7 +275,10 @@ export default {
}
catch (error) {

return console.log((error as ErrorTypes).response.data.errors)
console.log((error as ErrorTypes).response.data.errors)

return null

}

}),
Expand Down Expand Up @@ -295,7 +307,9 @@ export default {
}
catch (error) {

return console.log((error as ErrorTypes).response.data.errors)
console.log((error as ErrorTypes).response.data.errors)

return null

}
}),
Expand Down
12 changes: 9 additions & 3 deletions api/aniwatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export default {
}
catch (error: any) {

return console.log(error?.response.data.errors)
console.log(error?.response.data.errors)

return null

}
}),
Expand All @@ -40,7 +42,9 @@ export default {
}
catch (error: any) {

return console.log(error?.response.data.errors)
console.log(error?.response.data.errors)

return null

}
}),
Expand All @@ -59,7 +63,9 @@ export default {
}
catch (error: any) {

return console.log(error?.response.data.errors)
console.log(error?.response.data.errors)

return null

}
}),
Expand Down
16 changes: 13 additions & 3 deletions api/gogoanime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export default {

console.log(error)

return null

}

},
Expand All @@ -47,6 +49,8 @@ export default {

console.log(error)

return null

}

},
Expand All @@ -66,6 +70,8 @@ export default {

console.log(error)

return null

}

},
Expand All @@ -83,7 +89,9 @@ export default {
}
catch (error) {

return error
console.log(error)

return null

}

Expand All @@ -98,11 +106,13 @@ export default {
method: 'GET'
})

return data as EpisodeLinksGoGoAnime[];
return data as EpisodeLinksGoGoAnime;
}
catch (error) {

return error
console.log(error)

return null

}

Expand Down
5 changes: 2 additions & 3 deletions api/imdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export async function searchMedia(mediaTitle: string) {

console.log(err)

return err

return null
}

}
Expand Down Expand Up @@ -59,7 +58,7 @@ export async function getMediaInfo(search: boolean, mediaId?: string, type?: "TV

console.log(err)

return err
return null

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ li.carousel_item iframe {
top: 50%;
left: 50%;
width: 100vw;
height: 100vh;
/* height: 100vh; */
height: 114vh;
/* transform: translate(-50%, -50%); */
transform: translate(-50%, -25%);
pointer-events: none;
Expand All @@ -87,11 +88,16 @@ li.carousel_item iframe::-webkit-scrollbar {
transform: translate(-50%, -25%);
}
} */
@media (min-aspect-ratio: 16/9) {
.video-container iframe {
height: 56.25vw;
}
}

@media (max-aspect-ratio: 16/9) {
li.carousel_item iframe {
/* width: 177.78vh; */
width: 134.78vh;
width: 177.78vh;
/* width: 134.78vh; */
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/components/HomePage/HeroCarouselHomePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function HeroCarousel({ data, isMobile }: { data: ApiDefaultResult[], isMobile:
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ delay: 3 }}
src={`https://www.youtube.com/embed/${data[imageIndex].trailer.id}?controls=0&autoplay=1&mute=1&playsinline=1&loop=1&showinfo=0`}
src={`https://www.youtube.com/embed/${data[imageIndex].trailer.id}?controls=0&autoplay=1&mute=1&playsinline=1&loop=1&showinfo=0&playlist=${data[imageIndex].trailer.id}`}
frameBorder={0}
title={data[imageIndex].title.romaji + " Trailer"}
/>
Expand Down
6 changes: 4 additions & 2 deletions app/components/HomePage/MediaRankingSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styles from "./component.module.css"
import MediaListCoverInfo from '../../MediaItemCoverInfo2'
import NavButtons from '../../NavButtons'
import { ApiDefaultResult } from '@/app/ts/interfaces/apiAnilistDataInterface'
import API from "@/api/anilist"
import anilist from "@/api/anilist"
import { useAuthState } from 'react-firebase-hooks/auth'
import { getAuth } from 'firebase/auth'
import { initFirebase } from '@/firebase/firebaseApp'
Expand All @@ -17,6 +17,8 @@ type PropsTypes = {

}

export const revalidate = 1800 // revalidate cached data every 30 min

function MediaRankingSection(props: PropsTypes) {

const [mediaList, setMediaList] = useState<ApiDefaultResult[] | ApiDefaultResult | null>(null)
Expand Down Expand Up @@ -44,7 +46,7 @@ function MediaRankingSection(props: PropsTypes) {

}

const response: ApiDefaultResult[] | void = await API.getMediaForThisFormat(parameter, undefined, undefined, undefined, showAdultContent)
const response = await anilist.getMediaForThisFormat(parameter, undefined, undefined, undefined, showAdultContent) as ApiDefaultResult[]

currentQueryValue = parameter

Expand Down
11 changes: 5 additions & 6 deletions app/components/HomePage/NavThoughMedias/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { SetStateAction, useEffect, useState } from 'react'
import styles from './component.module.css'
import Link from 'next/link'
import { ApiAiringMidiaResults, ApiDefaultResult } from '@/app/ts/interfaces/apiAnilistDataInterface'
import API from '@/api/anilist'
import anilist from '@/api/anilist'
import ChevronLeftIcon from '@/public/assets/chevron-left.svg'
import ChevronRightIcon from '@/public/assets/chevron-right.svg'
import CloseSvg from '@/public/assets/x.svg'
Expand All @@ -21,7 +21,6 @@ import { getAuth } from 'firebase/auth'
import { initFirebase } from '@/firebase/firebaseApp'
import { doc, getDoc, getFirestore } from 'firebase/firestore'


type Component = {

title: string,
Expand All @@ -33,7 +32,7 @@ type Component = {

}

export const revalidate = 1800 // revalidate the data every 30 min
export const revalidate = 1800 // revalidate cached data every 30 min

function NavThoughMedias({ title, route, dateOptions, sort, darkBackground, layoutInverted }: Component) {

Expand Down Expand Up @@ -87,13 +86,13 @@ function NavThoughMedias({ title, route, dateOptions, sort, darkBackground, layo
if (sort == "RELEASE") {

// gets the range of days than parse it to unix and get any media releasing in the selected range
response = await API.getReleasingByDaysRange(
response = await anilist.getReleasingByDaysRange(
"ANIME",
days!,
newPageResults ? (previous ? pageIndex - 1 : pageIndex + 1) : undefined,
undefined,
showAdultContent
)
) as ApiAiringMidiaResults[]

const responseMap = (response as ApiAiringMidiaResults[]).map((item) => item.media)
response = responseMap
Expand All @@ -103,7 +102,7 @@ function NavThoughMedias({ title, route, dateOptions, sort, darkBackground, layo
}
else {

response = await API.getMediaForThisFormat(
response = await anilist.getMediaForThisFormat(
"ANIME",
sort,
newPageResults ? (previous ? pageIndex - 1 : pageIndex + 1) : undefined,
Expand Down
6 changes: 4 additions & 2 deletions app/components/HomePage/NewestMediaSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import MediaListCoverInfo from '../../MediaItemCoverInfo2'
import CardMediaCoverAndDescription from '../../CardMediaCoverAndDescription'
import NavButtons from '../../NavButtons'
import { ApiAiringMidiaResults, ApiDefaultResult } from '@/app/ts/interfaces/apiAnilistDataInterface'
import API from "@/api/anilist"
import anilist from "@/api/anilist"
import { useAuthState } from 'react-firebase-hooks/auth'
import { getAuth } from 'firebase/auth'
import { initFirebase } from '@/firebase/firebaseApp'
Expand All @@ -18,6 +18,8 @@ type PropsTypes = {

}

export const revalidate = 1800 // revalidate the data every 30 min

function NewestMediaSection(props: PropsTypes) {

const [mediaList, setMediaList] = useState<ApiAiringMidiaResults[] | ApiDefaultResult[]>([])
Expand Down Expand Up @@ -54,7 +56,7 @@ function NewestMediaSection(props: PropsTypes) {

setIsLoading(true)

const response = await API.getReleasingByDaysRange("ANIME", days, undefined, 11, showAdultContent).then(
const response = await anilist.getReleasingByDaysRange("ANIME", days, undefined, 11, showAdultContent).then(
res => ((res as ApiAiringMidiaResults[]).sort((a, b) => a.media.popularity - b.media.popularity).reverse())
).then(res => res.map((item) => item.media))

Expand Down
1 change: 1 addition & 0 deletions app/components/UserLoginModal/component.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px 0;

}

Expand Down
Loading

0 comments on commit e0b49df

Please sign in to comment.