Skip to content

Commit

Permalink
Merge pull request #1595 from woowacourse/feature/1594-guest-fix
Browse files Browse the repository at this point in the history
게스트 회원은 로드맵 답변을 쓸 수 없다
  • Loading branch information
WaiNaat authored Oct 11, 2023
2 parents a2e4000 + a5caa80 commit aa035e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ const KeywordDetailSideSheet = ({
}: KeywordDetailSideSheetProps) => {
const { name, keywordId, description, recommendedPosts } = keywordDetail;

const { user: { isLoggedIn } } = useContext(UserContext);
const { user: { isLoggedIn, role } } = useContext(UserContext);
const { quizList } = useGetQuizListByKeyword({ keywordId });

const isAuthorized = isLoggedIn && role !== 'GUEST';

return (
<SideSheet onClickBackdrop={handleCloseSideSheet}>
<Styled.Root>
Expand All @@ -32,10 +34,10 @@ const KeywordDetailSideSheet = ({
<ol>
{quizList?.map(({ quizId, question }, index) => (
<li key={quizId}>
{isLoggedIn && (
{isAuthorized && (
<a href={`/quizzes/${quizId}/essay-answers/form`}>{index + 1}. {question}</a>
)}
{!isLoggedIn && (
{!isAuthorized && (
<>{index + 1}. {question}</>
)}
&nbsp;/&nbsp;
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/pages/RoadmapPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const RoadmapPage = () => {
<RoadmapStyles />
<Styled.Main>
<section>
<Styled.Title>커리큘럼</Styled.Title>
<Styled.Title>로드맵</Styled.Title>
<Styled.CurriculumButtonList>
{curriculums?.map((curriculum) => (
<ResponsiveButton
Expand All @@ -71,8 +71,6 @@ const RoadmapPage = () => {
</section>

<section style={{ marginBottom: '4rem' }}>
<Styled.Title>로드맵!!</Styled.Title>

<ImportanceLegend />

<Styled.RoadmapContainer>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/RoadmapPage/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const Main = styled.main`
display: flex;
flex-direction: column;
gap: 30px;
width: 100%;
max-width: 112rem;
overflow-x: hidden;
padding: 0 4rem;
Expand Down

0 comments on commit aa035e7

Please sign in to comment.