Skip to content

Commit

Permalink
feat: Add operator component for code def
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jun 16, 2020
1 parent d8e80b3 commit 630ff4f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/components/CodeDef/CodeDef.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import PropTypes from 'prop-types';
import cx from 'classnames';
import styles from './CodeDef.module.scss';
import Block from './Block';
import Bracket from './Bracket';
import Comment from './Comment';
import Identifier from './Identifier';
import Keyword from './Keyword';
import Bracket from './Bracket';
import Operator from './Operator';
import Type from './Type';

const CodeDef = ({ className, children }) => (
Expand All @@ -19,10 +20,11 @@ CodeDef.propTypes = {
};

CodeDef.Block = Block;
CodeDef.Bracket = Bracket;
CodeDef.Comment = Comment;
CodeDef.Keyword = Keyword;
CodeDef.Identifier = Identifier;
CodeDef.Bracket = Bracket;
CodeDef.Operator = Operator;
CodeDef.Type = Type;

export default CodeDef;
5 changes: 3 additions & 2 deletions src/components/CodeDef/CodeDef.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
line-height: 2rem;
}

.keyword,
.identifier {
color: var(--color-neutrals-700);
}
Expand All @@ -21,7 +20,9 @@
}
}

.bracket {
.keyword,
.bracket,
.operator {
color: var(--color-neutrals-500);
}

Expand Down
13 changes: 13 additions & 0 deletions src/components/CodeDef/Operator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types';
import styles from './CodeDef.module.scss';

const Operator = ({ children }) => (
<span className={styles.operator}>{children}</span>
);

Operator.propTypes = {
children: PropTypes.node,
};

export default Operator;

0 comments on commit 630ff4f

Please sign in to comment.