forked from p15670423/monkey
ui: extract WarningIcon component from ChildCheckbox.js
This commit is contained in:
parent
5942fad434
commit
5f9470d17c
|
@ -2,10 +2,11 @@ import React from 'react';
|
||||||
import {Button, Form} from 'react-bootstrap';
|
import {Button, Form} from 'react-bootstrap';
|
||||||
|
|
||||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||||
import {faCheckSquare, faExclamationTriangle} from '@fortawesome/free-solid-svg-icons';
|
import {faCheckSquare} from '@fortawesome/free-solid-svg-icons';
|
||||||
import {faSquare} from '@fortawesome/free-regular-svg-icons';
|
import {faSquare} from '@fortawesome/free-regular-svg-icons';
|
||||||
|
|
||||||
import {getComponentHeight} from './utils/HeightCalculator';
|
import {getComponentHeight} from './utils/HeightCalculator';
|
||||||
|
import WarningIcon from './WarningIcon';
|
||||||
|
|
||||||
function ChildCheckboxContainer(props) {
|
function ChildCheckboxContainer(props) {
|
||||||
const {
|
const {
|
||||||
|
@ -54,7 +55,7 @@ function ChildCheckbox(props) {
|
||||||
let displayLabel = [<span key={'label'} className={'option-text'}>{label}</span>];
|
let displayLabel = [<span key={'label'} className={'option-text'}>{label}</span>];
|
||||||
|
|
||||||
if (!safe) {
|
if (!safe) {
|
||||||
displayLabel.push(<FontAwesomeIcon key="unsafe-indicator" className="unsafe-indicator" icon={faExclamationTriangle}/>)
|
displayLabel.push(<WarningIcon key="unsafe-indicator"/>)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||||
|
import {faExclamationTriangle} from '@fortawesome/free-solid-svg-icons';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
function WarningIcon() {
|
||||||
|
return (
|
||||||
|
<FontAwesomeIcon className="unsafe-indicator" icon={faExclamationTriangle}/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default WarningIcon;
|
Loading…
Reference in New Issue