Skip to content

Commit

Permalink
feat: Create a Markdown component
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jun 16, 2020
1 parent 3d021b1 commit 23190b0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/Markdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import ReactMarkdown from 'react-markdown';
import styles from './Markdown.module.scss';

const Markdown = ({ className, ...props }) => (
<ReactMarkdown className={cx(styles.container, className)} {...props} />
);

Markdown.propTypes = {
className: PropTypes.string,
};

export default Markdown;
9 changes: 9 additions & 0 deletions src/components/Markdown.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.container {
> *:first-child {
margin-top: 0;
}

code {
background: var(--color-neutrals-100);
}
}

0 comments on commit 23190b0

Please sign in to comment.