Skip to content

Commit d53d214

Browse files
author
Oleksandr Ratushnyi
committed
Enhance project configuration and components; add new features for likes, views, and analytics integration
1 parent 68377af commit d53d214

File tree

9 files changed

+309
-194
lines changed

9 files changed

+309
-194
lines changed

.claude/settings.local.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"mcp__context7__resolve-library-id",
77
"mcp__context7__query-docs",
88
"Bash(npm install:*)",
9-
"Bash(npm run lint:*)"
9+
"Bash(npm run lint:*)",
10+
"Skill(jira-skill)",
11+
"Bash(python3:*)"
1012
]
1113
}
1214
}

next.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ const nextConfig = {
1010
protocol: "https",
1111
hostname: "react.dev",
1212
},
13+
{
14+
protocol: "https",
15+
hostname: "upstash.com",
16+
},
17+
{
18+
protocol: "https",
19+
hostname: "posthog.com",
20+
},
1321
],
1422
},
1523
};

src/components/LikeButton/LikeButton.module.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
border-radius: 6px;
88
background-color: var(--N0);
99
color: var(--N300);
10-
font-size: 0.875rem;
10+
font-size: 1.2rem;
1111
font-weight: 500;
1212
cursor: pointer;
1313
transition: all 0.15s ease;
@@ -29,8 +29,8 @@
2929
}
3030

3131
.heart {
32-
width: 1rem;
33-
height: 1rem;
32+
width: 1.2rem;
33+
height: 1.2rem;
3434
flex-shrink: 0;
3535
}
3636

Lines changed: 30 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,55 @@
11
.card {
2-
display: flex;
3-
flex-direction: column;
2+
display: inline-flex;
3+
align-items: center;
4+
gap: 0.75rem;
5+
padding: 0.75rem 1rem;
46
border: 1px solid var(--N100);
5-
border-radius: 12px;
6-
overflow: hidden;
7+
border-radius: 8px;
78
text-decoration: none;
89
color: inherit;
9-
transition: border-color 0.2s ease, box-shadow 0.2s ease;
10-
margin: 2.5rem 0;
10+
transition: border-color 0.15s ease, background-color 0.15s ease;
11+
margin: 0.5rem 0;
1112
}
1213

1314
.card:hover {
1415
border-color: var(--N200);
15-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
16-
}
17-
18-
.imageWrapper {
19-
position: relative;
20-
width: 100%;
21-
padding-bottom: 52.5%;
22-
background-color: var(--N50);
16+
background-color: var(--N20);
2317
}
2418

