Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions .github/labeler.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/labels.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:

- run: pnpm typecheck
- run: pnpm lint
- run: pnpm test:ci

- run: pnpm build

17 changes: 0 additions & 17 deletions .github/workflows/labeler.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/labels-sync.yml

This file was deleted.

4 changes: 2 additions & 2 deletions src/app/(layout)/(shell)/_components/layout/SiteHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ export default function SiteHeader() {
"min-w-46 cursor-pointer ",
"hidden items-center gap-2 rounded-full",
"bg-neutral-200/50 ",
"dark:border dark:border-foreground/15 dark:bg-background/40 pl-3 pr-2 py-1.5",
"dark:border dark:border-foreground/15 dark:bg-foreground/7 pl-3 pr-2 py-1",
"text-xs text-foreground/70 md:inline-flex"
)}
>
<Search className="h-4 w-4" />
<div className=" flex justify-between items-center w-full">
<span className="hidden lg:inline">검색</span>
<span className="hidden lg:inline dark:bg-gray-400/20 py-1 px-2.5 rounded-3xl text-[10px]">
<span className="hidden lg:inline py-1 pl-2.5 pr-2 rounded-3xl text-[10px]">
⌘K
</span>
</div>
Expand Down
10 changes: 7 additions & 3 deletions src/app/(layout)/posts/[slug]/_components/PostActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,31 @@ interface PostActionsProps {
variant?: "desktop" | "mobile";
title: string;
thumbnail?: string;
post: {
slug: string
};
}

export default function PostActions({
post,
variant = "desktop",
title,
thumbnail,
}: PostActionsProps) {
if (variant === "mobile") {
return (
<aside className="flex gap-2">
<LikeButton />
<LikeButton postId={post.slug} />
<ShareButton title={title} thumbnail={thumbnail} />
</aside>
);
}

return (
<aside>
<div className="flex flex-col items-center gap-3 rounded-full bg-neutral-200/50 px-2 py-3 dark:bg-[#1f2441] border border-gray-400/20 dark:border-white/20">
<div className="flex flex-col items-center gap-3 rounded-full bg-neutral-100 px-2 py-3 dark:bg-[#1f2441] border border-gray-400/20 dark:border-white/20">
<ShareButton title={title} thumbnail={thumbnail} />
<LikeButton />
<LikeButton postId={post.slug} />
</div>
</aside>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,50 +1,56 @@
"use client";

import { usePostLike } from "@/hooks/usePostLike";
import clsx from "clsx";
import { Heart } from "lucide-react";
import { useState } from "react";

export default function LikeButton() {
const [isLiked, setIsLiked] = useState(false);
const [likeCount] = useState(0);
const [isPopping, setIsPopping] = useState(false);
interface PostLikeButtonProps {
postId: string;
}

const handleClick = () => {
setIsLiked((v) => !v);
export default function LikeButton({ postId }: PostLikeButtonProps) {
const { count, liked, loading, toggleLike } = usePostLike(postId);

const [isPopping, setIsPopping] = useState(false);

const handleClick = async () => {
await toggleLike();
setIsPopping(true);
window.setTimeout(() => setIsPopping(false), 180);
};

return (
<button
type="button"
disabled={loading}
onClick={handleClick}
aria-label="좋아요"
aria-pressed={liked}
className="group flex flex-col items-center gap-1 cursor-pointer"
>
<span
className={clsx(
"flex h-9 w-9 items-center justify-center rounded-full border transition-colors",
"border-neutral-400/40 bg-neutral-100",
"border-neutral-400/40 bg-background ",
"group-hover:border-accent/50",
"dark:bg-[#1f2441]/10 dark:border-neutral-600",
isLiked && "border-accent dark:bg-accent/10"
liked && "border-accent dark:bg-accent/10"
)}
>
<Heart
className={clsx(
"h-4 w-4 transition-colors",
"motion-safe:transition-transform motion-safe:duration-150 motion-safe:ease-out",
isPopping && "scale-125",
isLiked
liked
? "fill-accent text-accent"
: "text-neutral-600 group-hover:text-accent dark:text-neutral-300",
: "text-neutral-600 group-hover:text-accent dark:text-neutral-300"
)}
/>
</span>

<span className="text-[10px] font-medium text-neutral-700 dark:text-neutral-300">
{likeCount}
{count}
</span>
</button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function ShareButton({ title, thumbnail }: ShareButtonProps) {
<span
className={clsx(
"flex h-9 w-9 items-center justify-center rounded-full border transition-colors",
"border-neutral-400/40 bg-neutral-100",
"border-neutral-400/40 bg-background",
"group-hover:border-blue-400/50",
"dark:bg-[#1f2441]/10 dark:border-neutral-600"
)}
Expand Down
2 changes: 1 addition & 1 deletion src/app/(layout)/posts/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default async function PostPage({ params }: PageProps) {

<aside className="hidden xl:block">
<div className="sticky top-40">
<PostActions title={post.title} thumbnail={post.thumbnail} />
<PostActions title={post.title} thumbnail={post.thumbnail} post={post} />
</div>
</aside>

Expand Down
Loading
Loading