Skip to content
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

feat: Notification bar. #1195

Merged
merged 7 commits into from
Feb 17, 2022
Merged

feat: Notification bar. #1195

merged 7 commits into from
Feb 17, 2022

Conversation

mturoci
Copy link
Collaborator

@mturoci mturoci commented Jan 19, 2022

Demo

#1007 (comment)

Working in Chrome / Safari / FF.

Unified ui.message_bar styling to match the notification_bar + added support for buttons to keep consistency

image

API review

/**
 * Create a notification bar.
 *
 * A notification bar is an area at the edge of a primary view that displays relevant status information.
 * You can use a notification bar to tell the user about a result of an action, e.g. "Data has been successfully saved".
 */
export interface NotificationBar {
  /** The text displayed on the notification bar. */
  text: S
  /** The icon and color of the notification bar. Defaults to 'info'. */
  type?: 'info' | 'error' | 'warning' | 'success' | 'danger' | 'blocked'
  /** When should the notification bar disappear in seconds. Defaults to 5. */
  timeout?: U
  /** Specify one or more action buttons. */
  buttons?: Component[]
  /** Specify the location of notification. Defaults to 'top-right'. */
  position?: 'top-right' | 'bottom-right' | 'bottom-center' | 'bottom-left' | 'top-left' | 'top-center'
  /** The events to capture on this notification bar. */
  events?: S[]
}
/**
 * Create a message bar.
 *
 * A message bar is an area at the top of a primary view that displays relevant status information.
 * You can use a message bar to tell the user about a situation that does not require their immediate attention and
 * therefore does not need to block other activities.
 */
export interface MessageBar {
  /** The icon and color of the message bar. */
  type?: 'info' | 'error' | 'warning' | 'success' | 'danger' | 'blocked'
  /** The text displayed on the message bar. */
  text?: S
  /** An identifying name for this component. */
  name?: S
  /** Specify one or more action buttons. */
  buttons?: Component[]
  /** The width of the message bar, e.g. '100px'. Defaults to '100%'. */
  width?: S
  /** True if the component should be visible. Defaults to True. */
  visible?: B
}

Closes #1007

@mturoci mturoci requested a review from lo5 as a code owner January 19, 2022 13:42
Copy link
Member

@lo5 lo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - minor comments. Thanks @mturoci!

ui/src/message_bar.tsx Outdated Show resolved Hide resolved
ui/src/message_bar.tsx Outdated Show resolved Hide resolved
ui/src/notification_bar.tsx Show resolved Hide resolved
ui/src/notification_bar.tsx Outdated Show resolved Hide resolved
ui/src/notification_bar.tsx Show resolved Hide resolved
@mturoci mturoci merged commit 4832320 into master Feb 17, 2022
@mturoci mturoci deleted the feat/issue-1007 branch February 17, 2022 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toast notification alert message pop up
2 participants