Skip to content

Commit

Permalink
feat: 태그 줄바꿈 안되게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
astorverse committed Feb 2, 2025
1 parent eaf36ed commit d516da8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/components/Card/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ const ProjectCard: React.FC<ProjectEntry> = props => {
};

const handleClick = (e: React.MouseEvent) => {
// 태그 영역 클릭 시 이벤트 중단
if ((e.target as HTMLElement).closest(".tags-scroll")) {
e.preventDefault();
return;
}

// 데스크톱에서는 바로 이동
if (window.matchMedia("(min-width: 768px)").matches) {
return;
Expand Down Expand Up @@ -152,15 +158,17 @@ const ProjectCard: React.FC<ProjectEntry> = props => {
<p className="line-clamp-2 text-sm font-medium uppercase tracking-wider text-black-base">
{isLoading ? <Skeleton count={2} /> : props.data.shortDescription}
</p>
<div className="flex flex-wrap gap-2">
{props.data.roles.map((role, idx) => (
<span
key={idx}
className="inline-flex items-center rounded-full bg-skin-accent/10 px-2.5 py-0.5 text-xs font-medium text-skin-accent"
>
{isLoading ? <Skeleton width={40} height={16} /> : role}
</span>
))}
<div className="tags-scroll relative -mx-4 px-4 lg:-mx-5 lg:px-5">
<div className="hide-scrollbar flex overflow-x-scroll">
{props.data.roles.map((role, idx) => (
<span
key={idx}
className="mr-2 inline-flex shrink-0 items-center whitespace-nowrap rounded-full bg-skin-accent/10 px-2.5 py-0.5 text-xs font-medium text-skin-accent last:mr-0"
>
{isLoading ? <Skeleton width={40} height={16} /> : role}
</span>
))}
</div>
</div>
</div>
<div
Expand Down
10 changes: 10 additions & 0 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ html[data-theme="light"] {
table {
@apply overflow-hidden rounded-lg;
}

/* 스크롤바 숨기기 */
.hide-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}

.hide-scrollbar::-webkit-scrollbar {
display: none; /* Chrome, Safari, Opera */
}
}

@layer components {
Expand Down

0 comments on commit d516da8

Please sign in to comment.