Skip to content

Commit f477b05

Browse files
committed
fix tailwind build failure in actions yml
1 parent 77981cb commit f477b05

File tree

2 files changed

+40
-10
lines changed

2 files changed

+40
-10
lines changed

ui/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"@testing-library/user-event": "^7.1.2",
1515
"axios": "^0.19.2",
1616
"firebase": "^8.0.2",
17-
"graphql": "^14.6.0",
1817
"lodash.debounce": "^4.0.8",
1918
"moment": "^2.27.0",
2019
"prismjs": "^1.20.0",
@@ -24,7 +23,6 @@
2423
"react-router-dom": "^5.1.2",
2524
"react-scripts": "3.4.0",
2625
"react-spring": "^8.0.27",
27-
"tailwindcss": "^1.8.4",
2826
"uuid": "^8.0.0",
2927
"vscode-icons-js": "^11.0.0"
3028
},
@@ -52,9 +50,6 @@
5250
]
5351
},
5452
"devDependencies": {
55-
"@pmmmwh/react-refresh-webpack-plugin": "^0.3.3",
56-
"@testing-library/react": "^9.5.0",
57-
"dotenv": "^8.2.0",
58-
"react-refresh": "^0.8.3"
53+
"@testing-library/react": "^9.5.0"
5954
}
6055
}

ui/src/Components/DashBoard/Repository/RepoComponents/RepoDetails/RepoDetailBackdrop/CommitLogComponent.js

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export default function RepositoryCommitLogComponent(props) {
5252
hash
5353
author
5454
commitMessage
55-
commitRelativeTime
5655
commitFilesCount
5756
}
5857
}
@@ -114,7 +113,6 @@ export default function RepositoryCommitLogComponent(props) {
114113
hash
115114
author
116115
commitMessage
117-
commitRelativeTime
118116
commitFilesCount
119117
}
120118
}
@@ -232,7 +230,6 @@ export default function RepositoryCommitLogComponent(props) {
232230
author
233231
commitTime
234232
commitMessage
235-
commitRelativeTime
236233
commitFilesCount
237234
}
238235
}
@@ -342,6 +339,42 @@ export default function RepositoryCommitLogComponent(props) {
342339
);
343340
}
344341

342+
function relativeCommitTimeCalculator(commitTime) {
343+
let commitRelativeTime;
344+
345+
const now = new Date();
346+
const timeDiff = moment.duration(moment(now).diff(commitTime));
347+
348+
const days = Math.floor(timeDiff.asDays());
349+
const hours = Math.floor(timeDiff.asHours());
350+
const minutes = Math.floor(timeDiff.asMinutes());
351+
352+
if (days > 0) {
353+
if (days >= 30) {
354+
const month = Math.floor(timeDiff.asMonths());
355+
commitRelativeTime =
356+
month === 1 ? month + " Month Ago" : month + " Months Ago";
357+
} else if (days >= 365) {
358+
const year = Math.floor(timeDiff.asYears());
359+
commitRelativeTime =
360+
year === 1 ? year + " Year Ago" : year + " Years Ago";
361+
} else {
362+
commitRelativeTime =
363+
days === 1 ? days + " Day Ago" : days + " Days Ago";
364+
}
365+
} else if (hours > 0) {
366+
commitRelativeTime =
367+
hours === 1 ? hours + " Hour Ago" : hours + " Hours Ago";
368+
} else if (minutes > 0) {
369+
commitRelativeTime =
370+
minutes === 1 ? minutes + " Minute Ago" : minutes + " Minutes Ago";
371+
} else {
372+
commitRelativeTime = "recent commit";
373+
}
374+
375+
return commitRelativeTime;
376+
}
377+
345378
return (
346379
<>
347380
{searchbarComponent()}
@@ -355,12 +388,14 @@ export default function RepositoryCommitLogComponent(props) {
355388
author,
356389
commitTime,
357390
commitMessage,
358-
commitRelativeTime,
359391
commitFilesCount,
360392
} = commit;
393+
394+
let commitRelativeTime = relativeCommitTimeCalculator(commitTime);
361395
const formattedCommitTime = moment(new Date(commitTime)).format(
362396
"MMM DD, YYYY"
363397
);
398+
364399
return (
365400
<div
366401
id={`commitLogCard-${hash}`}

0 commit comments

Comments
 (0)