-
Notifications
You must be signed in to change notification settings - Fork 5
[π Bug] μμ± λ‘€λ§νμ΄νΌμ λͺ¨λ¬μ°½μ cl,ul,ol μ λ ¬, κΈμν¬κΈ° λ³κ²½,νλ‘ν λ―Έμ ν μ΄λ―Έμ§ 리μ€νΈμμ μμ #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d7887f3
a3e4e7b
b8e3d7e
33a5e62
945a4fd
7a096a9
1e99cfb
2dcb56f
64cf88c
eaeca19
21f7638
5ab9954
de6922e
4372f08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,10 @@ | ||
| import { cva } from 'class-variance-authority'; | ||
| import DOMPurify from 'dompurify'; | ||
| import { useMemo } from 'react'; | ||
| import Icons from '@/assets/icons/icons'; | ||
| import Button from '@/components/common/button/Button'; | ||
| import PostContent from '@/components/common/modal/PostContent'; | ||
| import AuthorInfo from '@/components/rolling-paper-list/AuthorInfo'; | ||
| import DateText from '@/components/rolling-paper-list/DateText'; | ||
| import { SANITIZE_CONFIG_MESSAGECARD } from '@/constants/sanitizeConfig'; | ||
| import { cn } from '@/utils/style'; | ||
|
|
||
| const textStyle = cva( | ||
| 'font-15-regular sm:font-18-regular line-clamp-2 text-gray-600 sm:line-clamp-3', | ||
| { | ||
| variants: { | ||
| font: { | ||
| Pretendard: 'font-sans', | ||
| 'Noto Sans': 'ff-noto', | ||
| λλλͺ μ‘°: 'ff-nanum-myeongjo', | ||
| 'λλμκΈμ¨ μνΈμ§μ²΄': 'ff-nanum-sonpyeonji', | ||
| }, | ||
| }, | ||
| } | ||
| ); | ||
|
|
||
| /** λ‘€λ§νμ΄νΌ λͺ©λ‘μμ μ¬μ©λλ λ©μμ§ μΉ΄λ μ»΄ν¬λνΈμ λλ€. | ||
| * ν΄λ¦ μ ν΄λΉ λ©μμ§μ μμΈ λͺ¨λ¬μ λμλλ€. | ||
| * @param {object} props | ||
|
|
@@ -48,11 +31,6 @@ const MessageCard = ({ | |
| edit = false, | ||
| onDelete, | ||
| }) => { | ||
| const sanitizedContent = useMemo( | ||
| () => DOMPurify.sanitize(content, SANITIZE_CONFIG_MESSAGECARD), | ||
| [content] | ||
| ); | ||
|
|
||
| const handleKeyDown = (e) => { | ||
| if (e.key === 'Enter' || e.key === ' ') { | ||
| e.preventDefault(); | ||
|
|
@@ -95,12 +73,12 @@ const MessageCard = ({ | |
| <Icons.DeletedIcon /> | ||
| </Button> | ||
| )} | ||
|
|
||
| <div | ||
| className={cn(textStyle({ font }))} | ||
| dangerouslySetInnerHTML={{ __html: sanitizedContent }} | ||
| <PostContent | ||
| htmlContent={content} | ||
| className={'line-clamp-2 sm:line-clamp-3'} | ||
| font={font} | ||
| card | ||
|
Comment on lines
+76
to
+80
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
While using the |
||
| /> | ||
|
|
||
| <DateText className="mt-auto" createdAt={createdAt} /> | ||
| </div> | ||
| ); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λͺ¨λ¬μ΄ λ«ν λ
setTimeoutμ μ¬μ©νλ κ²μ μ λλ©μ΄μ μ΄ μλ£λκΈ° μ μ Portalμ΄ μ κ±°λ μ μλ μ μ¬μ μΈ λ¬Έμ λ₯Ό μΌκΈ°ν μ μμ΅λλ€.setVisible(false)λ₯Ό νΈμΆνκΈ° μ μ μ λλ©μ΄μ μ΄ μλ£λμλμ§ νμΈνλ κ²μ΄ μ’μ΅λλ€. CSS μ λλ©μ΄μ μ΄λ²€νΈλ₯Ό μ¬μ©νμ¬ μ΄λ₯Ό λκΈ°νν μ μμ΅λλ€.Using
setTimeoutwhen the modal closes might cause a potential issue where the Portal is removed before the animation completes. It's recommended to ensure the animation is complete before callingsetVisible(false). You could use CSS animation events to synchronize this.