-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds feedbackIntegration for configuring the feedback form
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
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,31 @@ | ||
import type { Integration } from '@sentry/core'; | ||
|
||
import { defaultConfiguration } from './defaults'; | ||
import defaultStyles from './FeedbackForm.styles'; | ||
import type { FeedbackFormProps } from './FeedbackForm.types'; | ||
|
||
export const FEEDBACK_FORM_INTEGRATION_NAME = 'Feedback Form'; | ||
|
||
type FeedbackIntegration = Integration & { | ||
options: Partial<FeedbackFormProps>; | ||
}; | ||
|
||
let savedOptions: Partial<FeedbackFormProps> = {}; | ||
|
||
export const feedbackIntegration = (initOptions: FeedbackFormProps = {}): FeedbackIntegration => { | ||
savedOptions = { | ||
...defaultConfiguration, | ||
...initOptions, | ||
styles: { | ||
...defaultStyles, | ||
...initOptions.styles, | ||
}, | ||
}; | ||
|
||
return { | ||
name: FEEDBACK_FORM_INTEGRATION_NAME, | ||
options: savedOptions, | ||
}; | ||
}; | ||
|
||
export const getFeedbackOptions = (): Partial<FeedbackFormProps> => savedOptions; |
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