Updated Portal back button translations

refs https://github.com/TryGhost/Ghost/issues/16628
This commit is contained in:
Simon Backx 2023-05-02 16:51:29 +02:00
parent 97584cf0c4
commit 6aa8fa2a8e

View File

@ -1,4 +1,5 @@
import React from 'react';
import React, {useContext} from 'react';
import AppContext from '../../AppContext';
import {ReactComponent as LeftArrowIcon} from '../../images/icons/arrow-left.svg';
export const BackButtonStyles = `
@ -40,11 +41,17 @@ export const BackButtonStyles = `
}
`;
function ActionButton({label = 'Back', brandColor = '#3eb0ef', hidden = false, onClick}) {
function ActionButton({label = null, brandColor = '#3eb0ef', hidden = false, onClick}) {
const {t} = useContext(AppContext);
if (hidden) {
return null;
}
if (label === null) {
label = t('Back');
}
return (
<button className='gh-portal-btn gh-portal-btn-back' onClick={e => onClick(e)}>
<LeftArrowIcon /> {label}