Skip to content

Commit 1dc88c6

Browse files
committed
style: enhance hashtag section layout and add scrollbar styling in MetaDataForm component
1 parent f009c6a commit 1dc88c6

2 files changed

Lines changed: 30 additions & 17 deletions

File tree

app/styles/globals.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,13 @@ body {
6464
.remove-scrollbar::-webkit-scrollbar {
6565
display: none;
6666
}
67+
68+
.small-scrollbar::-webkit-scrollbar {
69+
width: 5px;
70+
margin-left: 2px;
71+
}
72+
73+
.small-scrollbar::-webkit-scrollbar-track {
74+
border-radius: 5px;
75+
background: $scrollbar-track-color;
76+
}

components/PostEditor/desktop/MetaDataForm.tsx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,15 @@ export default function MetaDataForm({
242242
/>
243243
</div>
244244
{/* Hashtag Section */}
245-
<div className="flex flex-col gap-2 mt-10">
246-
<label className="font-semibold text-gray-700 text-lg">
245+
<div className="flex flex-col gap-2 mt-12">
246+
<label className="font-semibold text-gray-700 text-lg" htmlFor="tagInput">
247247
Hashtag
248248
</label>
249249

250250
{/* Tag Input */}
251251
<div className="flex gap-2">
252252
<input
253+
id="tagInput"
253254
minLength={2}
254255
maxLength={20}
255256
type="text"
@@ -270,22 +271,24 @@ export default function MetaDataForm({
270271

271272
{/* Tags Display */}
272273
{tags.length > 0 && (
273-
<div className="flex flex-wrap gap-2 mb-2">
274-
{tags.map((tag, index) => (
275-
<span
276-
key={index}
277-
className="inline-flex items-center gap-1 bg-blue-100 text-blue-600 px-3 py-1 rounded-full text-sm"
278-
>
279-
#{tag}
280-
<button
281-
onClick={() => handleRemoveTag(tag)}
282-
className="hover:bg-blue-200 rounded-full w-4 h-4 flex items-center justify-center transition-colors"
283-
type="button"
274+
<div className="max-h-[12rem] small-scrollbar flex overflow-auto">
275+
<div className="flex flex-wrap gap-2">
276+
{tags.map((tag, index) => (
277+
<span
278+
key={index}
279+
className="inline-flex items-center gap-1 bg-blue-100 text-blue-600 px-3 py-1 rounded-full text-sm h-[1.5rem]"
284280
>
285-
×
286-
</button>
287-
</span>
288-
))}
281+
#{tag}
282+
<button
283+
onClick={() => handleRemoveTag(tag)}
284+
className="hover:bg-blue-200 rounded-full w-4 h-4 flex items-center justify-center transition-colors"
285+
type="button"
286+
>
287+
×
288+
</button>
289+
</span>
290+
))}
291+
</div>
289292
</div>
290293
)}
291294
</div>

0 commit comments

Comments
 (0)