ui: extract WarningIcon component from ChildCheckbox.js

This commit is contained in:
Mike Salvatore 2021-01-28 09:00:55 -05:00
parent 5942fad434
commit 5f9470d17c
2 changed files with 14 additions and 2 deletions

View File

@ -2,10 +2,11 @@ import React from 'react';
import {Button, Form} from 'react-bootstrap';
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 {getComponentHeight} from './utils/HeightCalculator';
import WarningIcon from './WarningIcon';
function ChildCheckboxContainer(props) {
const {
@ -54,7 +55,7 @@ function ChildCheckbox(props) {
let displayLabel = [<span key={'label'} className={'option-text'}>{label}</span>];
if (!safe) {
displayLabel.push(<FontAwesomeIcon key="unsafe-indicator" className="unsafe-indicator" icon={faExclamationTriangle}/>)
displayLabel.push(<WarningIcon key="unsafe-indicator"/>)
}
return (

View File

@ -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;