Commit baf1dd9a authored by lianahus's avatar lianahus Committed by Liana Husikyan

changed the info icons and fixed some layout issues

parent 811ce192
...@@ -40,6 +40,7 @@ export const CopyToClipboard = (props: ICopyToClipboard) => { ...@@ -40,6 +40,7 @@ export const CopyToClipboard = (props: ICopyToClipboard) => {
} }
return ( return (
// eslint-disable-next-line jsx-a11y/anchor-is-valid
<a href='#' onClick={handleClick} onMouseLeave={reset}> <a href='#' onClick={handleClick} onMouseLeave={reset}>
<OverlayTrigger placement={direction} overlay={ <OverlayTrigger placement={direction} overlay={
<Tooltip id="overlay-tooltip"> <Tooltip id="overlay-tooltip">
......
...@@ -5,6 +5,7 @@ import * as helper from '../../../../../apps/remix-ide/src/lib/helper' ...@@ -5,6 +5,7 @@ import * as helper from '../../../../../apps/remix-ide/src/lib/helper'
import { canUseWorker, baseURLBin, baseURLWasm, urlFromVersion, pathToURL, promisedMiniXhr } from '@remix-project/remix-solidity' import { canUseWorker, baseURLBin, baseURLWasm, urlFromVersion, pathToURL, promisedMiniXhr } from '@remix-project/remix-solidity'
import { compilerReducer, compilerInitialState } from './reducers/compiler' import { compilerReducer, compilerInitialState } from './reducers/compiler'
import { resetEditorMode, listenToEvents } from './actions/compiler' import { resetEditorMode, listenToEvents } from './actions/compiler'
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
import './css/style.css' import './css/style.css'
...@@ -572,11 +573,18 @@ export const CompilerContainer = (props: CompilerContainerProps) => { ...@@ -572,11 +573,18 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
</div> </div>
</div> </div>
{ {
isHardHatProject && <div className="mt-2 remixui_compilerConfig custom-control custom-checkbox"> isHardHatProject &&
<div className="mt-3 remixui_compilerConfig custom-control custom-checkbox">
<input className="remixui_autocompile custom-control-input" onChange={updatehhCompilation} id="enableHardhat" type="checkbox" title="Enable Hardhat Compilation" checked={hhCompilation} /> <input className="remixui_autocompile custom-control-input" onChange={updatehhCompilation} id="enableHardhat" type="checkbox" title="Enable Hardhat Compilation" checked={hhCompilation} />
<label className="form-check-label custom-control-label" htmlFor="enableHardhat">Enable Hardhat Compilation</label> <label className="form-check-label custom-control-label" htmlFor="enableHardhat">Enable Hardhat Compilation</label>
<a href="https://remix-ide.readthedocs.io/en/latest/hardhat.html#enable-hardhat-compilation" target="_blank"> <a className="mt-1 text-nowrap" href='https://remix-ide.readthedocs.io/en/latest/hardhat.html#enable-hardhat-compilation' target={'_blank'}>
<i className="ml-2 fas fa-info" title="Know how to use Hardhat Compilation"></i> <OverlayTrigger placement={'right'} overlay={
<Tooltip className="text-nowrap" id="overlay-tooltip">
<span className="p-1 pr-3" style={{ backgroundColor: 'black', minWidth: '230px' }}>Learn how to use Hardhat Compilation</span>
</Tooltip>
}>
<i style={{ fontSize: 'medium' }} className={'ml-2 fal fa-info-circle'} aria-hidden="true"></i>
</OverlayTrigger>
</a> </a>
</div> </div>
} }
......
...@@ -7,6 +7,7 @@ import { RemixUiCheckbox } from '@remix-ui/checkbox' // eslint-disable-line ...@@ -7,6 +7,7 @@ import { RemixUiCheckbox } from '@remix-ui/checkbox' // eslint-disable-line
import ErrorRenderer from './ErrorRenderer' // eslint-disable-line import ErrorRenderer from './ErrorRenderer' // eslint-disable-line
import { compilation } from './actions/staticAnalysisActions' import { compilation } from './actions/staticAnalysisActions'
import { initialState, analysisReducer } from './reducers/staticAnalysisReducer' import { initialState, analysisReducer } from './reducers/staticAnalysisReducer'
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
const StaticAnalysisRunner = require('@remix-project/remix-analyzer').CodeAnalysis const StaticAnalysisRunner = require('@remix-project/remix-analyzer').CodeAnalysis
const utils = remixLib.util const utils = remixLib.util
...@@ -56,7 +57,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { ...@@ -56,7 +57,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
} }
const [autoRun, setAutoRun] = useState(true) const [autoRun, setAutoRun] = useState(true)
const [slitherEnabled, setSlitherEnabled] = useState(false) const [slitherEnabled, setSlitherEnabled] = useState(false)
const [showSlither, setShowSlither] = useState('hidden') const [showSlither, setShowSlither] = useState(false)
const [categoryIndex, setCategoryIndex] = useState(groupedModuleIndex(groupedModules)) const [categoryIndex, setCategoryIndex] = useState(groupedModuleIndex(groupedModules))
const warningContainer = React.useRef(null) const warningContainer = React.useRef(null)
...@@ -88,9 +89,9 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { ...@@ -88,9 +89,9 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
// Reset state // Reset state
dispatch({ type: '', payload: {} }) dispatch({ type: '', payload: {} })
// Show 'Enable Slither Analysis' checkbox // Show 'Enable Slither Analysis' checkbox
if (currentWorkspace && currentWorkspace.isLocalhost === true) setShowSlither('visible') if (currentWorkspace && currentWorkspace.isLocalhost === true) setShowSlither(true)
else { else {
setShowSlither('hidden') setShowSlither(false)
setSlitherEnabled(false) setSlitherEnabled(false)
} }
}) })
...@@ -103,7 +104,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { ...@@ -103,7 +104,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
props.event.trigger('staticAnaysisWarning', []) props.event.trigger('staticAnaysisWarning', [])
// Reset state // Reset state
dispatch({ type: '', payload: {} }) dispatch({ type: '', payload: {} })
setShowSlither('hidden') setShowSlither(false)
setSlitherEnabled(false) setSlitherEnabled(false)
} }
}) })
...@@ -414,19 +415,28 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { ...@@ -414,19 +415,28 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
/> />
<Button buttonText="Run" onClick={() => run(state.data, state.source, state.file)} disabled={(state.data === null || categoryIndex.length === 0) && !slitherEnabled }/> <Button buttonText="Run" onClick={() => run(state.data, state.source, state.file)} disabled={(state.data === null || categoryIndex.length === 0) && !slitherEnabled }/>
</div> </div>
<div className="d-flex" id="enableSlitherAnalysis" style={{ visibility: showSlither } as CSSProperties }> { showSlither &&
<RemixUiCheckbox <div className="d-flex mt-2" id="enableSlitherAnalysis">
id="enableSlither" <RemixUiCheckbox
inputType="checkbox" id="enableSlither"
onClick={handleSlitherEnabled} inputType="checkbox"
checked={slitherEnabled} onClick={handleSlitherEnabled}
label="Enable Slither Analysis" checked={slitherEnabled}
onChange={() => {}} label="Enable Slither Analysis"
/> onChange={() => {}}
<a href="https://remix-ide.readthedocs.io/en/latest/slither.html#enable-slither-analysis" target="_blank"> />
<i className="ml-3 fas fa-info" title="Know how to use Slither Analysis"></i>
</a> <a className="mt-1 text-nowrap" href='https://remix-ide.readthedocs.io/en/latest/slither.html#enable-slither-analysis' target={'_blank'}>
</div> <OverlayTrigger placement={'right'} overlay={
<Tooltip className="text-nowrap" id="overlay-tooltip">
<span className="p-1 pr-3" style={{ backgroundColor: 'black', minWidth: '230px' }}>Learn how to use Slither Analysis</span>
</Tooltip>
}>
<i style={{ fontSize: 'medium' }} className={'fal fa-info-circle ml-3'} aria-hidden="true"></i>
</OverlayTrigger>
</a>
</div>
}
</div> </div>
<div id="staticanalysismodules" className="list-group list-group-flush"> <div id="staticanalysismodules" className="list-group list-group-flush">
{Object.keys(groupedModules).map((categoryId, i) => { {Object.keys(groupedModules).map((categoryId, i) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment