Skip to content

Commit

Permalink
Merge pull request #77 from GSG-G10/53-user-contact-card
Browse files Browse the repository at this point in the history
53 user contact card
  • Loading branch information
Mu7ammadAbed authored Nov 7, 2021
2 parents 0f02d72 + bca9f7a commit ff24d02
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 2 deletions.
2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"dependencies": {
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@mui/icons-material": "^5.0.5",
"@mui/material": "^5.0.4",
"@mui/styles": "^5.0.2",
"axios": "^0.23.0",
"eslint-config-react-app": "^6.0.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.3.1",
Expand Down
1 change: 0 additions & 1 deletion client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ function App() {

);
}

export default App;
Binary file added client/src/assets/profile-picture.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions client/src/components/UserContacatCard/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import {
Card,
CardContent,
Typography,
Avatar,
colors,

} from '@mui/material';
import MdPhone from '@mui/icons-material/Phone';
import LocationOnIcon from '@mui/icons-material/LocationOn';
import EmailIcon from '@mui/icons-material/Email';
import { makeStyles } from '@mui/styles';
import PropTypes from 'prop-types';

const useStyles = makeStyles({
card: {
backgroundColor: 'secondary',
maxWidth: 345,
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
padding: '10px',
},
icon: {
marginRight: '0.5rem',
},
});
const contentStyles = { display: 'flex', marginBottom: '15px', alignItems: 'center' };

function UserContactCard({
data: {
name, phone, image, location, email,
},
}) {
const classes = useStyles();

return (
<Card className={classes.card} style={{ backgroundColor: '#F1F1F1' }}>

<Avatar
sx={{ bgcolor: colors.green[500], width: 124.02, height: 129.66 }}
src={image}
variant="rounded"
/>
<CardContent className={classes.card}>
<Typography gutterBottom variant="h5" component="div">
{name}
</Typography>
<Typography variant="body2" color="text.secondary">
Building Owner
</Typography>
<Typography gutterBottom variant="h6" component="div">
Contact Info:
</Typography>

<Typography sx={contentStyles} variant="body2" color="text.secondary">
<LocationOnIcon className={classes.icon} />
{location}
</Typography>

<Typography sx={contentStyles} variant="body2" color="text.secondary">
<MdPhone className={classes.icon} />
{phone}
</Typography>

<Typography sx={contentStyles} variant="body2" color="text.secondary">
<EmailIcon className={classes.icon} />
{email}
</Typography>

</CardContent>
</Card>
);
}

UserContactCard.propTypes = {
data: PropTypes.shape({
image: PropTypes.string,
name: PropTypes.string,
location: PropTypes.string,
phone: PropTypes.string,
email: PropTypes.string,
}).isRequired,
};

export default UserContactCard;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"joi": "^17.4.2",
"jsonwebtoken": "^8.5.1",
"pg": "^8.7.1"
},
},
"devDependencies": {
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
Expand Down
Empty file added test.js
Empty file.

0 comments on commit ff24d02

Please sign in to comment.