fix badge centering

pull/5370/head
Joseph Izang 1 year ago
parent 78e1a8e0f6
commit 24ede5779f
  1. 10
      libs/remix-ui/static-analyser/src/lib/components/BasicTitle.tsx
  2. 10
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx

@ -42,21 +42,21 @@ export function BasicTitle(props: BasicTitleProps) {
{props.warningStateEntries.length > 0 ? ( {props.warningStateEntries.length > 0 ? (
!props.hideWarnings ? ( !props.hideWarnings ? (
!props.showLibsWarnings ? ( !props.showLibsWarnings ? (
<i <span
data-id="StaticAnalysisErrorCount" data-id="StaticAnalysisErrorCount"
className={`badge ${ className={`badge ${
calculateWarningStateEntries(props.warningStateEntries).length > calculateWarningStateEntries(props.warningStateEntries).length >
0 0
? "badge-warning" ? "badge-warning"
: "badge-danger" : "badge-danger"
} rounded-circle ml-1 text-center`} } badge-pill ml-1 px-1 text-center`}
> >
{calculateWarningStateEntries(props.warningStateEntries).length} {calculateWarningStateEntries(props.warningStateEntries).length}
</i> </span>
) : ( ) : (
<i className="badge badge-warning rounded-circle ml-1 text-center"> <span className="badge badge-warning rounded-circle ml-1 text-center">
{warningCount} {warningCount}
</i> </span>
) )
) : null ) : null
) : null} ) : null}

@ -505,12 +505,12 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
{hints.length > 0 ? ( {hints.length > 0 ? (
hideWarnings ? ( hideWarnings ? (
<i className={`badge ${hints.filter(x => x.type === 'error').length > 0 <i className={`badge ${hints.filter(x => x.type === 'error').length > 0
? `badge-danger` : 'badge-warning'} rounded-circle ml-1 text-center`}> ? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}>
{hintErrors.length} {hintErrors.length}
</i> </i>
) : ( ) : (
<i className={`badge ${hints.filter(x => x.type === 'error').length > 0 <i className={`badge ${hints.filter(x => x.type === 'error').length > 0
? `badge-danger` : 'badge-warning'} rounded-circle ml-1 text-center`}> ? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}>
{hints.length} {hints.length}
</i> </i>
) )
@ -545,15 +545,15 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
Slither Slither
{slitherWarnings.length > 0 ? ( {slitherWarnings.length > 0 ? (
hideWarnings ? ( hideWarnings ? (
<i className="badge badge-warning rounded-circle ml-1"> <i className="badge badge-warning badge-pill px-1 ml-1">
{slitherErrors.length} {slitherErrors.length}
</i> </i>
) : showLibsWarning === true && hideWarnings === false ? ( ) : showLibsWarning === true && hideWarnings === false ? (
<i className={`badge ${slitherErrors.length > 0 ? `badge-danger` : 'badge-warning'} rounded-circle ml-1 text-center`}> <i className={`badge ${slitherErrors.length > 0 ? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}>
{slitherWarnings.length} {slitherWarnings.length}
</i> </i>
) : ( ) : (
<i className={`badge ${slitherErrors.length > 0 ? `badge-danger` : 'badge-warning'} rounded-circle ml-1 text-center`}> <i className={`badge ${slitherErrors.length > 0 ? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}>
{noLibSlitherWarnings.length} {noLibSlitherWarnings.length}
</i> </i>
) )

Loading…
Cancel
Save