Skip to content

Commit 83b3e9d

Browse files
committed
perf: videos
1 parent 325c9b4 commit 83b3e9d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/components/mdRender/MDRender.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import ReactMarkdown from 'react-markdown';
22
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
3-
import { vs, vsDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
3+
import {
4+
vs,
5+
vscDarkPlus,
6+
} from 'react-syntax-highlighter/dist/cjs/styles/prism';
47
import remarkGfm from 'remark-gfm';
58

69
import clsxm from '@/lib/clsxm';
@@ -26,7 +29,7 @@ export const CodeRender = ({ code, lanuage }: CodeProps) => {
2629
);
2730
} else {
2831
return (
29-
<SyntaxHighlighter style={vsDark} language={lanuage} PreTag='div'>
32+
<SyntaxHighlighter style={vscDarkPlus} language={lanuage} PreTag='div'>
3033
{code}
3134
</SyntaxHighlighter>
3235
);
@@ -68,7 +71,7 @@ export const MDRender = ({
6871
if (match) {
6972
return (
7073
<SyntaxHighlighter
71-
style={theme !== 'dark' ? vs : vsDark}
74+
style={theme !== 'dark' ? vs : vscDarkPlus}
7275
language={match[1]}
7376
PreTag='pre'
7477
>

src/components/respository/Tabs.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ const Tabs = ({ repo, t, i18n_lang }: RepositoryProps) => {
8989
{repo.video_url && (
9090
<div className='aspect-video w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-700'>
9191
<iframe
92-
src={`${repo.video_url}${
93-
repo.video_url.includes('?') ? '&' : '?'
94-
}autoplay=0`}
92+
src={`${repo.video_url}&autoplay=0&poster=true`}
9593
className='h-full w-full'
9694
allowFullScreen
9795
title={`${repo.name} video player`}

0 commit comments

Comments
 (0)