fix overflow of text in alert card with warnings

pull/3779/head
Joseph Izang 1 year ago
parent bf16e27477
commit e4e8f50cab
  1. 4
      libs/remix-ui/static-analyser/src/lib/ErrorRenderer.tsx
  2. 7
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx

@ -47,9 +47,9 @@ const ErrorRenderer = ({ message, opt, editor, name }: ErrorRendererProps) => {
return ( return (
<div> <div>
<div className={`sol ${opt.type} ${classList}`}> <div className={`sol ${opt.type} ${classList}`}>
<span className='d-flex flex-column' data-id={`${name}Button`} onClick={async () => await handlePointToErrorOnClick(opt.location, opt.fileName)}> <span className='d-flex flex-column' data-id={`${name}Button`} onClick={async () => await handlePointToErrorOnClick(opt.location, opt.fileName)} style={{ cursor: "pointer", overflow: 'hidden', textOverflow: 'ellipsis' }}>
<span className='h6 font-weight-bold'>{opt.name}</span> <span className='h6 font-weight-bold'>{opt.name}</span>
{ opt.item.warning } <span>{ opt.item.warning }</span>
{opt.item.more {opt.item.more
? <span><a href={opt.item.more} target='_blank'>more</a></span> ? <span><a href={opt.item.more} target='_blank'>more</a></span>
: <span> </span> : <span> </span>

@ -387,7 +387,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
? "alert alert-warning" ? "alert alert-warning"
: "alert alert-danger" : "alert alert-danger"
}`} }`}
style={{ cursor: "pointer" }} style={{ cursor: "pointer", overflow: 'hidden', textOverflow: 'ellipsis' }}
onClick={async () => { onClick={async () => {
await props.analysisModule.call( await props.analysisModule.call(
"editor", "editor",
@ -426,7 +426,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
<div <div
key={index} key={index}
className="alert alert-danger" className="alert alert-danger"
style={{ cursor: "pointer" }} style={{ cursor: "pointer", overflow: 'hidden', textOverflow: 'ellipsis' }}
onClick={async () => { onClick={async () => {
await props.analysisModule.call( await props.analysisModule.call(
"editor", "editor",
@ -452,9 +452,10 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}} }}
> >
<div> <div>
<span className="text-wrap"> <span className="text-wrap" style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}>
{hint.formattedMessage} {hint.formattedMessage}
</span> </span>
<br />
<span>{hint.type}</span> <span>{hint.type}</span>
<br /> <br />
<span>{`${hint.column}:${hint.line}`}</span> <span>{`${hint.column}:${hint.line}`}</span>

Loading…
Cancel
Save