-
Notifications
You must be signed in to change notification settings - Fork 5
add system alerts banner component in order to display alerts via jso… #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add system alerts banner component in order to display alerts via jso… #231
Conversation
@@ -0,0 +1,95 @@ | |||
import { default as defaultTheme, default as theme } from '@/components/theme'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultTheme
and theme
are referring to the same object default
this can be one import
@@ -0,0 +1,95 @@ | |||
import { default as defaultTheme, default as theme } from '@/components/theme'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add copyright
export const SystemAlert: React.FC<Props> = ({ alert, onClose }) => { | ||
const { backgroundColor, icon, textColor, outline } = AlertVariants[alert.level]; | ||
|
||
const createMarkup = (msg: string) => ({ __html: msg }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is pretty pointless. it's used once, not exported, created on every render and all it does is put a string into an object. This can be moved inline to where it's called. something like:
dangerouslySetInnerHTML={{_html:alert.message}}
@@ -0,0 +1,27 @@ | |||
export type AlertLevel = 'info' | 'warning' | 'critical'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add copyright
@@ -0,0 +1,31 @@ | |||
import { ReactElement } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add copyright
@SaqAsh couple of comments to get started with. I need to double check some of the css theme usage tomorrow |
ceb3d3e
into
overture-stack:feature/bannerComponent
Pull Request
Description
Add a flexible SystemAlerts component that supports both env-based and prop-based alert inputs, similarly implemented in virusseq, where inspiration was taken.
Addresses ticket #227
Type of change
Please choose only the relevant options and remove the others.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Checklist:
You do not need to fullfill all requirements of this checklist, select all that apply:
Additional context
A lot of the code was straight from the virus seq portal, the key difference that I had was that I separated types for ease of readability as well as added an outline which would be one shade darker than the background color for appropriate distinction as per the exemplar.