From 6e3440a5ec399edb457a314a3721f0c93abd3c98 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Mon, 19 Apr 2021 15:30:44 +0200 Subject: [PATCH] Add custom source for avatar picture while conserving default bongo cat picture --- components/Avatar.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/Avatar.js b/components/Avatar.js index 0eaf883..a0ac84c 100644 --- a/components/Avatar.js +++ b/components/Avatar.js @@ -6,7 +6,7 @@ export default function Avatar(props) { return ( The one and only bongo cat! ); @@ -14,4 +14,9 @@ export default function Avatar(props) { Avatar.propTypes = { size: PropTypes.string.isRequired, + src: PropTypes.string +}; + +Avatar.defaultProps = { + src: "/images/bongo.png" };