Skip to content

Commit

Permalink
Add Markdown preview to SupportAdd page
Browse files Browse the repository at this point in the history
  • Loading branch information
symysak committed May 6, 2023
1 parent f495e1a commit b3bb3f8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/pages/Support/SupportAddDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { useSnackbar } from 'notistack'
import { Post } from '../../api/Support'
import { Get } from '../../api/Info'
import { StyledTextFieldVeryLong } from '../../style'
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'

export function SupportAddDialog(props: { groupEnable: boolean }) {
const { groupEnable } = props
Expand Down Expand Up @@ -124,6 +126,16 @@ export function SupportAddDialog(props: { groupEnable: boolean }) {
variant="outlined"
/>
</Grid>
<Grid item xs={12}>
<h3>内容のプレビュー ↓</h3>
<ReactMarkdown
skipHtml={true}
remarkPlugins={[remarkGfm]}
>
{data.data}
</ReactMarkdown>
内容のプレビュー ↑
</Grid>
</Grid>
</DialogContent>
<DialogActions>
Expand Down

0 comments on commit b3bb3f8

Please sign in to comment.