feat(18-05): add public profile page and setup visibility toggle
- Create public profile page at /users/$userId with avatar, name, bio, setups - Create PublicSetupCard component for profile page setup listing - Add isPublic toggle button on setup detail page - Add Public badge to SetupCard in list view - Update useSetups hook with isPublic field on interfaces
This commit is contained in:
@@ -4,6 +4,7 @@ import { useFormatters } from "../hooks/useFormatters";
|
||||
interface SetupCardProps {
|
||||
id: number;
|
||||
name: string;
|
||||
isPublic?: boolean;
|
||||
itemCount: number;
|
||||
totalWeight: number;
|
||||
totalCost: number;
|
||||
@@ -12,6 +13,7 @@ interface SetupCardProps {
|
||||
export function SetupCard({
|
||||
id,
|
||||
name,
|
||||
isPublic,
|
||||
itemCount,
|
||||
totalWeight,
|
||||
totalCost,
|
||||
@@ -24,7 +26,16 @@ export function SetupCard({
|
||||
className="block w-full text-left bg-white rounded-xl border border-gray-100 hover:border-gray-200 hover:shadow-md transition-all p-4"
|
||||
>
|
||||
<div className="flex items-start justify-between mb-3">
|
||||
<h3 className="text-sm font-semibold text-gray-900 truncate">{name}</h3>
|
||||
<div className="flex items-center gap-1.5 min-w-0">
|
||||
<h3 className="text-sm font-semibold text-gray-900 truncate">
|
||||
{name}
|
||||
</h3>
|
||||
{isPublic && (
|
||||
<span className="inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-medium bg-green-50 text-green-600 shrink-0">
|
||||
Public
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<span className="ml-2 inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-blue-50 text-blue-400 shrink-0">
|
||||
{itemCount} {itemCount === 1 ? "item" : "items"}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user