Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replaced SyntaxHighlighter to prism to fix react components #76

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-redux": "^5.0.7",
"react-syntax-highlighter": "8.0.1",
"react-syntax-highlighter": "11.0.2",
"redux": "^4.0.0",
"redux-persist": "^5.10.0",
"redux-saga": "^0.16.0",
Expand Down
5 changes: 2 additions & 3 deletions src/public/js/components/sideBar/component/Code/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react';
import classNames from 'classnames';
import SyntaxHighlighter from 'react-syntax-highlighter';
import { atomOneLight } from 'react-syntax-highlighter/styles/hljs';
import { atomOneLight } from 'react-syntax-highlighter/dist/esm/styles/hljs';

import './index.less';

const FONT_SIZE = 12;
const LINE_HEIGHT = 18;
const PADDING_TOP = 5;

//TODO: add select with several themes
//TODO: scrool to/highlight crumbed lines
//https://github.com/conorhastings/react-syntax-highlighter/blob/master/README.md
Expand Down Expand Up @@ -36,7 +37,6 @@ export default class extends React.Component {

render() {
const {
language,
code,
crumbedLines = [],
dependenciesLines = [],
Expand All @@ -48,7 +48,6 @@ export default class extends React.Component {
return (
<div className={classNames('Code', { limitedHeight })} ref={el => (this.codeRef = el)}>
<SyntaxHighlighter
language={language}
style={atomOneLight}
showLineNumbers={true}
wrapLines={true}
Expand Down