Skip to content

Commit

Permalink
chore: daily development
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangtao25 committed Jan 16, 2025
1 parent 6f203f4 commit a3da4df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { FC } from "react";
import { useEffect, useState } from "react";
import { createHighlighterCoreInstance } from "../../helpers/loadShiki";
import {Editor} from "@monaco-editor/react";

import { theme } from "antd";
import {Editor} from "@monaco-editor/react";
const { useToken } = theme;
function jisuanColor(coun) {
if (coun === 0) {
return "rgb(252, 225, 229)";
Expand All @@ -21,6 +23,11 @@ const FileCoverageDetail: FC<{
dsss: any[];
}> = ({ fileContent, lines, dsss }) => {
const [htmlContent, setHtmlContent] = useState("");
const { token } = useToken();

const isDark = token.colorBgBase === '#000'
// console.log(isDark,'????')
// console.log(token.colorBgBase,'token.theme')
useEffect(() => {
createHighlighterCoreInstance().then((highlighter) => {
const html = highlighter.codeToHtml(fileContent || "", {
Expand All @@ -30,7 +37,7 @@ const FileCoverageDetail: FC<{
});
setHtmlContent(html);
});
console.log(dsss);
// console.log(dsss);
}, [fileContent]);

return (
Expand Down Expand Up @@ -74,8 +81,7 @@ const FileCoverageDetail: FC<{
);
})}
</div>
{/*<Edi*/}
<Editor defaultValue={fileContent} height={'100vh'} language={'javascript'}/>
<Editor theme={isDark?'nightowl':'light'} defaultValue={fileContent} height={'100vh'} language={'javascript'}/>
</div>
);
};
Expand Down
16 changes: 0 additions & 16 deletions packages/canyon-report/src/index.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
/*@import 'antd/dist/reset.css';*/

.shiki > code {
font-size: 12px;
line-height: 24px;
}

a{
color: #3182ce;
}

.YourHighlightClass{
padding: 0 !important;
color: white !important;
background: rgb(244, 176, 27) !important;
}

.content-class-no-found{
background: #f6c6ce;
}

0 comments on commit a3da4df

Please sign in to comment.