-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref DEV-2343 ref DEV-2342
- Loading branch information
Showing
4 changed files
with
110 additions
and
18 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
portal/src/components/billing/CancelSubscriptionSurveyDialog.tsx
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,58 @@ | ||
import { | ||
Dialog, | ||
DialogFooter, | ||
DialogType, | ||
IDialogContentProps, | ||
} from "@fluentui/react"; | ||
import React, { useMemo } from "react"; | ||
import { FormattedMessage } from "@oursky/react-messageformat"; | ||
import PrimaryButton from "../../PrimaryButton"; | ||
import DefaultButton from "../../DefaultButton"; | ||
|
||
interface CancelSubscriptionSurveyDialogProps { | ||
isHidden: boolean; | ||
onDismiss: () => void; | ||
onConfirm: () => void; | ||
onCancel: () => void; | ||
} | ||
|
||
export function CancelSubscriptionSurveyDialog({ | ||
isHidden, | ||
onDismiss, | ||
onConfirm, | ||
onCancel, | ||
}: CancelSubscriptionSurveyDialogProps): React.ReactElement { | ||
const dialogContentProps: IDialogContentProps = useMemo(() => { | ||
return { | ||
type: DialogType.normal, | ||
title: <FormattedMessage id="CancelSubscriptionSurveyDialog.title" />, | ||
subText: ( | ||
<FormattedMessage id="CancelSubscriptionSurveyDialog.body" /> | ||
) as unknown as IDialogContentProps["subText"], | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<Dialog | ||
hidden={isHidden} | ||
onDismiss={onDismiss} | ||
dialogContentProps={dialogContentProps} | ||
> | ||
<DialogFooter> | ||
<PrimaryButton | ||
onClick={onConfirm} | ||
disabled={isHidden} | ||
text={ | ||
<FormattedMessage id="CancelSubscriptionSurveyDialog.button.yes" /> | ||
} | ||
/> | ||
<DefaultButton | ||
onClick={onCancel} | ||
text={ | ||
<FormattedMessage id="CancelSubscriptionSurveyDialog.button.no" /> | ||
} | ||
/> | ||
</DialogFooter> | ||
</Dialog> | ||
); | ||
} |
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