[feat] solution/frontend: 최고관리자 이상은 내 사이트 더보기에 미니블로그 관리 — 일반 사장님에게는 숨김
어제 더보기에서 미니블로그 관리를 통째로 뺐더니 최고관리자도 들어갈 길이 사이트관리 화면뿐이었다. - SitesPage: role >= OWNER 일 때만 더보기에 미니블로그 관리(/blog?placeId=) frontend tsc·eslint 통과 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
66908cb5c6
commit
654fb51456
@ -10,6 +10,7 @@ import {
|
|||||||
ExternalLink,
|
ExternalLink,
|
||||||
Loader2,
|
Loader2,
|
||||||
MoreHorizontal,
|
MoreHorizontal,
|
||||||
|
Newspaper,
|
||||||
Pencil,
|
Pencil,
|
||||||
Plus,
|
Plus,
|
||||||
Search,
|
Search,
|
||||||
@ -20,7 +21,7 @@ import {
|
|||||||
X,
|
X,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import {PlaceCategory, publishUrlString, SiteStatus} from '@o2o/shared';
|
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 {AppShell, EmptyState, PageContainer} from '@/components/layout/AppShell';
|
||||||
import {Badge} from '@/components/ui/badge';
|
import {Badge} from '@/components/ui/badge';
|
||||||
import {Button} from '@/components/ui/button';
|
import {Button} from '@/components/ui/button';
|
||||||
@ -28,6 +29,7 @@ import {Input} from '@/components/ui/input';
|
|||||||
import {notify, notifyApiError} from '@/lib/notify';
|
import {notify, notifyApiError} from '@/lib/notify';
|
||||||
import {PUBLISH_HOST} from '@/lib/site';
|
import {PUBLISH_HOST} from '@/lib/site';
|
||||||
import {cn} from '@/lib/utils';
|
import {cn} from '@/lib/utils';
|
||||||
|
import {useAuthStore} from '@/stores/auth';
|
||||||
|
|
||||||
// 발행본 주소는 PublishModal·CanvasView 와 같은 규칙이다 — 세 곳이 다른 주소를 말하면 안 된다.
|
// 발행본 주소는 PublishModal·CanvasView 와 같은 규칙이다 — 세 곳이 다른 주소를 말하면 안 된다.
|
||||||
|
|
||||||
@ -136,6 +138,7 @@ function SiteThumb({row, Icon}: {row: MySiteData; Icon: typeof Building2}) {
|
|||||||
/** 내 사이트 — 로그인한 사장님의 홈이다. */
|
/** 내 사이트 — 로그인한 사장님의 홈이다. */
|
||||||
export function SitesPage() {
|
export function SitesPage() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const canManageBlog = (useAuthStore((s) => s.user?.role) ?? 0) >= UserRole.OWNER;
|
||||||
const {data, isLoading, isError, error, refetch} = useListMySites({size: 50});
|
const {data, isLoading, isError, error, refetch} = useListMySites({size: 50});
|
||||||
const [busyId, setBusyId] = useState<string | null>(null);
|
const [busyId, setBusyId] = useState<string | null>(null);
|
||||||
const [menuId, setMenuId] = useState<string | null>(null);
|
const [menuId, setMenuId] = useState<string | null>(null);
|
||||||
@ -392,6 +395,19 @@ export function SitesPage() {
|
|||||||
<Pencil className="size-3.5" />
|
<Pencil className="size-3.5" />
|
||||||
디자인·컨텐츠 관리
|
디자인·컨텐츠 관리
|
||||||
</button>
|
</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" />
|
<div className="my-1 border-t border-border" />
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user