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

This commit is contained in:
子瞻 Luci 2022-11-18 23:54:37 +08:00 committed by GitHub
parent 52d2b41f9d
commit a8fc788f98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,16 +178,19 @@ const Content: FC<{ children: ReactNode }> = ({ children }) => {
)} )}
</Typography.Title> </Typography.Title>
{children} {children}
{meta.frontmatter.filename && (
<ContributorsList <ContributorsList
css={styles.contributorsList} css={styles.contributorsList}
fileName={meta.frontmatter.filename ?? ''} fileName={meta.frontmatter.filename}
renderItem={(item, loading) => renderItem={(item, loading) =>
loading ? ( loading ? (
<Avatar style={{ opacity: 0.3 }} /> <Avatar style={{ opacity: 0.3 }} />
) : ( ) : (
item && ( item && (
<Tooltip <Tooltip
title={`${formatMessage({ id: 'app.content.contributors' })}: ${item.username}`} title={`${formatMessage({ id: 'app.content.contributors' })}: ${
item.username
}`}
key={item.username} key={item.username}
> >
<a <a
@ -204,6 +207,7 @@ const Content: FC<{ children: ReactNode }> = ({ children }) => {
repo="ant-design" repo="ant-design"
owner="ant-design" owner="ant-design"
/> />
)}
</article> </article>
<PrevAndNext /> <PrevAndNext />
<Footer /> <Footer />