Skip to content

Commit f93656a

Browse files
committed
onCommitNavigate
1 parent abdbfd0 commit f93656a

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,6 @@ If you are upgrading from a version prior to 2.0.0, please note the changes to p
193193

194194
-- Diff section UI fixes.
195195

196-
## [2.3.11]
196+
## [2.3.12]
197197

198-
-- Add optional `onCommitClick` in `commit` object, to handle routing in commit item.
198+
-- Add optional `onCommitNavigate` in `commit` object, to handle routing in commit item.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commit-graph",
3-
"version": "2.3.11",
3+
"version": "2.3.12",
44
"homepage": "https://liuliu-dev.github.io/CommitGraph/",
55
"author": "Liu Liu <[email protected]>",
66
"description": "A React component to visualize a commit graph.",

src/components/CommitDetails/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ export default function CommitDetails({
6868
>
6969
<div style={{ color: commit.commitColor }} className={css.labelAndLink}>
7070
<div>
71-
{commit.onCommitClick ? (
71+
{commit.onCommitNavigate ? (
7272
<span
7373
style={{ color: color }}
7474
className={`${css.bold} ${css.clickable}`}
7575
onClick={() => {
76-
commit.onCommitClick!();
76+
commit.onCommitNavigate!();
7777
}}
7878
onMouseOver={() => setColor("#1f6dc6")}
7979
onMouseLeave={() => setColor(commit.commitColor)}

src/helpers/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function formatCommits(commits: Commit[]): CommitNode[] {
3838
message: commit.commit.message,
3939
commitDate: new Date(commit.commit.author.date),
4040
commitLink: commit.html_url,
41-
onCommitClick: commit.onCommitClick,
41+
onCommitNavigate: commit.onCommitNavigate,
4242
commitColor: "",
4343
x: -1,
4444
y: -1,
@@ -116,6 +116,6 @@ export function fromCommitNodeToCommit(commit: CommitNode): Commit {
116116
},
117117
parents: commit.parents.map(p => ({ sha: p })),
118118
html_url: commit.commitLink,
119-
onCommitClick: commit.onCommitClick,
119+
onCommitNavigate: commit.onCommitNavigate,
120120
};
121121
}

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type Commit = {
88
};
99
parents: ParentCommit[];
1010
html_url?: string;
11-
onCommitClick?: () => void;
11+
onCommitNavigate?: () => void;
1212
};
1313

1414
export type CommitNode = {
@@ -24,7 +24,7 @@ export type CommitNode = {
2424
y: number;
2525
commitColor: string;
2626
commitLink?: string;
27-
onCommitClick?: () => void;
27+
onCommitNavigate?: () => void;
2828
};
2929

3030
export type BranchPathType = {

0 commit comments

Comments
 (0)