Skip to content

Commit

Permalink
Merge pull request #27 from sora32127/fix_misc
Browse files Browse the repository at this point in the history
見た目の改修を行った
  • Loading branch information
sora32127 authored Apr 23, 2024
2 parents bf41428 + b94b1e8 commit 52bcb6c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions app/components/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export default function PostCard({
return 0;
});

const displayedTags = tagNames.slice(0, 5);
const hiddenTagsCount = tagNames.length - displayedTags.length;

return (
<div className="bg-base-100 border-2 rounded-lg p-4 mb-4">
<div className="flex justify-between items-center mb-2">
Expand All @@ -60,11 +63,16 @@ export default function PostCard({
<div className="grid grid-cols-[auto_1fr] gap-2 mt-2 items-center">
<TagIcon/>
<div className="flex flex-wrap items-center">
{tagNames && tagNames.map((tag, index) => (
<span key={index} className="inline-block text-sm font-semibold mr-1 mb-1">
{displayedTags.map((tag, index) => (
<span key={index} className="inline-block mr-1 mb-1">
<TagCard tagName={tag} />
</span>
))}
{hiddenTagsCount > 0 && (
<span className="inline-block text-base-content">
(+{hiddenTagsCount}タグ)
</span>
)}
</div>
</div>
<div className="flex items-center mt-2">
Expand Down
2 changes: 1 addition & 1 deletion app/components/TagCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function TagCard({
}: TagCardProps) {
return (
<div className="rounded-md p-0.5 mb-0.5">
<NavLink to={`/tags/${tagName}`} className="text-lg font-bold text-info underline underline-offset-4 post-tag">{tagName}</NavLink>
<NavLink to={`/tags/${tagName}`} className="text-xs text-info underline underline-offset-4 post-tag">{tagName}</NavLink>
</div>
);
}
2 changes: 1 addition & 1 deletion app/routes/_layout.archives.$postId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export async function loader({ request }:LoaderFunctionArgs){
const { data, error } = await supabase.rpc("search_similar_content", {
query_post_id: Number(postId),
match_threshold: 0,
match_count: 10,
match_count: 16,
});

let similarPosts = [];
Expand Down

1 comment on commit 52bcb6c

@vercel
Copy link

@vercel vercel bot commented on 52bcb6c Apr 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.