fix: hardcode delete confirmation text to avoid translation mismatch (#1487)

This commit is contained in:
Ephraim Duncan
2024-11-22 07:22:31 +00:00
committed by GitHub
parent 11e483f1c4
commit cd5adce7df

View File

@ -47,6 +47,8 @@ export const DeleteDocumentDialog = ({
const { refreshLimits } = useLimits(); const { refreshLimits } = useLimits();
const { _ } = useLingui(); const { _ } = useLingui();
const deleteMessage = msg`delete`;
const [inputValue, setInputValue] = useState(''); const [inputValue, setInputValue] = useState('');
const [isDeleteEnabled, setIsDeleteEnabled] = useState(status === DocumentStatus.DRAFT); const [isDeleteEnabled, setIsDeleteEnabled] = useState(status === DocumentStatus.DRAFT);
@ -87,7 +89,7 @@ export const DeleteDocumentDialog = ({
const onInputChange = (event: React.ChangeEvent<HTMLInputElement>) => { const onInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
setInputValue(event.target.value); setInputValue(event.target.value);
setIsDeleteEnabled(event.target.value === _(msg`delete`)); setIsDeleteEnabled(event.target.value === _(deleteMessage));
}; };
return ( return (
@ -181,7 +183,7 @@ export const DeleteDocumentDialog = ({
type="text" type="text"
value={inputValue} value={inputValue}
onChange={onInputChange} onChange={onInputChange}
placeholder={_(msg`Type 'delete' to confirm`)} placeholder={_(msg`Please type ${`'${_(deleteMessage)}'`} to confirm`)}
/> />
)} )}