Skip to content

Commit

Permalink
Merge pull request #668 from GBAJS754/main
Browse files Browse the repository at this point in the history
[view] 커밋 링크 추가
  • Loading branch information
GBAJS754 authored Aug 27, 2024
2 parents 6ca5aeb + 28fa303 commit fe39a1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/view/src/components/Detail/Detail.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
width: 6em;
position: relative;

span:hover {
a:hover {
cursor: pointer;
.commit-id__tooltip {
display: inline-block;
Expand Down
9 changes: 5 additions & 4 deletions packages/view/src/components/Detail/Detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { FIRST_SHOW_NUM } from "./Detail.const";
import type { DetailProps, DetailSummaryProps, DetailSummaryItem } from "./Detail.type";

import "./Detail.scss";
import { useGlobalData } from "hooks";

const DetailSummary = ({ commitNodeListInCluster }: DetailSummaryProps) => {
const { authorLength, fileLength, commitLength, insertions, deletions } = getCommitListDetail({
Expand Down Expand Up @@ -49,11 +50,11 @@ const Detail = ({ selectedData, clusterId, authSrcMap }: DetailProps) => {
const commitNodeListInCluster =
selectedData?.filter((selected) => selected.commitNodeList[0].clusterId === clusterId)[0].commitNodeList ?? [];
const { commitNodeList, toggle, handleToggle } = useCommitListHide(commitNodeListInCluster);
const { repo, owner } = useGlobalData();
const isShow = commitNodeListInCluster.length > FIRST_SHOW_NUM;
const handleCommitIdCopy = (id: string) => async () => {
navigator.clipboard.writeText(id);
};

if (!selectedData) return null;

return (
Expand Down Expand Up @@ -84,15 +85,15 @@ const Detail = ({ selectedData, clusterId, authSrcMap }: DetailProps) => {
</span>
</div>
<div className="commit-id">
<span
<a
href={`https://github.com/${owner}/${repo}/commit/${id}`}
onClick={handleCommitIdCopy(id)}
role="button"
tabIndex={0}
onKeyDown={handleCommitIdCopy(id)}
>
{id.slice(0, 6)}
<span className="commit-id__tooltip">{id}</span>
</span>
</a>
</div>
</li>
);
Expand Down

0 comments on commit fe39a1c

Please sign in to comment.