기존: user.role === "USER" 일 때 숨김 → 거래처라도 role 필드 비어있으면 노출되는 버그 변경: user.isAdmin === true || role === "ADMIN" 일 때만 노출 → 그 외는 모두 숨김 admin 계정만 거래명세표 이미지 공유 가능. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -240,7 +240,8 @@ function DetailModal({ order, items, supplier, onClose, onCancel, onReload }: {
|
||||
};
|
||||
|
||||
const user = useAuthStore((s) => s.user);
|
||||
const isUserRole = user?.role === "USER";
|
||||
// 이미지 공유 버튼은 관리자(admin) 한해서만 노출. 일반 사용자(거래처) 화면에서는 숨김.
|
||||
const showImageShare = user?.isAdmin === true || user?.role === "ADMIN";
|
||||
|
||||
const captureAndShare = async () => {
|
||||
if (!ref.current) return;
|
||||
@@ -258,7 +259,7 @@ function DetailModal({ order, items, supplier, onClose, onCancel, onReload }: {
|
||||
<div className="bg-white rounded-xl shadow-xl max-w-3xl w-full max-h-[92vh] overflow-y-auto p-5" onClick={(e) => e.stopPropagation()}>
|
||||
<div className="flex justify-between items-center mb-3 print:hidden">
|
||||
<div className="flex gap-2">
|
||||
{!isUserRole && (
|
||||
{showImageShare && (
|
||||
<button onClick={captureAndShare}
|
||||
className="inline-flex items-center gap-1 h-9 px-3 rounded-lg bg-amber-100 text-amber-800 text-xs font-bold hover:bg-amber-200">
|
||||
<ImageIcon size={14} /> 이미지 공유
|
||||
|
||||
Reference in New Issue
Block a user