Skip to content

Commit

Permalink
add reactSVG to support svg
Browse files Browse the repository at this point in the history
  • Loading branch information
davojta committed Sep 10, 2017
1 parent abfb9ef commit 8fa705f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
8 changes: 7 additions & 1 deletion dist/components/anchors.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _reactSvg = require('react-svg');

var _reactSvg2 = _interopRequireDefault(_reactSvg);

var _svgs = require('../svgs');

var SVGs = _interopRequireWildcard(_svgs);
Expand Down Expand Up @@ -122,7 +126,9 @@ var Anchors = function (_React$Component) {
className: 'emoji-mart-anchor ' + (isSelected ? 'emoji-mart-anchor-selected' : ''),
style: { color: isSelected ? color : null }
},
_react2.default.createElement(SVGElement, null),
_react2.default.createElement(_reactSvg2.default, {
path: SVGElement
}),
_react2.default.createElement('span', { className: 'emoji-mart-anchor-bar', style: { backgroundColor: color } })
);
})
Expand Down
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
},
"homepage": "https://github.com/missive/emoji-mart",
"dependencies": {
"measure-scrollbar": "^0.1.0"
"measure-scrollbar": "^0.1.0",
"react-svg": "^2.1.21"
},
"peerDependencies": {
"react": "^0.14.0 || ^15.0.0-0"
Expand Down
6 changes: 5 additions & 1 deletion src/components/anchors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react'
import PropTypes from 'prop-types'

import ReactSVG from 'react-svg'

import * as SVGs from '../svgs'

export default class Anchors extends React.Component {
Expand Down Expand Up @@ -42,7 +44,9 @@ export default class Anchors extends React.Component {
className={`emoji-mart-anchor ${isSelected ? 'emoji-mart-anchor-selected' : ''}`}
style={{ color: isSelected ? color : null }}
>
<SVGElement />
<ReactSVG
path={SVGElement}
/>
<span className='emoji-mart-anchor-bar' style={{ backgroundColor: color }}></span>
</span>
)
Expand Down

0 comments on commit 8fa705f

Please sign in to comment.