r/Frontend • u/bhushanw-tf • Oct 19 '20
My first react js app, Pokemon cards using an API
11
u/Muted_Carpet_7587 Oct 19 '20
Looks really good, it checks many boxes 👍. Try adding a search bar that shows results as you type and some filters. Combining those in a query is a great exercise and highly transferable to day-to-day work.
2
u/bhushanw-tf Oct 19 '20
Yeah, that's the next step. I was going to use react window library but I didn't understand so I dropped that plan and went for pagination but would try for infinite scrolling for sure
6
u/Muted_Carpet_7587 Oct 19 '20
I found this tutorial quite helpful when I was learning about it myself
2
2
u/sittinfatdownsouth Oct 19 '20
If you are planning on making this accessible infinite scrolling isn't very screen reader user friendly.
3
u/Muted_Carpet_7587 Oct 19 '20
You could even implement infinite scrolling instead of the pagination. It's actually not that hard to implement and it looks very professional.
4
u/ArcadeFireSH Oct 19 '20
Cool! The layout is quite neat.
1
u/bhushanw-tf Oct 19 '20
Thanks :)
0
Oct 19 '20
[deleted]
2
u/bhushanw-tf Oct 20 '20
I made a header and card component seperate and then there is seperate stat bar component which is on back of the card. Used flexbox for card container. Also preserve 3d for that flip thing. You can find any tutorial for it on YouTube though.
4
u/Wowosz Oct 19 '20
I did something similar When i was starting with react. pokedex.wojciechszoda.pl
1
1
u/LinkifyBot Oct 19 '20
I found links in your comment that were not hyperlinked:
I did the honors for you.
delete | information | <3
1
2
u/arowolosm Oct 19 '20
Repo link?
4
u/bhushanw-tf Oct 19 '20
https://github.com/bhushan6/PokemonApp but its real messy.
1
0
Sep 18 '22
[deleted]
1
u/bhushanw-tf Sep 18 '22
Because I created it two years ago.........
0
Sep 18 '22
[deleted]
1
u/bhushanw-tf Sep 18 '22
This whole thread is almost 2yrs old, so I really don't know. I'm really confused how you even found this really old post.
2
2
2
2
2
u/Tarkz Oct 20 '20
The gif was just endlessly loading and it took me awhile before I realized that wasn't what you were showing.
2
4
u/itzamirulez Oct 19 '20
are there any pokemon APIs out there?
10
u/alphadeeto to smithereens Oct 19 '20
pokeapi.co
10
u/LinkifyBot Oct 19 '20
I found links in your comment that were not hyperlinked:
I did the honors for you.
delete | information | <3
4
u/alphadeeto to smithereens Oct 19 '20
Good bot
5
u/B0tRank Oct 19 '20
Thank you, alphadeeto, for voting on LinkifyBot.
This bot wants to find the best and worst bots on Reddit. You can view results here.
Even if I don't reply to your comment, I'm still listening for votes. Check the webpage to see if your vote registered!
1
u/BrunnerLivio Oct 19 '20
Not really an API, but for Pokemon GO data you can use this:
https://github.com/pokemongo-dev-contrib/pokemongo-game-master
1
1
u/Redbull_leipzig Oct 19 '20
How did you create the ui?
5
u/bhushanw-tf Oct 19 '20
I made seperate card component and header component also there is stat component which is on the back side of the card. That's it. Also if you're asking for that card flip thing, you can look for card flip in css and you'll find many tutorials.
1
1
u/creaturefeature16 May 05 '23
How did you do the pagination? Is it a facet of react router, or are you just doing a fetch that's scoped to a certain amount and the next/previous buttons initiate another fetch? Couldn't really find any clues in your github, but maybe it's not current...
1
1
Oct 19 '20
looks beautiful
2
u/bhushanw-tf Oct 19 '20
Thanks :)
1
Oct 19 '20
how long did it take you to create this
1
u/bhushanw-tf Oct 19 '20
I did in 3 days but i think you can complete in one day since i dont do this professionally, i do programming in my free time.
1
1
1
1
1
u/AngrycommenterUE Oct 19 '20
Man, I have no idea about react, so I can’t tell you if it’s good or bad. However, damn! That looks amazing! I would love to have your skills!!!!
1
1
2
2
1
1
1
u/spk26515 Oct 20 '20
Nice work ! Could you please post the APIs you used ? would be useful for anyone to try and come up with something similar.
1
1
1
1
1
u/11september22 May 02 '23
Awesome. Wonderful project bro. What projects are you building these days?
-1
u/samineb Oct 19 '20
looks cool but why use a lawnmower to record? post a clearer video dude or at least remove the audio!
1
-4
u/Standard_Detective80 Oct 19 '20
Why can't people use OBS studio?! Why hurt our eyes with bad quality videos whhhhy😭. Nice work btw 😂
4
u/bhushanw-tf Oct 19 '20
hahaha, I didn't make this video with the intention of posting actually, it was really impulse decision and at that moment i didn't have laptop too so yeah posted this lol. also thanks.
0
41
Oct 19 '20
[removed] — view removed comment
13
u/bhushanw-tf Oct 19 '20
Yeah that's the next step, I found one library and I'm trying to figure out how can I use it. Also I'm thinking about adding option to sort out by types of Pokemon.
15
u/Lekoaf Oct 19 '20
It’s trivial to implement without a library. The basics atleast. Write an onChange function for the search input that filters your array of cards on pokemon.name or something like that.
1
u/bhushanw-tf Oct 20 '20
Yeah I was thinking about that but I'm getting data from an API and I'm not requesting every Pokemon in one go as it would give performance issues so now when I don't have full array of Pokemon how I suppose to do the serach thing, also I can use search API but again it won't be that good experience as you'll have to type whole name without any spelling error
2
Nov 10 '20
Have you testing just fetching everything? Preloading <1000 simple data objects may not be the performance hit you think it is. You only have to do it once (on initial app load, depending). It would be async and not displayed. Whatever data structure you use now would probably work fine.
JavaScript has some pretty helpful (array) methods for filtering once you have the list available
If you want fuzzy search, there may be an API out there that supports it already. Pokemon is a popular example and dataset for dev work.
If not, you could try adding it yourself, a few different ways. I would get basic searching working first, then decide from there.
Filtering/searching by type, gen, etc. could also be fun to implement.
~~
It looks great! Those flip transitions are nice
2
u/Hadr619 Oct 20 '20
I was just going to say don’t go down the rabbit hole early in just pulling in libraries when you can implement yourself and learn. Plus you may find out why using a library is beneficial
4
2
19
2
27
u/godspeedt Oct 19 '20
I woul add 'user-select: none' To the cards. That way you won't get that blue selection square over your images.