Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion PTG/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
},
"dependencies": {
"react": "^19.2.8",
"react-dom": "^19.2.8"
"react-dom": "^19.2.8",
"react-router": "^8.3.1",
"react-router-dom": "^7.18.3"
},
"devDependencies": {
"@babel/core": "^7.29.7",
Expand Down
70 changes: 70 additions & 0 deletions PTG/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions PTG/src/About.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Header from "./Header.tsx"


export default function About(){
return(
<>
<Header />
<h1>About</h1>
<p>
This is the result of a group project in IT2810 at NTNU.
Yes, we are aware that each Pokédex takes in National Dex as well, so
it is possible getting, e.g. Charizard when picking HG/SS.
This results in end game Pokémon showing up in the Team Generator.
Please be aware of this when generating a team.
</p>
<p>
This website is made by students, and is made for training reasons,
also for lazy people not wanting to pick a team themselves.
</p>
</>
);
}
26 changes: 22 additions & 4 deletions PTG/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
import { useEffect, useState } from "react";
import Header from "./Header.tsx"
import ChoosePokemon from "./ChoosePokemon.tsx";
import PokemonGrid from "./PokemonGrid.tsx";
import { loadStoredFilters, saveStoredFilters } from "./pokemonFilters.ts";

export default function App(){

const [selectedGame, setSelectedGame] = useState(() => loadStoredFilters().selectedGame);
const [selectedGeneration, setSelectedGeneration] = useState(() => loadStoredFilters().selectedGeneration);
const [selectedType, setSelectedType] = useState(() => loadStoredFilters().selectedType);

useEffect(() => {
saveStoredFilters({ selectedGame, selectedGeneration, selectedType });
}, [selectedGame, selectedGeneration, selectedType]);

return(
<div>
<Header />
<ChoosePokemon />
<ChoosePokemon
selectedGame={selectedGame}
selectedGeneration={selectedGeneration}
selectedType={selectedType}
onGameChange={setSelectedGame}
onGenerationChange={setSelectedGeneration}
onTypeChange={setSelectedType}
/>
<PokemonGrid selectedGame={selectedGame} selectedGeneration={selectedGeneration} selectedType={selectedType} />
</div>

);
}
);
}
5 changes: 5 additions & 0 deletions PTG/src/ChoosePokemon.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.chooseType {
field-sizing: content;
width: fit-content;
max-width: 100%;
}
Loading