Personal-site/components/Avatar.js

23 lines
428 B
JavaScript
Raw Permalink Normal View History

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]}
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,
src: PropTypes.string
};
Avatar.defaultProps = {
src: "/images/bongo.png"
2020-06-14 14:45:20 +00:00
};