Use Icon component in place of icons.svg

This commit is contained in:
dannyrb 2019-05-28 14:57:07 -04:00
parent 6cd84dfa27
commit 7eaa4378bc
5 changed files with 17 additions and 21 deletions

View File

@ -5,7 +5,7 @@ import cloneDeep from 'lodash.clonedeep'
import bounding from '../../lib/utils/bounding.js' import bounding from '../../lib/utils/bounding.js'
import LabellingTransition from './LabellingTransition.js' import LabellingTransition from './LabellingTransition.js'
import { SelectTree } from 'react-viewerbase' import { SelectTree, Icon } from 'react-viewerbase'
import { getAddLabelButtonStyle } from './labellingPositionUtils.js' import { getAddLabelButtonStyle } from './labellingPositionUtils.js'
import OHIFLabellingData from './OHIFLabellingData.js' import OHIFLabellingData from './OHIFLabellingData.js'
@ -93,8 +93,6 @@ export default class LabellingFlow extends Component {
locationLabel, locationLabel,
} = this.state } = this.state
const Icons = `${window.config.routerBasename}/icons.svg`.replace('//', '/')
if (!skipAddLabelButton) { if (!skipAddLabelButton) {
return ( return (
<> <>
@ -125,9 +123,7 @@ export default class LabellingFlow extends Component {
className="checkIconWrapper" className="checkIconWrapper"
onClick={this.fadeOutAndLeaveFast} onClick={this.fadeOutAndLeaveFast}
> >
<svg className="checkIcon"> <Icon name="check-solid" className="checkIcon" />
<use xlinkHref={`${Icons}#check-solid`} />
</svg>
</div> </div>
<div className="locationDescriptionWrapper"> <div className="locationDescriptionWrapper">
<div className="location">{locationLabel}</div> <div className="location">{locationLabel}</div>

View File

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import './OHIFLogo.css' import './OHIFLogo.css'
const Icons = `${window.config.routerBasename}/icons.svg`.replace('//', '/') import { Icon } from 'react-viewerbase'
function OHIFLogo() { function OHIFLogo() {
return ( return (
@ -11,9 +11,7 @@ function OHIFLogo() {
className="header-brand" className="header-brand"
href="http://ohif.org" href="http://ohif.org"
> >
<svg className="header-logo-image"> <Icon name="ohif-log" className="header-logo-image" />
<use xlinkHref={`${Icons}#icon-ohif-logo`} />
</svg>
<div className="header-logo-text">Open Health Imaging Foundation</div> <div className="header-logo-text">Open Health Imaging Foundation</div>
</a> </a>
) )

View File

@ -125,7 +125,7 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
}, },
/*{ /*{
text: '3D', text: '3D',
icon: `${Icons}#cube`, icon: `#cube`,
onClick: (click) => { onClick: (click) => {
console.warn('3D Perspective'); console.warn('3D Perspective');
const data = { const data = {

View File

@ -1,13 +1,11 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import OHIF from 'ohif-core' import OHIF from 'ohif-core'
import { RoundedButtonGroup } from 'react-viewerbase' import { RoundedButtonGroup, Icon } from 'react-viewerbase'
import ConnectedLayoutButton from './ConnectedLayoutButton' import ConnectedLayoutButton from './ConnectedLayoutButton'
import ConnectedPluginSwitch from './ConnectedPluginSwitch.js' import ConnectedPluginSwitch from './ConnectedPluginSwitch.js'
import './ToolbarRow.css' import './ToolbarRow.css'
const Icons = `${window.config.routerBasename}/icons.svg`.replace('//', '/')
class ToolbarRow extends Component { class ToolbarRow extends Component {
static propTypes = { static propTypes = {
leftSidebarOpen: PropTypes.bool.isRequired, leftSidebarOpen: PropTypes.bool.isRequired,
@ -34,9 +32,11 @@ class ToolbarRow extends Component {
const leftSidebarToggle = [ const leftSidebarToggle = [
{ {
value: 'studies', value: 'studies',
svgLink: `${Icons}#icon-studies`, icon: {
svgWidth: 15, name: 'studies',
svgHeight: 13, width: 15,
height: 13,
},
bottomLabel: 'Series', bottomLabel: 'Series',
}, },
] ]
@ -44,9 +44,11 @@ class ToolbarRow extends Component {
const rightSidebarToggle = [ const rightSidebarToggle = [
{ {
value: 'measurements', value: 'measurements',
svgLink: `${Icons}#icon-measurements-lesions`, icon: {
svgWidth: 15, name: 'measurement-lesions',
svgHeight: 13, width: 15,
height: 13,
},
bottomLabel: 'Measurements', bottomLabel: 'Measurements',
}, },
] ]

View File

@ -39,7 +39,7 @@ export default function() {
command: 'Annotate', command: 'Annotate',
type: 'tool', type: 'tool',
text: 'Annotate', text: 'Annotate',
icon: `${Icons}#icon-tools-measure-non-target`, icon: `icon-tools-measure-non-target`,
active: false active: false
},*/ },*/
{ {