mirror of
https://github.com/primer/css.git
synced 2024-09-20 13:17:29 +03:00
Remove react inline svg and import octicons css
This commit is contained in:
parent
80515ee3a8
commit
5d9fb5be26
@ -1,12 +1,12 @@
|
||||
import React from 'react'
|
||||
import {storiesOf} from '@storybook/react'
|
||||
import octicons from 'octicons'
|
||||
import SVGInline from 'react-svg-inline'
|
||||
|
||||
export const Octicon = (props) => {
|
||||
const {name} = props
|
||||
if (name in octicons) {
|
||||
return <SVGInline svg={octicons[name].toSVG(props)} />
|
||||
const svg = octicons[name].toSVG(props)
|
||||
return <span dangerouslySetInnerHTML={ {__html: svg } } />
|
||||
} else {
|
||||
throw new Error(`No such octicon: "${name}"!`)
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
<link rel="stylesheet" href="https://unpkg.com/primer-css@9.2.0/build/build.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/octicons@7.0.1/build/build.css">
|
||||
<script src="https://github.com/site/assets/styleguide.js" async></script>
|
||||
|
@ -44,7 +44,6 @@
|
||||
"raw-loader": "^0.5.1",
|
||||
"react": "^15.6.1",
|
||||
"react-dom": "^15.6.1",
|
||||
"react-svg-inline": "^2.0.0",
|
||||
"registry-url": "^3.1.0",
|
||||
"remark": "^8.0.0",
|
||||
"sass-loader": "^6.0.6",
|
||||
|
Loading…
Reference in New Issue
Block a user