Skip to content

Commit

Permalink
#22 make expertblock for 1 expert
Browse files Browse the repository at this point in the history
  • Loading branch information
tania833 committed Nov 12, 2020
1 parent 87abb63 commit 834ec2c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/lib/components/ExpertBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import React from 'react';
import { IExpert } from '../types';

interface IExpertProps {
expert: IExpert[];
expert: IExpert;
}

export const ExpertBlock: React.FC<IExpertProps> = (props) => {
const { expert } = props;
const Cards = expert.map((card) => {
return <img src={card.photo} alt="doctor" key={card.phone} />;
});
return <div>{Cards}</div>;
return (
<div>
<img src={expert.photo} alt="doctor" key={expert.phone} />
</div>
);
};
5 changes: 4 additions & 1 deletion src/lib/components/Experts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import { ExpertBlock } from './ExpertBlock';
import cards from '../../modules/experts/mockDataCards';

export const Experts: React.FC = () => {
const allExperts = cards.map(card => {
return <ExpertBlock expert={card} key={card.phone}/>;
});
return (
<div>
<ExpertBlock expert={cards} />
{allExperts}
</div>
);
};

0 comments on commit 834ec2c

Please sign in to comment.