Skip to content

Commit

Permalink
refactor: change the way of submitting feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
a-ng-d committed Nov 13, 2024
1 parent 0f741cd commit abce3be
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 70 deletions.
1 change: 0 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"https://rsms.me",
"https://www.gravatar.com",
"https://*.wp.com",
"https://tally.so",
"https://corsproxy.io",
"https://zclweepgvqkrelyfwhma.supabase.co",
"https://*.yelbolt.workers.dev",
Expand Down
2 changes: 0 additions & 2 deletions src/types/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ export interface HighlightDigest {

export type PriorityContext =
| 'EMPTY'
| 'FEEDBACK'
| 'TRIAL_FEEDBACK'
| 'HIGHLIGHT'
| 'WELCOME_TO_PRO'
| 'WELCOME_TO_TRIAL'
Expand Down
6 changes: 0 additions & 6 deletions src/ui/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -981,12 +981,6 @@ class App extends React.Component<Record<string, never>, AppStates> {
>
<Shortcuts
{...this.state}
onReOpenFeedback={() =>
this.setState({ priorityContainerContext: 'FEEDBACK' })
}
onReOpenTrialFeedback={() =>
this.setState({ priorityContainerContext: 'TRIAL_FEEDBACK' })
}
onReOpenHighlight={() =>
this.setState({ priorityContainerContext: 'HIGHLIGHT' })
}
Expand Down
57 changes: 0 additions & 57 deletions src/ui/modules/PriorityContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,61 +196,6 @@ export default class PriorityContainer extends React.Component<
)
}

Feedback = () => {
return (
<Feature
isActive={
features.find((feature) => feature.name === 'SHORTCUTS_FEEDBACK')
?.isActive
}
>
<Dialog
title={locals[this.props.lang].shortcuts.feedback}
actions={{}}
onClose={this.props.onClose}
>
<iframe
style={{
border: 'none',
width: '100%',
}}
title="Voice of the UI Color Palette Users"
loading="lazy"
src="https://tally.so/embed/w7KBNL?hideTitle=1"
></iframe>
</Dialog>
</Feature>
)
}

TrialFeedback = () => {
return (
<Feature
isActive={
features.find((feature) => feature.name === 'SHORTCUTS_FEEDBACK')
?.isActive
}
>
<Dialog
title={locals[this.props.lang].shortcuts.trialFeedback}
actions={{}}
onClose={this.props.onClose}
>
<iframe
style={{
border: 'none',
width: '100%',
height: '100%',
}}
title="Voice of the UI Color Palette Users"
loading="lazy"
src="https://tally.so/embed/w2Krvp?hideTitle=1"
></iframe>
</Dialog>
</Feature>
)
}

WelcomeToPro = () => {
return (
<Feature
Expand Down Expand Up @@ -512,8 +457,6 @@ export default class PriorityContainer extends React.Component<
{this.props.context === 'TRY' ? <this.TryPro /> : null}
{this.props.context === 'WELCOME_TO_TRIAL' && <this.WelcomeToTrial />}
{this.props.context === 'WELCOME_TO_PRO' ? <this.WelcomeToPro /> : null}
{this.props.context === 'FEEDBACK' ? <this.Feedback /> : null}
{this.props.context === 'TRIAL_FEEDBACK' && <this.TrialFeedback />}
{this.props.context === 'HIGHLIGHT' ? <this.Highlight /> : null}
{this.props.context === 'ABOUT' ? <this.About /> : null}
{this.props.context === 'PUBLICATION' ? <this.Publication /> : null}
Expand Down
25 changes: 21 additions & 4 deletions src/ui/modules/Shortcuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ interface ShortcutsProps {
highlight: HighlightDigest
lang: Language
figmaUserId: string
onReOpenFeedback: () => void
onReOpenTrialFeedback: () => void
onReOpenHighlight: () => void
onReOpenAbout: () => void
onReOpenReport: () => void
Expand Down Expand Up @@ -379,7 +377,16 @@ export default class Shortcuts extends React.Component<
(feature) => feature.name === 'SHORTCUTS_FEEDBACK'
)?.isNew,
children: [],
action: () => this.props.onReOpenFeedback(),
action: () =>
parent.postMessage(
{
pluginMessage: {
type: 'OPEN_IN_BROWSER',
url: 'https://uicp.link/feedback',
},
},
'*'
),
},
{
label: locals[this.props.lang].about.beInvolved.request,
Expand Down Expand Up @@ -593,7 +600,17 @@ export default class Shortcuts extends React.Component<
<Button
type="tertiary"
label={locals[this.props.lang].shortcuts.trialFeedback}
action={this.props.onReOpenTrialFeedback}
action={() =>
parent.postMessage(
{
pluginMessage: {
type: 'OPEN_IN_BROWSER',
url: 'https://uicp.link/trial-feedback',
},
},
'*'
)
}
/>
</>
)
Expand Down

0 comments on commit abce3be

Please sign in to comment.