Skip to content

Commit

Permalink
chore: MultilineText에 text wrap 속성 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
chysis committed Aug 14, 2024
1 parent d7b66cf commit cd65d5a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion frontend/src/components/AnswerListRecheckModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Fragment } from 'react';

import { MultilineTextViewer } from '@/components';
import { ReviewWritingAnswer, ReviewWritingCardSection } from '@/types';

import CheckboxItem from '../common/CheckboxItem';
Expand Down Expand Up @@ -54,7 +55,9 @@ const AnswerListRecheckModal = ({ questionSectionList, answerMap, closeModal }:
))}
</div>
)}
<div>{question.questionType === 'TEXT' && <div>{findTextAnswer(question.questionId)}</div>}</div>
{question.questionType === 'TEXT' && (
<MultilineTextViewer text={findTextAnswer(question.questionId) || ''} />
)}
</S.ContentContainer>
</Fragment>
))}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/common/MultilineTextViewer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as S from './styles';

interface MultilineTextViewerProps {
text: string;
Expand All @@ -8,10 +8,10 @@ const MultilineTextViewer = ({ text }: MultilineTextViewerProps) => {
return (
<>
{text.split('\n').map((line, index) => (
<React.Fragment key={index}>
<S.MultilineText key={index}>
{line}
<br />
</React.Fragment>
</S.MultilineText>
))}
</>
);
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/components/common/MultilineTextViewer/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import styled from '@emotion/styled';

export const MultilineText = styled.div`
word-wrap: break-word;
`;

0 comments on commit cd65d5a

Please sign in to comment.