Skip to content

Commit 52f714b

Browse files
author
Devendra
committed
feat: make first commit linkable and add birthday celebration (Fixes #1436)
Signed-off-by: Devendra <[email protected]>
1 parent 66b7b06 commit 52f714b

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

frontend/app/components/modules/project/components/overview/about-section/about-software-value.vue

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,26 @@ SPDX-License-Identifier: MIT
1414
class="flex flex-col gap-2 text-xs"
1515
>
1616
<div class="text-neutral-400 font-semibold">First commit</div>
17-
<div class="text-neutral-900">
18-
{{ formatFirstCommit(project.firstCommit) }}
17+
<div class="text-neutral-900 flex items-center gap-2">
18+
<a
19+
v-if="project.repositories?.[0]?.url"
20+
:href="project.repositories[0].url"
21+
target="_blank"
22+
rel="noopener noreferrer"
23+
class="hover:underline text-primary-500"
24+
>
25+
{{ formatFirstCommit(project.firstCommit) }}
26+
</a>
27+
<span v-else>
28+
{{ formatFirstCommit(project.firstCommit) }}
29+
</span>
30+
<span
31+
v-if="isBirthday(project.firstCommit)"
32+
class="animate-bounce text-lg cursor-help"
33+
title="Happy Birthday!"
34+
>
35+
🎈
36+
</span>
1937
</div>
2038
</div>
2139
<div class="flex flex-col gap-2 text-xs">
@@ -79,6 +97,12 @@ const formatFirstCommit = (date: string) => {
7997
const dt = DateTime.fromSQL(date);
8098
return dt.toFormat('LLLL yyyy');
8199
};
100+
101+
const isBirthday = (date: string) => {
102+
const dt = DateTime.fromSQL(date);
103+
const now = DateTime.now();
104+
return dt.month === now.month && dt.day === now.day;
105+
};
82106
</script>
83107

84108
<script lang="ts">

0 commit comments

Comments
 (0)