25-
.image {
26-
object-fit: cover;
19+
.favicon {
20+
width: 1.25rem;
21+
height: 1.25rem;
22+
flex-shrink: 0;
23+
border-radius: 4px;
2724
}
2825

2926
.content {
30-
padding: 1.5rem;
27+
display: flex;
28+
flex-direction: column;
29+
gap: 0.125rem;
30+
min-width: 0;
3131
}
3232

3333
.title {
34-
font-size: 1.6rem;
35-
font-weight: 600;
36-
color: var(--N900);
37-
margin: 0 0 0.5rem;
38-
line-height: 1.4;
39-
display: -webkit-box;
40-
-webkit-line-clamp: 2;
41-
-webkit-box-orient: vertical;
42-
overflow: hidden;
43-
}
44-
45-
.description {
46-
font-size: 1.4rem;
47-
color: var(--N600);
48-
margin: 0 0 1rem;
49-
line-height: 1.5;
50-
display: -webkit-box;
51-
-webkit-line-clamp: 2;
52-
-webkit-box-orient: vertical;
34+
font-size: 1rem;
35+
font-weight: 500;
36+
color: var(--N800);
37+
margin: 0;
38+
line-height: 1.3;
39+
white-space: nowrap;
5340
overflow: hidden;
54-
}
55-
56-
.meta {
57-
display: flex;
58-
align-items: center;
59-
gap: 0.5rem;
41+
text-overflow: ellipsis;
6042
}
6143

6244
.domain {
63-
font-size: 1.2rem;
45+
font-size: 0.8rem;
6446
color: var(--N400);
6547
}
6648

6749
.icon {
68-
width: 1.2rem;
69-
height: 1.2rem;
70-
color: var(--N400);
71-
}
72-
73-
@media screen and (min-width: 768px) {
74-
.card {
75-
flex-direction: row;
76-
max-height: 160px;
77-
}
78-
79-
.imageWrapper {
80-
width: 280px;
81-
flex-shrink: 0;
82-
padding-bottom: 0;
83-
height: 100%;
84-
min-height: 160px;
85-
}
86-
87-
.content {
88-
display: flex;
89-
flex-direction: column;
90-
justify-content: center;
91-
padding: 1.5rem 2rem;
92-
}
93-
94-
.title {
95-
font-size: 1.8rem;
96-
}
97-
98-
.description {
99-
-webkit-line-clamp: 3;
100-
}
50+
width: 1rem;
51+
height: 1rem;
52+
color: var(--N300);
53+
flex-shrink: 0;
54+
margin-left: auto;
10155
}
Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import React from "react";
2-
import Image from "next/image";
32
import clsx from "clsx";
43
import { FiExternalLink } from "react-icons/fi";
54
import styles from "./LinkCard.module.css";
65

76
interface ILinkCardProps {
87
href: string;
98
title: string;
10-
description?: string;
11-
image?: string;
129
className?: string;
1310
}
1411

@@ -21,14 +18,22 @@ function getDomain(url: string): string {
2118
}
2219
}
2320

21+
function getFaviconUrl(url: string): string {
22+
try {
23+
const urlObj = new URL(url);
24+
return `https://www.google.com/s2/favicons?domain=${urlObj.hostname}&sz=32`;
25+
} catch {
26+
return "";
27+
}
28+
}
29+
2430
export const LinkCard = function LinkCard({
2531
href,
2632
title,
27-
description,
28-
image,
2933
className,
3034
}: ILinkCardProps) {
3135
const domain = getDomain(href);
36+
const favicon = getFaviconUrl(href);
3237

3338
return (
3439
<a
@@ -37,25 +42,15 @@ export const LinkCard = function LinkCard({
3742
rel="noopener noreferrer"
3843
className={clsx(styles.card, className)}
3944
>
40-
{image && (
41-
<div className={styles.imageWrapper}>
42-
<Image
43-
src={image}
44-
alt={title}
45-
fill
46-
sizes="(max-width: 768px) 100vw, 320px"
47-
className={styles.image}
48-
/>
49-
</div>
45+
{favicon && (
46+
// eslint-disable-next-line @next/next/no-img-element
47+
<img src={favicon} alt="" className={styles.favicon} loading="lazy" />
5048
)}
5149
<div className={styles.content}>
52-
<h4 className={styles.title}>{title}</h4>
53-
{description && <p className={styles.description}>{description}</p>}
54-
<div className={styles.meta}>
55-
<span className={styles.domain}>{domain}</span>
56-
<FiExternalLink className={styles.icon} />
57-
</div>
50+
<span className={styles.title}>{title}</span>
51+
<span className={styles.domain}>{domain}</span>
5852
</div>
53+
<FiExternalLink className={styles.icon} />
5954
</a>
6055
);
6156
};

src/components/ViewCounter/ViewCounter.module.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
align-items: center;
44
gap: 0.375rem;
55
color: var(--N300);
6-
font-size: 0.875rem;
6+
font-size: 1.2rem;
77
font-weight: 500;
88
}
99

1010
.icon {
11-
width: 1rem;
12-
height: 1rem;
11+
width: 1.2rem;
12+
height: 1.2rem;
1313
flex-shrink: 0;
1414
}

0 commit comments

Comments
 (0)