add custom tooltip to generate tests input and button

pull/2925/head
Joseph Izang 2 years ago
parent dd5013e0fd
commit 7b21ee8a64
  1. 60
      libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx

@ -199,7 +199,7 @@ export const SolidityUnitTesting = (props: Record<string, any>) => { // eslint-d
if (await testTabLogic.pathExists(testDirInput)) { if (await testTabLogic.pathExists(testDirInput)) {
setDisableCreateButton(true) setDisableCreateButton(true)
setDisableGenerateButton(false) setDisableGenerateButton(false)
} else { } else {
// Enable Create button // Enable Create button
setDisableCreateButton(false) setDisableCreateButton(false)
@ -674,28 +674,44 @@ export const SolidityUnitTesting = (props: Record<string, any>) => { // eslint-d
}) })
} }
</datalist> </datalist>
<input <OverlayTrigger
list="utPathList" placement="top-end"
className="inputFolder custom-select" overlay={
id="utPath" <Tooltip className="text-nowrap" id="uiPathInputtooltip">
data-id="uiPathInput" <span>{"Press 'Enter' to change the path for test files."}</span>
name="utPath" </Tooltip>
value={inputPathValue} }
title="Press 'Enter' to change the path for test files."
style={{ backgroundImage: "var(--primary)" }}
onKeyDown={() => { if (inputPathValue === '/') setInputPathValue('')} }
onChange={handleTestDirInput}
onClick = {() => { if (inputPathValue === '/') setInputPathValue('')} }
/>
<button
className="btn border ml-2"
data-id="testTabGenerateTestFolder"
title="Create a test folder"
disabled={disableCreateButton}
onClick={handleCreateFolder}
> >
Create <input
</button> list="utPathList"
className="inputFolder custom-select"
id="utPath"
data-id="uiPathInput"
name="utPath"
value={inputPathValue}
style={{ backgroundImage: "var(--primary)" }}
onKeyDown={() => { if (inputPathValue === '/') setInputPathValue('')} }
onChange={handleTestDirInput}
onClick = {() => { if (inputPathValue === '/') setInputPathValue('')} }
/>
</OverlayTrigger>
<OverlayTrigger
placement="top-end"
overlay={
<Tooltip className="text-nowrap" id="uiPathInputButtontooltip">
<span>Create a test folder</span>
</Tooltip>
}
>
<button
className="btn border ml-2"
data-id="testTabGenerateTestFolder"
disabled={disableCreateButton}
onClick={handleCreateFolder}
>
Create
</button>
</OverlayTrigger>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save