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