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,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 />