-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added raids and converted scroll up to compnent
- Loading branch information
1 parent
b764976
commit aff229f
Showing
14 changed files
with
428 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import axios from "axios" | ||
import { NextResponse } from "next/server" | ||
|
||
const leekData = | ||
"https://raw.githubusercontent.com/bigfoott/ScrapedDuck/data/raids.json" | ||
export async function GET(req: Request) { | ||
try { | ||
const leekRaids = await axios.get(leekData) | ||
|
||
// Filter raids into different tiers | ||
const tier1Raids = filterRaidsByTier(leekRaids.data, "Tier 1") | ||
const tier2Raids = filterRaidsByTier(leekRaids.data, "Tier 2") | ||
const tier3Raids = filterRaidsByTier(leekRaids.data, "Tier 3") | ||
const tier4Raids = filterRaidsByTier(leekRaids.data, "Tier 4") | ||
const tier5Raids = filterRaidsByTier(leekRaids.data, "Tier 5") | ||
const megaRaids = filterRaidsByTier(leekRaids.data, "Mega") | ||
|
||
return NextResponse.json( | ||
{ | ||
msg: "Success", | ||
tier_1: tier1Raids, | ||
tier_2: tier2Raids, | ||
tier_3: tier3Raids, | ||
tier_4: tier4Raids, | ||
tier_5: tier5Raids, | ||
mega: megaRaids, | ||
}, | ||
{ status: 200 } | ||
) | ||
} catch (error) { | ||
return NextResponse.json({ msg: "Error in Grunts GET" }, { status: 500 }) | ||
} | ||
} | ||
|
||
function filterRaidsByTier(raids: any[], tier: string) { | ||
return raids.filter((raid) => raid.tier === tier) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"use client" | ||
import { Container } from "@mantine/core" | ||
import { NavBar } from "@/components/NavBar" | ||
import { Raids} from "@/components/Raids" | ||
|
||
export default function PokemonName() { | ||
return ( | ||
<Container fluid className="overflow-hidden w-full md:w-4/5"> | ||
<NavBar /> | ||
<Raids /> | ||
</Container> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.