-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from 1Hive/next
v0.8.1
- Loading branch information
Showing
74 changed files
with
2,068 additions
and
807 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
'@1hive/evmcrispr': patch | ||
--- | ||
|
||
- New `print` command. | ||
- New autocompletion suggestions for Aragon agents and tokens retrieved via the `@token` helper. | ||
- New arithmetic operator `^` for exponentiation in mathematical calculations. | ||
- Add support to the `goerli` network on the `aragonos` module. | ||
- Add support to `payable` functions on the `exec` commands. | ||
- Reintroduce `raw` command. | ||
- Fix line endings in Windows. | ||
- Fix `BigNumber` edge case operations. | ||
- Fix underscored view function calls when using the call operator (`::`). For example: `token-manager::MINT_ROLE()`. | ||
- Add improvements to `set` command. | ||
- Add improvements to `@get` helper. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
packages/evmcrispr-terminal/src/components/action-buttons/error-msg.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { | ||
Alert, | ||
AlertDescription, | ||
AlertIcon, | ||
Box, | ||
Button, | ||
Collapse, | ||
} from '@chakra-ui/react'; | ||
import { useEffect, useRef, useState } from 'react'; | ||
|
||
const COLLAPSE_THRESHOLD = 30; | ||
|
||
export default function ErrorMsg({ errors }: { errors: string[] }) { | ||
const [showCollapse, setShowCollapse] = useState<boolean>(false); | ||
const [showExpandBtn, setShowExpandBtn] = useState(false); | ||
const contentRef = useRef<HTMLDivElement | null>(null); | ||
|
||
useEffect(() => { | ||
if (!errors?.length) { | ||
setShowExpandBtn(false); | ||
} else if (contentRef.current) { | ||
setShowExpandBtn(contentRef.current.clientHeight > COLLAPSE_THRESHOLD); | ||
} | ||
}, [errors]); | ||
|
||
return ( | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
justifyContent="left" | ||
maxWidth="100%" | ||
wordBreak="break-all" | ||
> | ||
{errors.map((e, index) => ( | ||
<Alert key={index} status="error"> | ||
<Box display="flex" alignItems="flex-start"> | ||
<AlertIcon /> | ||
<AlertDescription> | ||
<Collapse startingHeight={COLLAPSE_THRESHOLD} in={showCollapse}> | ||
<div ref={contentRef}>{e}</div> | ||
</Collapse> | ||
</AlertDescription> | ||
</Box> | ||
</Alert> | ||
))} | ||
{showExpandBtn && ( | ||
<Button | ||
width="30" | ||
alignSelf="flex-end" | ||
size="sm" | ||
onClick={() => setShowCollapse((show) => !show)} | ||
mt="1rem" | ||
> | ||
Show {showCollapse ? 'Less' : 'More'} | ||
</Button> | ||
)} | ||
</Box> | ||
); | ||
} |
Oops, something went wrong.