Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Zhang (张涛) committed Feb 19, 2024
1 parent 1698530 commit 0ff9f0e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class CodechangeService {
},
})
.then((r) => {
console.log(r);
if (r) {
return r;
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/canyon-report/src/Report/components/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const Code: FC<{
}
})}
/>
<LineNew news={fileCodeChange} />
<LineNew news={fileCodeChange} count={code.split('\n').length} />
<div
style={{ flexGrow: 1, overflow: 'auto' }}
dangerouslySetInnerHTML={{ __html: html }}
Expand Down
7 changes: 3 additions & 4 deletions packages/canyon-report/src/Report/components/line/new.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const LineNew = ({ news }) => {
// const news = [1, 2, 3, 7, 8, 9, 10, 14, 15];
const LineNew = ({ news, count }) => {
return (
<div style={{ width: '20px', textAlign: 'center' }}>
{[...Array(200)].map((line, index) => {
{[...Array(count)].map((line, index) => {
return (
<div style={{ height: '14px', color: 'green', width: '20px' }}>
{news.includes(index) ? '+' : ''}
{news.includes(index + 1) ? '+' : ''}
</div>
);
})}
Expand Down

0 comments on commit 0ff9f0e

Please sign in to comment.