Skip to content

Commit 64e213c

Browse files
committed
chore: hash icon added
1 parent 96ddc7f commit 64e213c

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

src/Assets/Icon/ic-hash.svg

Lines changed: 3 additions & 0 deletions
Loading

src/Shared/Components/GitCommitInfoGeneric/GitCommitInfoGeneric.tsx

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { stopPropagation } from '@Common/Helper'
3232
import { DATE_TIME_FORMATS } from '@Common/Constants'
3333
import { ReactComponent as Tag } from '@Icons/ic-tag.svg'
3434
import { getLowerCaseObject, getWebhookDate } from '@Shared/Helpers'
35+
import { ReactComponent as Hash } from '@Icons/ic-hash.svg'
3536
import GitMaterialInfoHeader from './GitMaterialInfoHeader'
3637
import { MATERIAL_EXCLUDE_TIPPY_TEXT } from '../../constants'
3738
import { WEBHOOK_EVENT_ACTION_TYPE } from './constants'
@@ -64,25 +65,25 @@ const GitCommitInfoGeneric = ({
6465
function renderBasicGitCommitInfoForWebhook() {
6566
const _date = getWebhookDate(materialSourceType, commitInfo)
6667
return (
67-
<>
68+
<div className="flex column dc__gap-4 w-100">
6869
{_webhookData.data.author ? (
69-
<div className="material-history__text lh-20 flex left dc__gap-8">
70+
<div className="material-history__text lh-20 flex left dc__gap-8 w-100">
7071
<PersonIcon className="icon-dim-16" /> {_webhookData.data.author}
7172
</div>
7273
) : null}
7374
{_date ? (
74-
<div className="material-history__text lh-20 flex left dc__gap-8">
75+
<div className="material-history__text lh-20 flex left dc__gap-8 w-100">
7576
<CalendarIcon className="icon-dim-16" />
7677
<time className="cn-7 fs-12">{_date}</time>
7778
</div>
7879
) : null}
7980
{_webhookData.data.message ? (
80-
<div className="material-history__text lh-20 flex left dc__gap-8 top material-history-text--padded">
81+
<div className="material-history__text lh-20 flex left dc__gap-8 top material-history-text--padded w-100">
8182
<MessageIcon className="icon-dim-16 mw-16 mr-8 mt-2" />
8283
{_webhookData.data.message}
8384
</div>
8485
) : null}
85-
</>
86+
</div>
8687
)
8788
}
8889

@@ -198,15 +199,17 @@ const GitCommitInfoGeneric = ({
198199
const pullRequestId = pullRequestUrl.split('/').pop()
199200

200201
return (
201-
<a
202-
href={pullRequestUrl}
203-
target="_blank"
204-
rel="noopener noreferrer"
205-
className="commit-hash fs-14 px-6 mono dc__w-fit-content cursor"
206-
onClick={stopPropagation}
207-
>
208-
# {Number.isNaN(pullRequestId) ? 'PR' : pullRequestId}
209-
</a>
202+
<div className="w-100">
203+
<a
204+
href={pullRequestUrl}
205+
target="_blank"
206+
rel="noopener noreferrer"
207+
className="commit-hash fs-13 px-6 dc__w-fit-content cursor flex left dc__gap-4"
208+
onClick={stopPropagation}
209+
>
210+
<Hash /> <span>{Number.isNaN(pullRequestId) ? 'PR' : pullRequestId}</span>
211+
</a>
212+
</div>
210213
)
211214
}
212215

@@ -226,9 +229,9 @@ const GitCommitInfoGeneric = ({
226229
const renderPRInfoCard = () =>
227230
_isWebhook &&
228231
_webhookData.eventactiontype === WEBHOOK_EVENT_ACTION_TYPE.MERGED && (
229-
<>
232+
<div className="flex column dc__gap-8">
230233
{renderPullRequestId(_webhookData.data['git url'])}
231-
<div className="flex dc__content-space">
234+
<div className="flex dc__content-space w-100">
232235
{renderWebhookTitle()}
233236
{selectedCommitInfo ? (
234237
<div className="flexbox dc__align-items-center dc__content-end fs-12">
@@ -241,7 +244,7 @@ const GitCommitInfoGeneric = ({
241244
) : null}
242245
</div>
243246

244-
<div className="flex left lh-20 dc__gap-8">
247+
<div className="flex left lh-20 dc__gap-8 w-100">
245248
<PullRequestIcon className="icon-dim-16" />
246249
<div className="flex left dc__gap-4">
247250
Merge commit into&nbsp;
@@ -252,15 +255,15 @@ const GitCommitInfoGeneric = ({
252255
</div>
253256
{renderBasicGitCommitInfoForWebhook()}
254257
{handleMoreDataForWebhook()}
255-
</>
258+
</div>
256259
)
257260

258261
const renderTagInfoCard = () =>
259262
_isWebhook &&
260263
_webhookData.eventactiontype === WEBHOOK_EVENT_ACTION_TYPE.NON_MERGED && (
261264
<>
262265
<div className="flex left dc__content-space">
263-
<div className="commit-hash px-6 dc__w-fit-content dc__gap-4">
266+
<div className="commit-hash px-6 dc__w-fit-content dc__gap-4 fs-13">
264267
<Tag className="icon-dim-14 scb-5" />
265268
{_webhookData.data['target checkout']}
266269
</div>

0 commit comments

Comments
 (0)