Skip to content

Commit

Permalink
fix bug landing without API data
Browse files Browse the repository at this point in the history
  • Loading branch information
vicenlu committed Oct 4, 2023
1 parent 2c2bb3e commit babca38
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/components/CollaboratorsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const [windowWidth, setWindowWidth] = useState(window.innerWidth);
//collaborators function

const collaboratorsDataSlice =()=>{
if(!collaborators) return [];

//Colocar el 750 centralizado en redux en una variable//
if(windowWidth>maxWidth && title !='modal'){
Expand Down
40 changes: 28 additions & 12 deletions src/components/CollaboratorsCardIndividual.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,34 @@ import { collaborator } from "../interfaces/interfaces";
interface CollaboratorsCardIndividualProps {
collaboratorsDataSlice: () => collaborator[];
}
export const CollaboratorsCardIndividual: React.FC<CollaboratorsCardIndividualProps> = ({ collaboratorsDataSlice }) => { return (
export const CollaboratorsCardIndividual: React.FC<
CollaboratorsCardIndividualProps
> = ({ collaboratorsDataSlice }) => {
return (
<>

{
collaboratorsDataSlice().map((a:collaborator, index:number)=>{

{/**Colocar en un componente card */}
return <div className="w-2/3 m-auto" key={index} > <a className="flex items-center justify-center "href={a.url} target="_blank" > <img className="w-32 md:w-20 rounded-full" src={a.photo} alt={a.name+ ' photo'} /> <p className="ms-5 w-full text-start">{a.name}</p> </a> </div>
})
}
{collaboratorsDataSlice().map((a: collaborator, index: number) => {
{
/* TODO: Place in a new component (card) */
}
return (
<div className="w-2/3 m-auto" key={index}>
<a
className="flex items-center justify-center "
href={a.url}
target="_blank"
>
<img
className="w-32 md:w-20 rounded-full"
src={a.photo}
alt={a.name + " photo"}
/>
<p className="ms-5 w-full text-start">{a.name}</p>
</a>
</div>
);
})}
</>
)
}
);
};

export default CollaboratorsCardIndividual;
export default CollaboratorsCardIndividual;

0 comments on commit babca38

Please sign in to comment.