Browse Source

fix(dumi): get contributor error on 404 page (#38708)

pull/38722/head
子瞻 Luci 2 years ago
committed by GitHub
parent
commit
a8fc788f98
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 52
      .dumi/theme/slots/Content/index.tsx

52
.dumi/theme/slots/Content/index.tsx

@ -178,32 +178,36 @@ const Content: FC<{ children: ReactNode }> = ({ children }) => {
)}
</Typography.Title>
{children}
<ContributorsList
css={styles.contributorsList}
fileName={meta.frontmatter.filename ?? ''}
renderItem={(item, loading) =>
loading ? (
<Avatar style={{ opacity: 0.3 }} />
) : (
item && (
<Tooltip
title={`${formatMessage({ id: 'app.content.contributors' })}: ${item.username}`}
key={item.username}
>
<a
href={`https://github.com/${item.username}`}
target="_blank"
rel="noopener noreferrer"
{meta.frontmatter.filename && (
<ContributorsList
css={styles.contributorsList}
fileName={meta.frontmatter.filename}
renderItem={(item, loading) =>
loading ? (
<Avatar style={{ opacity: 0.3 }} />
) : (
item && (
<Tooltip
title={`${formatMessage({ id: 'app.content.contributors' })}: ${
item.username
}`}
key={item.username}
>
<Avatar src={item.url}>{item.username}</Avatar>
</a>
</Tooltip>
<a
href={`https://github.com/${item.username}`}
target="_blank"
rel="noopener noreferrer"
>
<Avatar src={item.url}>{item.username}</Avatar>
</a>
</Tooltip>
)
)
)
}
repo="ant-design"
owner="ant-design"
/>
}
repo="ant-design"
owner="ant-design"
/>
)}
</article>
<PrevAndNext />
<Footer />

Loading…
Cancel
Save