Skip to content

Commit 4359319

Browse files
committed
feat(repo-explorer): extracted GitCommit type to models.ts
1 parent eafce5f commit 4359319

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

src/features/repo-explorer/components/entries-view/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from "react";
22
import { List } from "antd";
33
import cn from "classnames";
4-
import { RepoIdentity, GitFile } from "models";
4+
import { RepoIdentity, GitFile, GitCommit } from "models";
55
import { useBranch } from "../../hooks";
66
import SkeletonArea from "../skeleton-area";
77
import GitFileView from "./git-file-view";
8-
import LastCommitHeader, { GitCommit } from "./last-commit-header";
8+
import LastCommitHeader from "./last-commit-header";
99
import "./index.scss";
1010

1111
type Props = {

src/features/repo-explorer/components/entries-view/last-commit-header.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
import React from "react";
22
import dayjs from "dayjs";
33
import { Link } from "react-router-dom";
4+
import { GitCommit } from "models";
45
import logo from "./placeholder.png";
56

6-
export type GitCommit = {
7-
message: string;
8-
login?: string;
9-
avatarUrl?: string;
10-
name?: string | null;
11-
date: string;
12-
};
13-
147
type Props = {
158
lastCommit: GitCommit;
169
};

src/models.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,14 @@ export type BranchIdentity = {
3939
* Объект, описывающий файл или директорию
4040
*/
4141
export type GitFile = { type: string; name: string };
42+
43+
/**
44+
* Основная информация о коммите
45+
*/
46+
export type GitCommit = {
47+
message: string;
48+
login?: string;
49+
avatarUrl?: string;
50+
name?: string | null;
51+
date: string;
52+
};

0 commit comments

Comments
 (0)