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
14 changes: 8 additions & 6 deletions docs/Architecture/plan1_excalidraw.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
---

excalidraw-plugin: parsed
tags: [excalidraw]

---
==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plugin settings under 'Saving'

==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plugin settings under 'Saving'

# Excalidraw Data

## Text Elements

Can ask for prev and next pokemon by ID
Ignores filter ^Bia2RkBk

Asks for a list of Pokemon (constant length) in order of
ID of current selected pokemon +- 1 until the list is full.
We need to fetch them for username and mby sprite. ^uOjU6oLM
ID of current selected pokemon +- 1 until the list is full.
We need to fetch them for username and mby sprite. ^uOjU6oLM

Just displays values stored as favorites in same fasion as
PokemonList. ^p0N1zaqQ

%%

## Drawing

```compressed-json
N4KAkARALgngDgUwgLgAQQQDwMYEMA2AlgCYBOuA7hADTgQBuCpAzoQPYB2KqATLZMzYBXUtiRoIACyhQ4zZAHoFAc0JRJQgEYA6bGwC2CgF7N6hbEcK4OCtptbErHALRY8RMpWdx8Q1TdIEfARcZgRmBShcZR5tHgAWbQBGGjoghH0EDihmbgBtcDBQMBKIEm4IZ2cADgARAAkAUWYjWo4ABmUAdmwAWUwAZVqATWIAZlSSyFhECoAzQIRPKn5S

Expand Down Expand Up @@ -5421,4 +5422,5 @@ ncABODPCACpKsuwnn3d0Utw5mkAAsgCXBRb8A33clct33cP3eV3decr73dZwmp3d2AA57Q5AADAA7das

v3dsPeHImzdOIYDw6ZwphPiD/3d5+ScRZEimsPef3cFbPOpCDADoPf9gDl3cDoApIlOokQADgAAiKC0AhchDAABSoAgABSoBAAA=
```
%%

%%
38 changes: 19 additions & 19 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This directory contains all the docs for this project.

- ./old_root_readme/
Contains the original readme's that I deleted from root, so you may
read it if you wish
- ./old_root_readme/
Contains the original readme's that I deleted from root, so you may
read it if you wish
- Here is a `tree` of our tests, it cover all components and features.

```bash
│   ├── pokemon.test.ts
├── App.test.tsx
Expand All @@ -27,40 +27,40 @@ This directory contains all the docs for this project.

```

All tests pass:
All tests pass:

![image of passed tests](./tests.png)

- . We had one meeting in the beginning to discuss the project. We ended up deciding to use MVC pattern and created the following diagram `plan1.png` (`plan1_excalidraw.md`)

![plan1 driagram](./Architecture/plan1.png)

- Worksheet:
- Worksheet:

```json
{
"Alberto Corvaglia": {
"7/9": "6 hours",
"8/9": "6 hours"
"7/9": "6 hours",
"8/9": "6 hours"
},

"Ayush Bhardwaj": {
"11/9": "4 hours",
"14/9": "4 hours",
"16/9": "4 hours"

"11/9": "4 hours",
"14/9": "4 hours",
"16/9": "4 hours"
},

"Ilias Bouqdire": {
"8/9": "4 hours",
"9/9": "5 hours",
"18/9": "3 hours"
"8/9": "4 hours",
"9/9": "5 hours",
"18/9": "3 hours"
},

"Thomas-Andre Hetlesaether": {
"8/9": "4 hours",
"13/9": "4 hours",
"14/9": "4 hours",
"18/9": "1 hour"
"8/9": "4 hours",
"13/9": "4 hours",
"14/9": "4 hours",
"18/9": "1 hour"
}
}
```
16 changes: 12 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ import { useFilters } from "./controllers/useFilters";
import { PokemonList } from "./components/PokemonList/PokemonList";
import { FavoritePokemon } from "./components/FavoritePokemon/FavoritePokemon";
import { Filter } from "./components/Filter/Filter";
import { GetNextFiltered, GetPrevFiltered } from "./controllers/pokemonController";
import {
GetNextFiltered,
GetPrevFiltered,
} from "./controllers/pokemonController";

export default function App() {
const [currentId, setCurrentId] = useState(1);
const { favoriteIds, favoritePokemons, isFavorite, toggleFavorite, isLoadingFavorites } =
useFavorites();
const {
favoriteIds,
favoritePokemons,
isFavorite,
toggleFavorite,
isLoadingFavorites,
} = useFavorites();
const { filters, setFilter, resetFilters } = useFilters();

const query = useQuery({
Expand Down Expand Up @@ -105,4 +113,4 @@ export default function App() {
</div>
</div>
);
}
}
2 changes: 1 addition & 1 deletion src/components/PokemonList/PokemonList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ async function buildPokemonList(
}

return pokemonList;
}
}
3 changes: 1 addition & 2 deletions src/controllers/pokemonController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export function matchesFilter(
rules: FilterRules,
favoriteIds: number[] = [],
): boolean {

if (rules.onlyFavorites && !favoriteIds.includes(pokemon.id)) return false;
if (rules.type && rules.type.length > 0) {
const hasType = pokemon.types.some((t) =>
Expand Down Expand Up @@ -201,4 +200,4 @@ async function idsForType(type: string): Promise<number[]> {
} catch {
return [];
}
}
}