From 7903b5517a8aefb246419a2268785a6d60e8f4d6 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 18 May 2021 16:28:51 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=94=20Document=20Badge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nest_frontend/components/base/Badge.js | 12 ++++++++++++ .../components/interactive/BadgeCondition.js | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/nest_frontend/components/base/Badge.js b/nest_frontend/components/base/Badge.js index c339860..86006ca 100644 --- a/nest_frontend/components/base/Badge.js +++ b/nest_frontend/components/base/Badge.js @@ -5,6 +5,18 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import ButtonSmallX from "./ButtonSmallX" +/** + * A small colored badge. + * + * @param icon - The icon that the badge should have on the left. + * @param color - The color that the badge should have. + * @param onClickDelete - The action to perform when the X button is clicked. If undefined, the X button won't be shown. + * @param children - The text of the badge. + * @param className - Additional class(es) to append to the badge. + * @param props - Additional props to pass to the badge. + * @returns {JSX.Element} + * @constructor + */ export default function Badge({ icon, color, onClickDelete, children, className, ...props }) { return (
diff --git a/nest_frontend/components/interactive/BadgeCondition.js b/nest_frontend/components/interactive/BadgeCondition.js index 4b8f40f..63a01fa 100644 --- a/nest_frontend/components/interactive/BadgeCondition.js +++ b/nest_frontend/components/interactive/BadgeCondition.js @@ -23,7 +23,7 @@ const CONDITION_ICONS = { /** - * A small colored badge representing a Condition for a filter. + * A {@link Badge} representing a Condition for a filter. * * @param condition - The Condition that this badge represents. * @returns {JSX.Element}