Skip to content

Commit

Permalink
(#72) ๐ŸŽจ design: ๋ฃจํ‚ค new line ๋ฐ˜์˜ ๋งํ’์„  pre tag ๋Œ€์‹ ์— css ๋ฐฉ์‹์œผ๋กœ ๋ณ€๊ฒฝ
Browse files Browse the repository at this point in the history
  • Loading branch information
inaemon committed Nov 27, 2024
1 parent 32f8783 commit 7a50d83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ interface Props {
messageList: string[]
}

// ์ฑ—๋ด‡ ๋งํ’์„  ์ปดํฌ๋„ŒํŠธ ํƒ€์ž…3. /n(new line) ๋“ฑ์ด ๋ฐ˜์˜๋˜๋„๋ก <pre> ํƒœ๊ทธ๋กœ ๊ฐ์‹ผ ๋งํ’์„ 
const RookieMessage = ({messageList}: Props) => {
// ์ฑ—๋ด‡ ์ปค์Šคํ…€ ๋งํ’์„  ์ปดํฌ๋„ŒํŠธ
// /n(new line) ๋“ฑ์ด ๋ฐ˜์˜๋˜๋„๋ก whitespace-pre-wrap ์Šคํƒ€์ผ ์ ์šฉํ•œ ๋งํ’์„ 
const RookiePreformattedMessage = ({messageList}: Props) => {
return (
<div className="bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 max-w-xs">
<div className="whitespace-pre-wrap bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 max-w-xs">
{/** ๋ฉ”์‹œ์ง€ 1์ค„ ์ด์ƒ ๋ฐฐ์—ด๋กœ ๋ฐ›์•„์„œ ์—ฌ๋Ÿฌ pํƒœ๊ทธ๋กœ ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅํ•˜๊ธฐ */}
{messageList.map((message, index) => (
<pre>
<p key={index}>{message}</p>
</pre>
<p key={index}>{message}</p>
))}
</div>
);
};

export default RookieMessage;
export default RookiePreformattedMessage;

0 comments on commit 7a50d83

Please sign in to comment.