From 51795a750270ec885c11aebd54b6d0fa5c7d2d9c Mon Sep 17 00:00:00 2001 From: Nonumpa Date: Sun, 25 Jun 2023 20:54:29 +0800 Subject: [PATCH] Fix env config error and update wording --- components/Collaborate/CollabEditor.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/Collaborate/CollabEditor.js b/components/Collaborate/CollabEditor.js index fad7b836..e067746e 100644 --- a/components/Collaborate/CollabEditor.js +++ b/components/Collaborate/CollabEditor.js @@ -24,6 +24,11 @@ import { makeStyles } from '@material-ui/core/styles'; import useCurrentUser from 'lib/useCurrentUser'; import cx from 'clsx'; import PlaceholderPlugin from './Placeholder'; +import getConfig from 'next/config'; + +const { + publicRuntimeConfig: { PUBLIC_HOCUSPOCUS_URL }, +} = getConfig(); const useStyles = makeStyles(theme => ({ transcriptHeader: { @@ -92,7 +97,7 @@ const CollabEditor = ({ article }) => { ydoc.gc = false; const provider = new HocuspocusProvider({ - url: process.env.PUBLIC_HOCUSPOCUS_URL, + url: PUBLIC_HOCUSPOCUS_URL, name: article.id, broadcast: false, token: 'test', @@ -122,7 +127,7 @@ const CollabEditor = ({ article }) => { 'Mod-y': redo, 'Mod-Shift-z': redo, }), - PlaceholderPlugin('Input text'), + PlaceholderPlugin(t`Input transcript`), ].concat(exampleSetup({ schema, menuBar: false })), }), }) @@ -184,7 +189,7 @@ const CollabEditor = ({ article }) => { color="textSecondary" display="block" > - {t`Text`} + {t`Transcript`} {!editorView ? ( <>