Skip to content

Commit

Permalink
Merge pull request #473 from homotechsual/react
Browse files Browse the repository at this point in the history
Styling/layout improvements
  • Loading branch information
KelvinTegelaar authored Jan 4, 2022
2 parents 9705b84 + 9bcc391 commit cde6dd6
Show file tree
Hide file tree
Showing 10 changed files with 259 additions and 420 deletions.
4 changes: 4 additions & 0 deletions src/components/cipp/CippDatatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ export default function CippDatatable({
sortFocus: {
default: 'var(--cipp-table-sort-focus-bg)',
},
highlightOnHover: {
default: 'var(--cipp-table-highlight-on-hover-bg)',
text: 'var(--cipp-table-highlight-on-hover-color)',
},
striped: {
default: 'var(--cipp-table-striped-bg)',
text: 'var(--cipp-table-striped-color)',
Expand Down
6 changes: 4 additions & 2 deletions src/components/cipp/PdfButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { CButton } from '@coreui/react'
import jsPDF from 'jspdf'
import 'jspdf-autotable'
import PropTypes from 'prop-types'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faFilePdf } from '@fortawesome/free-solid-svg-icons'

function ExportPDFButton(props) {
const exportPDF = (pdfData, pdfHeaders, pdfSize = 'A4', reportName) => {
Expand Down Expand Up @@ -40,10 +42,10 @@ function ExportPDFButton(props) {
return (
<CButton
size="sm"
className="text-white m-1"
className="m-1"
onClick={() => exportPDF(props.pdfData, props.pdfHeaders, props.pdfSize, props.reportName)}
>
PDF
<FontAwesomeIcon icon={faFilePdf} className='pe-1' size='lg' />PDF
</CButton>
)
}
Expand Down
39 changes: 30 additions & 9 deletions src/components/cipp/StatusIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,41 @@ const IconWarning = () => (
)

function StatusIcon(props) {
const finalState = props.finalState
if (finalState === 'Pass') {
return <IconGreenCheck />
} else if (finalState === 'Fail') {
return <IconRedX />
} else if (finalState === 'Warn') {
return <IconWarning />
} else {
return ''
if (props.type === 'finalstate') {
const finalState = props.finalState
if (finalState === 'Pass') {
return <IconGreenCheck />
} else if (finalState === 'Fail') {
return <IconRedX />
} else if (finalState === 'Warn') {
return <IconWarning />
} else {
return ''
}
} else if (props.type === 'boolean') {
const status = props.status
if (status === true) {
return <IconGreenCheck />
} else if (status === false) {
return <IconRedX />
} else {
return ''
}
} else if (props.type === 'negatedboolean') {
const status = props.status
if (status === false) {
return <IconGreenCheck />
} else if (status === true) {
return <IconRedX />
} else {
return ''
}
}
}

export default StatusIcon

StatusIcon.propTypes = {
finalState: PropTypes.string,
status: PropTypes.bool,
}
Loading

0 comments on commit cde6dd6

Please sign in to comment.