forked from patternfly/react-user-feedback
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdvanced.tsx
More file actions
31 lines (30 loc) · 1.29 KB
/
Copy pathAdvanced.tsx
File metadata and controls
31 lines (30 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* eslint-disable no-console */
import { FunctionComponent, useState } from 'react';
import { FeedbackModal} from '@patternfly/react-user-feedback';
import { Button } from '@patternfly/react-core';
import feedbackImage from '@patternfly/react-user-feedback/dist/esm/images/rh_feedback.svg';
export const AdvancedExample: FunctionComponent = () => {
const [isOpen, setIsOpen] = useState<boolean>(false);
const handleButtonClicked = () => {setIsOpen(true)};
return <>
<Button onClick={handleButtonClicked}>Show Modal</Button>
<FeedbackModal
onShareFeedback={(email:string, feedback:string)=>{
// Example of a successful callback
console.log (`Email Address: ${email} Feedback: ${feedback}`);
return true
}}
onJoinMailingList={(email:string)=>{
// Example of am unsuccessful callback
console.log (`Email Address: ${email}`);
return false;
}}
onOpenSupportCase='https://pf-user-feedback-extension-form-demos.surge.sh/requestSupport.html'
onReportABug={(email:string, bug:string)=>{
console.log (`Email Address: ${email} Bug: ${bug}`)
return true;}}
feedbackImg={feedbackImage}
isOpen={isOpen}
onClose={()=>setIsOpen(false)}/>
</>
}