Skip to content

Commit

Permalink
Icone para quando usuário não tiver avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
richecr committed Feb 15, 2021
1 parent 9b03009 commit 3f694c9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
18 changes: 18 additions & 0 deletions mock/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,23 @@
"name": "Stephane"
}
}
],
"users": [
{
"id": 2,
"name": "Rick 1",
"email": "[email protected]",
"company_id": 1,
"createdAt": "2021-02-12T20:21:17.803Z",
"updatedAt": "2021-02-12T21:21:56.763Z"
},
{
"id": 3,
"name": "Lucas",
"email": "[email protected]",
"company_id": 1,
"createdAt": "2021-02-15T19:20:54.542Z",
"updatedAt": "2021-02-15T19:22:44.566Z"
}
]
}
Binary file added src/assets/not_found_icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions src/components/CardUser/CardUser.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@
margin-left: 10px;
}
}

img {
border: 1px solid #000000;
box-sizing: border-box;
border-radius: 50px;
height: 80px;
}
}

.btnPerfil {
Expand All @@ -54,4 +47,11 @@
transform: scale(1.055);
box-shadow: 5px 5px 15px rgba(221, 208, 208, 1);
}

.icon_avatar {
border: 1px solid #000000;
box-sizing: border-box;
border-radius: 50px;
height: 80px;
}
}
8 changes: 3 additions & 5 deletions src/components/CardUser/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import NotFoundIcon from '../../assets/not_found_icons.png';

import styles from './CardUser.module.scss';

Expand All @@ -9,11 +10,8 @@ const CardUser = ({ user }) => (
<div className={styles.user}>
<div className={styles.picture}>
<img
src={
user.avatar_url === undefined
? 'https://avatars1.githubusercontent.com/u/25726888?s=460&u=8252555dd09e9b823676ff8e9585ca1b69ad3de6&v=4'
: user.avatar_url
}
className={styles.icon_avatar}
src={user.avatar_url === undefined ? NotFoundIcon : user.avatar_url}
alt="Profile"
/>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/pages/Team/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect, useState } from 'react';
import { FaFilter } from 'react-icons/fa';

import MainLayout from 'components/MainLayout';
import CardUser from 'components/CardUser';
import MainCard from 'components/MainCard';
Expand Down

0 comments on commit 3f694c9

Please sign in to comment.