-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add authentication change announcement
Add announcement to header to notify users of upcoming authentication change
- Loading branch information
Showing
6 changed files
with
121 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { css } from '@emotion/react'; | ||
import { Icon, Popover, PopoverRef } from '@jetstream/ui'; | ||
import { FunctionComponent, ReactNode, useEffect, useRef } from 'react'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface HeaderAnnouncementPopoverProps { | ||
children: ReactNode; | ||
} | ||
|
||
export const HeaderAnnouncementPopover: FunctionComponent<HeaderAnnouncementPopoverProps> = ({ children }) => { | ||
const isMounted = useRef(true); | ||
const popoverRef = useRef<PopoverRef>(null); | ||
|
||
useEffect(() => { | ||
isMounted.current = true; | ||
return () => { | ||
isMounted.current = false; | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<Popover | ||
ref={popoverRef} | ||
placement="bottom-end" | ||
header={ | ||
<header className="slds-popover__header"> | ||
<h2 className="slds-text-heading_small" title="Get Help"> | ||
Announcement | ||
</h2> | ||
</header> | ||
} | ||
content={children} | ||
buttonProps={{ | ||
className: | ||
'slds-button slds-button_icon slds-button_icon slds-button_icon-warning slds-button_icon-container slds-button_icon-small cursor-pointer', | ||
}} | ||
> | ||
<Icon | ||
type="action" | ||
icon="announcement" | ||
className="slds-button__icon slds-icon slds-icon-text-warning" | ||
svgCss={css` | ||
color: #fe9339; | ||
`} | ||
omitContainer | ||
/> | ||
</Popover> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters