2020-06-14 11:47:02 +00:00
|
|
|
import React from "react";
|
|
|
|
import styles from "./modules/Avatar.module.css";
|
2020-06-14 14:45:20 +00:00
|
|
|
import PropTypes from "prop-types";
|
2020-06-14 11:47:02 +00:00
|
|
|
|
|
|
|
export default function Avatar(props) {
|
|
|
|
return (
|
|
|
|
<img
|
2020-06-14 14:45:20 +00:00
|
|
|
className={styles[props.size]}
|
2021-04-19 13:30:44 +00:00
|
|
|
src={props.src}
|
2020-06-14 11:47:02 +00:00
|
|
|
alt="The one and only bongo cat!"
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
2020-06-14 14:45:20 +00:00
|
|
|
|
|
|
|
Avatar.propTypes = {
|
|
|
|
size: PropTypes.string.isRequired,
|
2021-04-19 13:30:44 +00:00
|
|
|
src: PropTypes.string
|
|
|
|
};
|
|
|
|
|
|
|
|
Avatar.defaultProps = {
|
|
|
|
src: "/images/bongo.png"
|
2020-06-14 14:45:20 +00:00
|
|
|
};
|