import React, { Component } from 'react'; import RevertBtn from '../../assets/images/Revert.svg'; import BackHeader from '../BackHeader'; import { Button } from '../Button'; import Select from '../DropdownSelect'; import InputField from '../InputField'; import Panel from '../Panel'; import TextInput from '../TextInput'; import i18n from './i18n'; import styles from './styles.scss'; type FeedbackPanelProps = { brandName: string; currentLocale: string; onBackClick: (...args: any[]) => any; onRevertClick: (...args: any[]) => any; email: string; topic: string; subject: string; description: string; onEmailChange: (...args: any[]) => any; onTopicChange: (...args: any[]) => any; onSubjectChange: (...args: any[]) => any; onDescriptionChange: (...args: any[]) => any; sendFeedback: (...args: any[]) => any; }; class FeedbackPanel extends Component { topicOptions: any; onRevertClick = () => { this.props.onRevertClick(); }; onEmailChange = (e: any) => { const { value } = e.currentTarget; this.props.onEmailChange(value); }; onTopicChange = (option: any) => { this.props.onTopicChange(option); }; onSubjectChange = (e: any) => { const { value } = e.currentTarget; this.props.onSubjectChange(value); }; onDescriptionChange = (e: any) => { const { value } = e.currentTarget; this.props.onDescriptionChange(value); }; onSendClick = () => { const SERVICE_MAIL = 'integration.service@ringcentral.com'; const FEEDBACK_SUBJECT = 'Google User Feedback'; const content = `${ 'Hi Integration Team,\n\n' + `You've got feedback from customer on ${this.props.brandName} for Google extension. This customer could be contacted via email ` }${`${this.props.email}\n\nCustomer Feedback Topic\n${this.props.topic}\n\n`}Subject\n${ this.props.subject }\n\n` + `Description\n${this.props.description}\n\n` + `Regards,\n${this.props.brandName} for Google Extension`; const mailToUrl = `mailto:${SERVICE_MAIL}?subject=${window.encodeURIComponent( FEEDBACK_SUBJECT, )}&body=${window.encodeURIComponent(content)}`; this.props.sendFeedback(mailToUrl); }; // @ts-expect-error TS(4114): This member must have an 'override' modifier becau... Remove this comment to see the full error message render() { const { currentLocale } = this.props; this.topicOptions = [ i18n.getString('bugReport', currentLocale), i18n.getString('featureRequest', currentLocale), i18n.getString('others', currentLocale), ]; const selectedTopicIndex = this.topicOptions.findIndex((topic: any) => topic === this.props.topic) > -1 ? this.topicOptions.findIndex( (topic: any) => topic === this.props.topic, ) + 1 : -1; return (
, // @ts-expect-error TS(2322): Type '{ label: JSX.Element; title: string; placeme... Remove this comment to see the full error message title: i18n.getString('revert', currentLocale), placement: 'right', onClick: this.onRevertClick, }, ]} > {i18n.getString('feedbackHeader', currentLocale)}
{i18n.getString('instruction', currentLocale)}
{i18n.getString('fillForm', currentLocale)} {i18n.getString('send', currentLocale)} {i18n.getString('useMailBox', currentLocale)} integration.service@ringcentral.com.