Merge branch 'syntax-switch-fix' into 'dev'

Add background-color to options of Syntax Switch.

See merge request ligolang/ligo!542
This commit is contained in:
Sander 2020-04-01 14:41:47 +00:00
commit 60070cc8d0
5 changed files with 14 additions and 12 deletions

View File

@ -2,15 +2,15 @@ import React from 'react';
import styles from './styles.module.css';
function SyntaxSwitch(props) {
return React.createElement("select", {
return /*#__PURE__*/React.createElement("select", {
className: styles.syntaxSwitch,
defaultValue: props.syntax,
onChange: e => props.onSyntaxChange(e.target.value)
}, React.createElement("option", {
}, /*#__PURE__*/React.createElement("option", {
value: "pascaligo"
}, "PascaLIGO"), React.createElement("option", {
}, "PascaLIGO"), /*#__PURE__*/React.createElement("option", {
value: "cameligo"
}, "CameLIGO"), React.createElement("option", {
}, "CameLIGO"), /*#__PURE__*/React.createElement("option", {
value: "reasonligo"
}, "ReasonLIGO"));
}

View File

@ -2,11 +2,11 @@ import React from 'react';
import SyntaxContext from './SyntaxContext';
function Syntax(props) {
return React.createElement(SyntaxContext.Consumer, null, syntax => {
return /*#__PURE__*/React.createElement(SyntaxContext.Consumer, null, syntax => {
if (syntax === props.syntax) {
return props.children;
} else {
return React.createElement(React.Fragment, null);
return /*#__PURE__*/React.createElement(React.Fragment, null);
}
});
}

View File

@ -32,6 +32,7 @@
.syntaxSwitch option {
color: var(--color-primary-text);
font-weight:normal;
background-color: var(--ifm-navbar-background-color);
}

View File

@ -72,9 +72,9 @@ function SyntaxTitle(props) {
useEffect(() => {
setMounted(true);
}, []);
return React.createElement(SyntaxContext.Consumer, null, syntax => {
return /*#__PURE__*/React.createElement(SyntaxContext.Consumer, null, syntax => {
if (syntax === props.syntax) {
return React.createElement(Highlight, _extends({}, defaultProps, {
return /*#__PURE__*/React.createElement(Highlight, _extends({}, defaultProps, {
key: mounted,
language: props.syntax,
code: props.children,
@ -85,7 +85,7 @@ function SyntaxTitle(props) {
tokens,
getLineProps,
getTokenProps
}) => React.createElement("pre", {
}) => /*#__PURE__*/React.createElement("pre", {
className: className,
style: {
backgroundColor: 'var(--ifm-background-color)',
@ -95,15 +95,15 @@ function SyntaxTitle(props) {
whiteSpace: 'break-spaces',
marginTop: '3rem'
}
}, tokens.map((line, i) => React.createElement("div", getLineProps({
}, tokens.map((line, i) => /*#__PURE__*/React.createElement("div", getLineProps({
line,
key: i
}), line.map((token, key) => React.createElement("span", getTokenProps({
}), line.map((token, key) => /*#__PURE__*/React.createElement("span", getTokenProps({
token,
key
})))))));
} else {
return React.createElement("div", null);
return /*#__PURE__*/React.createElement("div", null);
}
});
}

View File

@ -32,6 +32,7 @@
.syntaxSwitch option {
color: var(--color-primary-text);
font-weight:normal;
background-color: var(--ifm-navbar-background-color);
}