mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Adds a toast for docx import feedback form (#32695)
* adding a toast for import docx feedback form link * renaming importDocxFeedbackToast to importDocxFeedbackToastGenerator * fixing capital letter in translation * adding noopener and shorter link GitOrigin-RevId: fc1ea105f5d092e25bd2dc3966710a897959d944
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
import { GlobalToastGeneratorEntry } from '@/features/ide-react/components/global-toasts'
|
||||
import { Trans } from 'react-i18next'
|
||||
|
||||
const ImportDocxFeedbackToast = () => {
|
||||
return (
|
||||
<div>
|
||||
<Trans
|
||||
i18nKey="docx_import_feedback_message"
|
||||
components={[
|
||||
/* eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key */
|
||||
<a
|
||||
href="https://forms.gle/B1qrdiD983YcQCJA9"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
/>,
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const generators: GlobalToastGeneratorEntry[] = [
|
||||
{
|
||||
key: 'import:docx-feedback',
|
||||
generator: () => ({
|
||||
content: <ImportDocxFeedbackToast />,
|
||||
type: 'info',
|
||||
autoHide: false,
|
||||
isDismissible: true,
|
||||
}),
|
||||
},
|
||||
]
|
||||
|
||||
export default generators
|
||||
|
||||
export const showImportDocxFeedbackToast = () => {
|
||||
window.dispatchEvent(
|
||||
new CustomEvent('ide:show-toast', {
|
||||
detail: { key: 'import:docx-feedback' },
|
||||
})
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user