1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-17 04:30:31 +09:00

refactor: show contributors' name

This commit is contained in:
uetchy 2021-02-25 18:37:06 +09:00
parent dbd206b77f
commit dc62baf8be

View File

@ -1,6 +1,7 @@
import React from 'react';
import styled from 'styled-components';
import useSWR from 'swr';
import Tooltip from 'rc-tooltip';
export interface IContributors {
projectName: string;
@ -37,15 +38,23 @@ const Contributors: React.FC = () => {
return (
<Container>
{data.contributors.map((contributor) => (
<Item key={contributor.login}>
<a
href={contributor.profile}
target="_blank"
rel="noopener noreferrer"
>
<Avatar src={contributor.avatar_url} alt={contributor.name} />
</a>
</Item>
<Tooltip
overlay={`${contributor.name} (${contributor.contributions.join(
', '
)})`}
placement="top"
trigger={['hover']}
>
<Item key={contributor.login}>
<a
href={contributor.profile}
target="_blank"
rel="noopener noreferrer"
>
<Avatar src={contributor.avatar_url} alt={contributor.name} />
</a>
</Item>
</Tooltip>
))}
</Container>
);