From bd4e7cf79e4fce25df00ebabe6100cdb01f33aeb Mon Sep 17 00:00:00 2001 From: Rising Odegua Date: Mon, 3 May 2021 15:20:50 +0100 Subject: [PATCH] [Components][s]: Add misc components --- src/components/misc/CustomLink.js | 27 ++++++++++++++++++++++++++ src/components/misc/Error.js | 32 +++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 src/components/misc/CustomLink.js create mode 100644 src/components/misc/Error.js diff --git a/src/components/misc/CustomLink.js b/src/components/misc/CustomLink.js new file mode 100644 index 00000000..686dfdfd --- /dev/null +++ b/src/components/misc/CustomLink.js @@ -0,0 +1,27 @@ +import React from 'react' +import PropTypes from 'prop-types'; + +/** + * Creates a custom link with title + * @param {object} props + * { + * url: The url of the custom link + * title: The title for the custom link + * } + * @returns React Component + */ +const CustomLink = ({ url, title }) => ( + + {title} + +); + +CustomLink.propTypes = { + url: PropTypes.string.isRequired, + title: PropTypes.string.isRequired +} + +export default CustomLink; diff --git a/src/components/misc/Error.js b/src/components/misc/Error.js new file mode 100644 index 00000000..39eed32b --- /dev/null +++ b/src/components/misc/Error.js @@ -0,0 +1,32 @@ +import React from 'react' +import PropTypes from 'prop-types'; + +/** + * Error message component with consistent portal style + * @param {object} props + * { + * message: The error message to display + * } + * @returns + */ +const ErrorMessage = ({ message }) => { + return ( + + ); +}; + +ErrorMessage.propTypes = { + message: PropTypes.string.isRequired +} + +export default ErrorMessage;