@@ -10,13 +10,14 @@ import ExpandableText from "@/components/archive-detail/ExpandableText";
1010import ImageSwiper from "@/components/archive-detail/ImageSwiper" ;
1111import NicknameCard from "@/components/archive-detail/NicknameCard" ;
1212import SizeText from "@/components/archive-detail/SizeText" ;
13+ import ArchiveTypeBadge from "@/components/common/ArchiveTypeBadge" ;
14+ import BottomActionButton from "@/components/common/BottomActionButton" ;
1315import { useCreateChatRoom } from "@/hooks/useCreateChatRoom" ;
16+ import { useMyRole } from "@/hooks/useMyRole" ;
1417import { ApiError } from "@/services/apiClient" ;
1518import { getMySpaceDetail , getSpaceDetail } from "@/services/spaces" ;
1619import { useAuthStore } from "@/stores/useAuthStore" ;
1720import { normalizeImageUrl } from "@/utils/normalizeImageUrl" ;
18- import BottomActionButton from "@/components/common/BottomActionButton" ;
19- import ArchiveTypeBadge from "@/components/common/ArchiveTypeBadge" ;
2021
2122function hasText ( value ?: string | null ) {
2223 return Boolean ( value ?. trim ( ) ) ;
@@ -36,8 +37,13 @@ export default function SpaceDetailPage() {
3637 const spaceId = params . id ;
3738 const createChatRoom = useCreateChatRoom ( ) ;
3839 const accessToken = useAuthStore ( state => state . accessToken ) ;
40+ const { role, isLoggedIn } = useMyRole ( ) ;
3941 const [ inquiryErrorMessage , setInquiryErrorMessage ] = useState < string | null > ( null ) ;
4042
43+ // 공간 전시 문의는 크리에이터(CREATOR)만 가능. 공간주끼리 문의 차단.
44+ // 비로그인 시에는 노출하고 클릭 시 로그인 페이지로 유도한다.
45+ const canInquire = ! isLoggedIn || role === "CREATOR" ;
46+
4147 const query = useQuery ( {
4248 queryKey : [ "space-detail" , spaceId , Boolean ( accessToken ) ] ,
4349 queryFn : async ( { signal } ) => {
@@ -155,13 +161,15 @@ export default function SpaceDetailPage() {
155161 ) }
156162 </ div >
157163
158- < BottomActionButton
159- text = "전시 문의하기"
160- loadingText = "이동 중..."
161- isPending = { createChatRoom . isPending }
162- errorMessage = { inquiryErrorMessage }
163- onClick = { handleInquiryClick }
164- />
164+ { canInquire && (
165+ < BottomActionButton
166+ text = "전시 문의하기"
167+ loadingText = "이동 중..."
168+ isPending = { createChatRoom . isPending }
169+ errorMessage = { inquiryErrorMessage }
170+ onClick = { handleInquiryClick }
171+ />
172+ ) }
165173 </ >
166174 ) }
167175 </ div >
0 commit comments