Skip to content

Commit

Permalink
RC #121 - Removing highlighter selection from ViewXML component; High…
Browse files Browse the repository at this point in the history
…lighter style must be passed as prop
  • Loading branch information
dleadbetter committed Apr 8, 2022
1 parent ff7a1bc commit 7c1aa48
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/semantic-ui/ViewXML.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import React, { type ComponentType, useState } from 'react';
import SyntaxHighlighter from 'react-syntax-highlighter';
import * as styles from 'react-syntax-highlighter/dist/cjs/styles/hljs';
import { Button, Modal } from 'semantic-ui-react';
import i18n from '../i18n/i18n';

type Props = {
highlighter?: string,
highlighter?: any,
opener: {
component: ComponentType<any>,
props: any
Expand All @@ -20,7 +19,6 @@ const ViewXML = (props: Props) => {
const [showModal, setShowModal] = useState(false);
const OpenerComponent = props.opener.component;
const openerProps = props.opener.props;
const highlighter = styles[props.highlighter || 'atomOneLight'];

return (
<>
Expand All @@ -41,7 +39,7 @@ const ViewXML = (props: Props) => {
<Modal.Content>
<SyntaxHighlighter
language='xml'
style={highlighter}
style={props.highlighter}
>
{ props.xml }
</SyntaxHighlighter>
Expand Down

0 comments on commit 7c1aa48

Please sign in to comment.