mirror of
https://github.com/plebbit/seedit.git
synced 2026-02-15 00:11:10 -05:00
feat(subplebbit settings): add markdown preview for description
This commit is contained in:
@@ -65,6 +65,15 @@
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.descriptionMarkdownPreviewTitle {
|
||||
margin: 10px 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.descriptionPreview {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.readOnlyRoleExclude {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import styles from './subplebbit-settings.module.css';
|
||||
import { isValidURL } from '../../../lib/utils/url-utils';
|
||||
import { OptionInput, Exclude, getDefaultChallengeDescription, getDefaultChallengeOptions, getDefaultChallengeSettings } from '../../../lib/utils/challenge-utils';
|
||||
import LoadingEllipsis from '../../../components/loading-ellipsis';
|
||||
import Markdown from '../../../components/markdown';
|
||||
import Sidebar from '../../../components/sidebar';
|
||||
import { isCreateSubplebbitView, isSubplebbitSettingsView } from '../../../lib/utils/view-utils';
|
||||
|
||||
@@ -112,7 +113,17 @@ const Description = ({ isReadOnly = false }: { isReadOnly?: boolean }) => {
|
||||
{isReadOnly ? (
|
||||
<pre className={styles.readOnlyDescription}>{description}</pre>
|
||||
) : (
|
||||
<textarea value={description ?? ''} onChange={(e) => setSubplebbitSettingsStore({ description: e.target.value })} />
|
||||
<>
|
||||
<textarea value={description ?? ''} onChange={(e) => setSubplebbitSettingsStore({ description: e.target.value })} />
|
||||
<div className={styles.descriptionPreview}>
|
||||
{description && (
|
||||
<>
|
||||
<div className={styles.descriptionMarkdownPreviewTitle}>Markdown Preview:</div>
|
||||
<Markdown content={description} />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user