CTB: Improve SubNavSection title, by passing down defaultMessage

This commit is contained in:
Gustav Hansen 2022-08-02 13:43:30 +02:00
parent 3016533fd1
commit e3fb4d5ae0

View File

@ -42,13 +42,13 @@ const ContentTypeBuilderNav = () => {
})}
/>
<SubNavSections>
{menu.map(section => {
const title = section.title.id;
return (
{menu.map(section => (
<React.Fragment key={section.name}>
<SubNavSection
label={formatMessage({ id: title, defaultMessage: title })}
label={formatMessage({
id: section.title.id,
defaultMessage: section.title.defaultMessage,
})}
collapsable
badgeLabel={section.links.length.toString()}
>
@ -82,11 +82,7 @@ const ContentTypeBuilderNav = () => {
</SubNavSection>
{section.customLink && (
<Box paddingLeft={7}>
<TextButton
onClick={section.customLink.onClick}
startIcon={<Plus />}
marginTop={2}
>
<TextButton onClick={section.customLink.onClick} startIcon={<Plus />} marginTop={2}>
{formatMessage({
id: section.customLink.id,
defaultMessage: section.customLink.defaultMessage,
@ -95,8 +91,7 @@ const ContentTypeBuilderNav = () => {
</Box>
)}
</React.Fragment>
);
})}
))}
</SubNavSections>
</SubNav>
);