diff --git a/src/components/EmptyCard.tsx b/src/components/EmptyCard.tsx new file mode 100644 index 0000000..6772304 --- /dev/null +++ b/src/components/EmptyCard.tsx @@ -0,0 +1,57 @@ +import React from "react"; +import { Card, CardContent, Grid, LinearProgress } from "@material-ui/core"; +import { grey } from "@material-ui/core/colors"; + +const styles = { + card: { + minHeight: "150px", + width: "300px", + borderRadius: "10px", + background: grey[500], + opacity: 0.2, + margin: "0px", + display: "flex", + }, + cardContent: { + flexGrow: 1, + padding: 0, + margin: "16px", + display: "flex", + }, + cardItem: { + borderRadius: "10px", + width: "145px", + minHeight: "115px", + }, + listItem: { + width: "145px", + minHeight: "115px", + borderRadius: "10px", + }, + listItemIcon: { + minWidth: "auto", + }, +}; + +interface IProps { + content?: JSX.Element; +} + +const EmptyCard: React.FC = (props) => { + return ( + + + + + + {props.content} + + + + + + + ); +}; + +export default EmptyCard; diff --git a/src/containers/CardsList.tsx b/src/containers/CardsList.tsx index abb6fe1..8e8a11c 100644 --- a/src/containers/CardsList.tsx +++ b/src/containers/CardsList.tsx @@ -2,6 +2,7 @@ import React from "react"; import { ButtonBase } from "@material-ui/core"; import { ICard } from "../machines/appMachine"; import CardView from "./CardView"; +import EmptyCard from "../components/EmptyCard"; interface IProps { cards: ICard[]; @@ -13,6 +14,7 @@ const TAB_INDEX_START = 3; const CardsList: React.FC = ({ cards, onCardSelect }) => { return ( <> + {cards.length === 0 && } {cards.map((card, i) => ( onCardSelect && onCardSelect(card)} diff --git a/src/containers/FormPanel.tsx b/src/containers/FormPanel.tsx index f720cb3..11d05ae 100644 --- a/src/containers/FormPanel.tsx +++ b/src/containers/FormPanel.tsx @@ -77,11 +77,9 @@ const FormPanel: React.FC = (props) => { }} onClick={() => { setOpen(false); - setTimeout(() => { - if (props.onCancel) { - props.onCancel(); - } - }, 90); + if (props.onCancel) { + props.onCancel(); + } }}> diff --git a/src/containers/MyApp.tsx b/src/containers/MyApp.tsx index 5c33b62..4957ebd 100644 --- a/src/containers/MyApp.tsx +++ b/src/containers/MyApp.tsx @@ -8,7 +8,6 @@ import { MuiThemeProvider, CssBaseline, Paper, - CircularProgress, Typography, FormControlLabel, Checkbox, @@ -18,7 +17,7 @@ import { import SignatoryOpenRPCDocument from "../openrpc.json"; import CardView from "./CardView"; import refParser, { JSONSchema } from "@apidevtools/json-schema-ref-parser"; -import { ArrowBackIos, Close } from "@material-ui/icons"; +import { ArrowBackIos, Close, ScreenLockPortrait } from "@material-ui/icons"; import CardsList from "./CardsList"; import { Flipper } from "react-flip-toolkit"; import AppBar from "./AppBar"; @@ -41,6 +40,7 @@ import { capabilities } from "../capabilities"; import { RpcCapDomainEntry } from "@xops.net/rpc-cap"; import AccountSelectList from "../components/AccountSelectList"; import { Account } from "@etclabscore/signatory-core"; +import EmptyCard from "../components/EmptyCard"; export const matchesMachineState = ( states: string[], @@ -412,7 +412,12 @@ const MyApp = () => { state.matches("signingTransaction") || state.matches("signingTypedData")) && - + + + {state.value.includes("signing") ? "Signing" : "Creating"} + + } /> } { diff --git a/src/machines/appMachine.tsx b/src/machines/appMachine.tsx index 9ffed79..9025ea9 100644 --- a/src/machines/appMachine.tsx +++ b/src/machines/appMachine.tsx @@ -245,7 +245,7 @@ export const rawAppMachine: any = { const keyfile = await signatoryCore.exportAccount(e.address); saveJSON(keyfile, `${e.address}-keyfile.json`); resolve(); - }, 200); + }, 300); }); }, }, @@ -363,7 +363,7 @@ export const rawAppMachine: any = { saveJSON(keyfile, `${r}-keyfile.json`); resolve(r); }).catch(reject); - }, 200); + }, 300); }); }, onDone: { @@ -389,7 +389,7 @@ export const rawAppMachine: any = { return new Promise((resolve: any, reject: any) => { setTimeout(() => { signatoryCore.importMnemonic(event.importMnemonicOptions).then(resolve).catch(reject); - }, 200); + }, 300); }); }, onDone: { @@ -431,7 +431,7 @@ export const rawAppMachine: any = { .signTransaction(event.transaction, event.passphrase, event.chainId) .then(resolve) .catch(reject); - }, 200); + }, 300); }); }, onDone: { @@ -452,7 +452,7 @@ export const rawAppMachine: any = { setTimeout(() => { signatoryCore .sign(event.dataToSign, event.address, event.passphrase, event.chainId).then(resolve).catch(reject); - }, 200); + }, 300); }); }, onDone: { diff --git a/src/openrpc.json b/src/openrpc.json index be718b6..d443491 100644 --- a/src/openrpc.json +++ b/src/openrpc.json @@ -375,19 +375,6 @@ } ] }, - { - "name": "importKeyfile", - "summary": "Import an account from Keyfile", - "description": "Import a new account from an external keyfile. should comply with the [Web3 Secret Storage Definition](https://github.com/ethereumproject/wiki/wiki/Web3-Secret-Storage-Definition)", - "params": [ - { - "$ref": "#/components/contentDescriptors/Keyfile" - } - ], - "result": { - "$ref": "#/components/contentDescriptors/Address" - } - }, { "name": "generateMnemonic", "summary": "Generate a mnemonic phrase",