Personal-site/components/Avatar.js

23 lines
428 B
JavaScript

import React from "react";
import styles from "./modules/Avatar.module.css";
import PropTypes from "prop-types";
export default function Avatar(props) {
return (
<img
className={styles[props.size]}
src={props.src}
alt="The one and only bongo cat!"
/>
);
}
Avatar.propTypes = {
size: PropTypes.string.isRequired,
src: PropTypes.string
};
Avatar.defaultProps = {
src: "/images/bongo.png"
};