Skip to content

Commit

Permalink
feat: page-tab default tab prioritizes frontmatter title
Browse files Browse the repository at this point in the history
  • Loading branch information
Wxh16144 committed Aug 26, 2023
1 parent 0ec05de commit 8fdeced
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/theme-default/slots/ContentTabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ const ContentTabs: FC<IContentTabsProps> = ({
onChange,
}) => {
const intl = useIntl();
const { frontmatter: fm } = useRouteMeta();

// TODO: tab.Extra & tab.Action render

return Boolean(tabs?.length) ? (
<ul className="dumi-default-content-tabs">
<li onClick={() => onChange()} data-active={!key || undefined}>
<button type="button">
{intl.formatMessage({ id: 'content.tabs.default' })}
{fm.title || intl.formatMessage({ id: 'content.tabs.default' })}
</button>
</li>
{tabs!.map((tab) => (
Expand Down

0 comments on commit 8fdeced

Please sign in to comment.