Skip to content

Commit 9e1b4b6

Browse files
authored
feat(fe): show settings button only for host users (#198)
feat: show settings button only for host users in QuestionList component
1 parent 4e6b88d commit 9e1b4b6

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

apps/client/src/components/qna/QuestionList.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import QuestionSection from '@/components/qna/QuestionSection';
1515
import SessionSettingsDropdown from '@/components/qna/SessionSettingsDropdown';
1616

1717
function QuestionList() {
18-
const { sessionTitle, expired, questions, setSelectedQuestionId } =
18+
const { sessionTitle, expired, isHost, questions, setSelectedQuestionId } =
1919
useSessionStore();
2020

2121
const { Modal: CreateQuestion, openModal: openCreateQuestionModal } =
@@ -82,12 +82,14 @@ function QuestionList() {
8282
{!expired && (
8383
<div className='flex flex-row gap-2'>
8484
<div className='relative'>
85-
<Button
86-
className='hover:bg-gray-200 hover:transition-all'
87-
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
88-
>
89-
<p className='text-sm font-bold text-black'>설정</p>
90-
</Button>
85+
{isHost && (
86+
<Button
87+
className='hover:bg-gray-200 hover:transition-all'
88+
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
89+
>
90+
<p className='text-sm font-bold text-black'>설정</p>
91+
</Button>
92+
)}
9193
{isDropdownOpen && (
9294
<SessionSettingsDropdown
9395
buttons={sessionButtons}

0 commit comments

Comments
 (0)