Skip to content

Commit

Permalink
update flashbar demo
Browse files Browse the repository at this point in the history
  • Loading branch information
just-boris committed Oct 11, 2024
1 parent 936684e commit cfebb2b
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions pages/app-layout/utils/content-blocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,15 @@ export function Navigation() {

export function Notifications() {
const [visible, setVisible] = useState(true);
const notifications: Array<FlashbarProps.MessageDefinition> = [];
if (visible) {
notifications.push({
type: 'success',
header: 'Success message',
statusIconAriaLabel: 'success',
dismissLabel: 'Dismiss notification',
dismissible: true,
onDismiss: () => setVisible(false),
});
}
return <Flashbar items={notifications} />;
const demoNotification: FlashbarProps.MessageDefinition = {
type: 'success',
header: 'Success message',
statusIconAriaLabel: 'success',
dismissLabel: 'Dismiss notification',
dismissible: true,
onDismiss: () => setVisible(false),
};
return <Flashbar items={visible ? [demoNotification] : []} />;
}

export function Footer({ legacyConsoleNav }: { legacyConsoleNav: boolean }) {
Expand Down

0 comments on commit cfebb2b

Please sign in to comment.