-
Couldn't load subscription status.
- Fork 12
🦸♂️ 🦸♀️ 🦸 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
🦸♂️ 🦸♀️ 🦸 #1
Conversation
| const handleTabSelect = (tab) => setCurrentTab(tab); | ||
|
|
||
|
|
||
| const generateTabContent = (tab) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loved how you used a switch case for this kind of condition that involves several situations and also how you used it to render components
| @@ -0,0 +1,37 @@ | |||
| import React, { useEffect, useState , useContext } from "react"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete unused imports
|
|
||
| const keysToDisplay = ["relatives", "group-affiliation"]; | ||
|
|
||
| const shortenText = (str) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make a separate folder called utils or helpers and make a file that contains all helper functions like this one and write it their and import it to use it here
| @@ -0,0 +1,24 @@ | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job making the services folder to handle dealing with the api !
|
|
||
| const token = process.env.REACT_APP_TOKEN; | ||
|
|
||
| const BASE_URL = `https://superheroapi.com/api.php/${token}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
save the API URL inside the env file too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done Aya! a really well-structured code keep up the good work
No description provided.