forked from Shiloh/remnantchat
feat(syntax-hightlighting): lazy load language files
This commit is contained in:
parent
d3630e082e
commit
ff988d9da5
@ -4,7 +4,6 @@ import Box from '@mui/material/Box'
|
||||
import Tooltip from '@mui/material/Tooltip'
|
||||
import Typography, { TypographyProps } from '@mui/material/Typography'
|
||||
import Link, { LinkProps } from '@mui/material/Link'
|
||||
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'
|
||||
import { materialDark } from 'react-syntax-highlighter/dist/esm/styles/prism'
|
||||
|
||||
// These imports need to be ts-ignored to prevent spurious errors that look
|
||||
@ -29,6 +28,8 @@ import {
|
||||
} from 'models/chat'
|
||||
import { PeerNameDisplay } from 'components/PeerNameDisplay'
|
||||
|
||||
import { SyntaxHighlighter } from '../../components/SyntaxHighlighter'
|
||||
|
||||
import { InlineMedia } from './InlineMedia'
|
||||
import './Message.sass'
|
||||
|
||||
|
3
src/components/SyntaxHighlighter/SyntaxHighlighter.tsx
Normal file
3
src/components/SyntaxHighlighter/SyntaxHighlighter.tsx
Normal file
@ -0,0 +1,3 @@
|
||||
import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter'
|
||||
|
||||
export { SyntaxHighlighter }
|
1
src/components/SyntaxHighlighter/index.ts
Normal file
1
src/components/SyntaxHighlighter/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './SyntaxHighlighter'
|
@ -1,12 +1,13 @@
|
||||
import Button from '@mui/material/Button'
|
||||
import Dialog from '@mui/material/Dialog'
|
||||
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'
|
||||
import { materialDark } from 'react-syntax-highlighter/dist/esm/styles/prism'
|
||||
import DialogActions from '@mui/material/DialogActions'
|
||||
import DialogContent from '@mui/material/DialogContent'
|
||||
import DialogContentText from '@mui/material/DialogContentText'
|
||||
import DialogTitle from '@mui/material/DialogTitle'
|
||||
|
||||
import { SyntaxHighlighter } from '../../components/SyntaxHighlighter'
|
||||
|
||||
interface EmbedCodeDialogProps {
|
||||
showEmbedCode: boolean
|
||||
handleEmbedCodeWindowClose: () => void
|
||||
|
Loading…
Reference in New Issue
Block a user