Skip to content

Conversation

@Aya-Jafar
Copy link

No description provided.

const handleTabSelect = (tab) => setCurrentTab(tab);


const generateTabContent = (tab) => {
Copy link
Collaborator

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";
Copy link
Collaborator

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) => {
Copy link
Collaborator

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 @@

Copy link
Collaborator

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}`
Copy link
Collaborator

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

Copy link
Collaborator

@klay964 klay964 left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants