From 7e1ed710b433f8c22192bb209f1fd254a96cd031 Mon Sep 17 00:00:00 2001 From: "me@jeffersonbledsoe.com" Date: Fri, 6 Dec 2024 01:26:38 +0000 Subject: [PATCH 1/7] Component support for type --- src/components/Components/GlobalAlert.jsx | 33 ++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/components/Components/GlobalAlert.jsx b/src/components/Components/GlobalAlert.jsx index c0f1de8..7e4593a 100644 --- a/src/components/Components/GlobalAlert.jsx +++ b/src/components/Components/GlobalAlert.jsx @@ -1,12 +1,24 @@ -import * as React from 'react'; +import cx from 'classnames'; +import { useReducer } from 'react'; // This component does have a JavaScript file, but it's only for adding `hidden` // to the alert. This was as of 3.16.1, so things may change. -export function GlobalAlert({ title, description, buttonText, url }) { - const [isHidden, hideAlert] = React.useReducer(() => true, false); +/** + * + * @param {Object} props + * @param {('light'|'critical')} [props.type] + */ +export function GlobalAlert({ title, description, buttonText, url, type }) { + const [isHidden, hideAlert] = useReducer(() => true, false); return ( -