merge: feat/owner-blog-menu(최고관리자 미니블로그 관리 메뉴) 을 main 에 병합
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
3ecd7b3e18
@ -10,6 +10,7 @@ import {
|
||||
ExternalLink,
|
||||
Loader2,
|
||||
MoreHorizontal,
|
||||
Newspaper,
|
||||
Pencil,
|
||||
Plus,
|
||||
Search,
|
||||
@ -20,7 +21,7 @@ import {
|
||||
X,
|
||||
} from 'lucide-react';
|
||||
import {PlaceCategory, publishUrlString, SiteStatus} from '@o2o/shared';
|
||||
import {changeStatus, PublishAction, useListMySites, type MySiteData} from '@/api';
|
||||
import {changeStatus, PublishAction, useListMySites, UserRole, type MySiteData} from '@/api';
|
||||
import {AppShell, EmptyState, PageContainer} from '@/components/layout/AppShell';
|
||||
import {Badge} from '@/components/ui/badge';
|
||||
import {Button} from '@/components/ui/button';
|
||||
@ -28,6 +29,7 @@ import {Input} from '@/components/ui/input';
|
||||
import {notify, notifyApiError} from '@/lib/notify';
|
||||
import {PUBLISH_HOST} from '@/lib/site';
|
||||
import {cn} from '@/lib/utils';
|
||||
import {useAuthStore} from '@/stores/auth';
|
||||
|
||||
// 발행본 주소는 PublishModal·CanvasView 와 같은 규칙이다 — 세 곳이 다른 주소를 말하면 안 된다.
|
||||
|
||||
@ -136,6 +138,7 @@ function SiteThumb({row, Icon}: {row: MySiteData; Icon: typeof Building2}) {
|
||||
/** 내 사이트 — 로그인한 사장님의 홈이다. */
|
||||
export function SitesPage() {
|
||||
const navigate = useNavigate();
|
||||
const canManageBlog = (useAuthStore((s) => s.user?.role) ?? 0) >= UserRole.OWNER;
|
||||
const {data, isLoading, isError, error, refetch} = useListMySites({size: 50});
|
||||
const [busyId, setBusyId] = useState<string | null>(null);
|
||||
const [menuId, setMenuId] = useState<string | null>(null);
|
||||
@ -392,6 +395,19 @@ export function SitesPage() {
|
||||
<Pencil className="size-3.5" />
|
||||
디자인·컨텐츠 관리
|
||||
</button>
|
||||
{canManageBlog && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setMenuId(null);
|
||||
navigate(`/blog?placeId=${row.place_id}`);
|
||||
}}
|
||||
className="flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-muted"
|
||||
>
|
||||
<Newspaper className="size-3.5" />
|
||||
미니블로그 관리
|
||||
</button>
|
||||
)}
|
||||
<div className="my-1 border-t border-border" />
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user