fix(editor): feedback updates
This commit is contained in:
parent
fdbb64d360
commit
130be2567d
@ -1,6 +1,6 @@
|
||||
import FsLightbox from 'fslightbox-react'
|
||||
import { nip19 } from 'nostr-tools'
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import {
|
||||
Link as ReactRouterLink,
|
||||
useLoaderData,
|
||||
@ -37,8 +37,6 @@ import { ReportPopup } from 'components/ReportPopup'
|
||||
import { Spinner } from 'components/Spinner'
|
||||
import { RouterLoadingSpinner } from 'components/LoadingSpinner'
|
||||
import { OriginalAuthor } from 'components/OriginalAuthor'
|
||||
import DOMPurify from 'dompurify'
|
||||
import TurndownService from 'turndown'
|
||||
import { Viewer } from 'components/Markdown/Viewer'
|
||||
|
||||
const MOD_REPORT_REASONS = [
|
||||
@ -451,14 +449,6 @@ const Body = ({
|
||||
const COLLAPSED_MAX_SIZE = 250
|
||||
const postBodyRef = useRef<HTMLDivElement>(null)
|
||||
const viewFullPostBtnRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
const markdown = useMemo(() => {
|
||||
const sanitized = DOMPurify.sanitize(body)
|
||||
const turndown = new TurndownService()
|
||||
turndown.keep(['sup', 'sub'])
|
||||
return turndown.turndown(sanitized)
|
||||
}, [body])
|
||||
|
||||
const [lightBoxController, setLightBoxController] = useState({
|
||||
toggler: false,
|
||||
slide: 1
|
||||
@ -508,7 +498,7 @@ const Body = ({
|
||||
padding: '10px 18px'
|
||||
}}
|
||||
>
|
||||
<Viewer markdown={markdown} />
|
||||
<Viewer markdown={body} />
|
||||
<div ref={viewFullPostBtnRef} className='IBMSMSMBSSPostBodyHide'>
|
||||
<div className='IBMSMSMBSSPostBodyHideText'>
|
||||
<p onClick={viewFullPost}>Read Full</p>
|
||||
|
@ -59,7 +59,7 @@
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: mediumpurple;
|
||||
background-color: #666;
|
||||
border-radius: 0.4rem;
|
||||
color: var(--black);
|
||||
font-size: 0.85rem;
|
||||
@ -92,6 +92,8 @@
|
||||
img {
|
||||
background: #232323;
|
||||
border-radius: 10px;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
.editor {
|
||||
@ -100,10 +102,6 @@
|
||||
min-height: 75px;
|
||||
}
|
||||
.viewer {
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
table {
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
@ -144,7 +142,11 @@
|
||||
}
|
||||
}
|
||||
.mdxeditor {
|
||||
--baseBg: rgba(255, 255, 255, 0.05);
|
||||
--baseBg: #262626;
|
||||
}
|
||||
.mdxeditor-toolbar {
|
||||
top: 10px;
|
||||
border: 1px solid rgb(255, 255, 255, 0.1);
|
||||
}
|
||||
.mdxeditor,
|
||||
.mdxeditor-popup-container {
|
||||
|
Loading…
x
Reference in New Issue
Block a user