Skip to content
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

there was an issue with cards that have a name with two lines so I fi… #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/components/Card.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
import React from 'react';

const Card = ({ name, email, id }) => {
if (name.length > 16){
let name1 = "";
for (let i = 0; name.length > 16; i++){
name1 += name[i];
if (name1.length > 12){
name1 += "...";
break;
}
}
name = name1;
}

return (
<div className='tc grow bg-light-green br3 pa3 ma2 dib bw2 shadow-5'>
<div style={{
width: 250,
height: 350}} className='tc grow bg-light-green br3 pa3 ma2 dib bw2 shadow-5'>
<img alt='robots' src={`https://robohash.org/${id}?size=200x200`} />
<div>
<h2>{name}</h2>
Expand All @@ -12,4 +26,6 @@ const Card = ({ name, email, id }) => {
);
}



export default Card;