-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preview feature UI dialog popup (#571)
* add dialog for previews * add ability to open link
- Loading branch information
Showing
3 changed files
with
84 additions
and
6 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
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,33 @@ | ||
import React from "react"; | ||
import { useBoolean } from "@fluentui/react-hooks"; | ||
import { Dialog, DialogType, DialogFooter } from '@fluentui/react/lib/Dialog'; | ||
import { PrimaryButton,DefaultButton } from '@fluentui/react/lib/Button'; | ||
|
||
export function PreviewDialog({previewLink}) { | ||
|
||
const [hideDialog, { toggle: toggleHideDialog }] = useBoolean(false); | ||
const dialogContentProps = { | ||
type: DialogType.normal, | ||
title: 'Preview Feature', | ||
closeButtonAriaLabel: 'Close', | ||
subText: `Review the instructions on this page ${previewLink} to enable the feature `, | ||
}; | ||
function _openLink() { | ||
window.open(`${previewLink}`, '_blank', 'noreferrer'); | ||
} | ||
|
||
return ( | ||
<div> | ||
<Dialog | ||
hidden={hideDialog} | ||
onDismiss={toggleHideDialog} | ||
dialogContentProps={dialogContentProps} | ||
> | ||
<DialogFooter> | ||
<PrimaryButton onClick={toggleHideDialog} text="Close" /> | ||
<DefaultButton onClick={_openLink} text="Open Link in New Tab" /> | ||
</DialogFooter> | ||
</Dialog> | ||
</div> | ||
); | ||
} |