Skip to content

Commit

Permalink
Merge pull request #53 from 1Hive/next
Browse files Browse the repository at this point in the history
v0.8.1
  • Loading branch information
PJColombo authored Nov 17, 2022
2 parents 668a81d + db469c4 commit 6b39154
Show file tree
Hide file tree
Showing 74 changed files with 2,068 additions and 807 deletions.
15 changes: 15 additions & 0 deletions .changeset/tidy-trains-tap.md
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.
1 change: 1 addition & 0 deletions packages/evmcrispr-terminal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"dependencies": {
"@1hive/evmcrispr": "0.8.0",
"@chakra-ui/icons": "^2.0.11",
"@chakra-ui/react": "^1.8.8",
"@emotion/react": "^11",
"@emotion/styled": "^11",
Expand Down
115 changes: 3 additions & 112 deletions packages/evmcrispr-terminal/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,124 +1,15 @@
import '@fontsource/ubuntu-mono';
import { HashRouter, Redirect, Route, Switch } from 'react-router-dom';

import type { ComponentStyleConfig } from '@chakra-ui/react';
import { ChakraProvider, DarkMode, extendTheme } from '@chakra-ui/react';

import { theme } from './theme';

import Wagmi from './providers/Wagmi';
import Header from './components/header';

import Landing from './pages/landing';
import { Terminal } from './pages/terminal';

const Modal: ComponentStyleConfig = {
// The styles all button have in common
parts: ['dialog'],
baseStyle: {
dialog: {
bg: 'black',
border: '3px solid',
borderColor: 'brand.green.300',
},
},
};

const Button: ComponentStyleConfig = {
// The styles all button have in common
baseStyle: {
borderRadius: 'none', // <-- border radius is same for all variants and sizes
textDecoration: 'none',
_hover: {
transition: 'all 0.5s',
},
_focus: {
boxShadow: 'rgba(66, 153, 225, 0.6) 0px 0px 0px 2px',
},
fontWeight: 'normal',
},
// Two sizes: sm and md
sizes: {
sm: {
fontSize: 'sm',
px: 4, // <-- px is short for paddingLeft and paddingRight
py: 3, // <-- py is short for paddingTop and paddingBottom
},
md: {
fontSize: 'md',
px: 6, // <-- these values are tokens from the design system
py: 4, // <-- these values are tokens from the design system
},
lg: {
fontSize: '2xl',
px: 6,
py: 3,
},
},
// Two variants: outline and solid
variants: {
outline: {
border: '2px solid',
borderColor: 'brand.green.300',
color: 'brand.green.300',
},
blue: {
color: 'brand.green.300',
bgColor: 'brand.blue.600',
_hover: {
bgColor: 'gray.900',
},
},
lime: {
color: 'gray.900',
bgColor: 'brand.green.300',
_hover: {
bgColor: 'gray.900',
color: 'brand.green.300',
},
},
warning: {
color: 'brand.warning.50',
bgColor: 'brand.warning.400',
_hover: {
bgColor: 'brand.warning.50',
color: 'brand.warning.400',
},
},
},
// The default size and variant values
defaultProps: {
variant: 'solid',
size: 'lg',
},
};

const theme = {
initialColorMode: 'dark',
useSystemColorMode: false,
colors: {
brand: {
green: {
300: '#92ed5e',
900: '#041800',
},
warning: {
50: '#ffe8df',
400: '#ed6f2c',
},
blue: {
600: '#16169d',
900: '#02071c',
},
},
},
fonts: {
heading: 'Ubuntu Mono, monospace, sans-serif',
body: 'Ubuntu Mono, monospace, sans-serif',
},
components: {
Modal,
Button,
},
};
import Terminal from './pages/terminal';

const App = () => {
return (
Expand Down
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>
);
}
Loading

0 comments on commit 6b39154

Please sign in to comment.