-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testnet: Integrate wallet locks and show error for full orderbook error
- Loading branch information
Showing
7 changed files
with
119 additions
and
14 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
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
64 changes: 64 additions & 0 deletions
64
testnet.renegade.fi/components/steppers/order-stepper/steps/error-step.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,64 @@ | ||
import { Button, Flex, ModalBody, Text } from "@chakra-ui/react" | ||
|
||
import { ErrorType, useStepper } from "../order-stepper" | ||
|
||
export function ErrorStep() { | ||
const { onClose, error } = useStepper() | ||
const title = { | ||
[ErrorType.ORDERBOOK_FULL]: "Orderbook full", | ||
[ErrorType.WALLET_LOCKED]: "Wallet locked", | ||
"": "", | ||
}[error || ""] | ||
const content = { | ||
[ErrorType.ORDERBOOK_FULL]: | ||
"You can only have 5 orders in the orderbook at a time. Please cancel an existing order to make room for this one.", | ||
[ErrorType.WALLET_LOCKED]: "Please wait for the ongoing task to complete.", | ||
"": "", | ||
}[error || ""] | ||
|
||
return ( | ||
<> | ||
<ModalBody> | ||
<Flex | ||
alignItems="center" | ||
justifyContent="center" | ||
flexDirection="column" | ||
gap="12" | ||
textAlign="center" | ||
> | ||
<Text | ||
color="white.50" | ||
fontFamily="Favorit Extended" | ||
fontSize="1.3em" | ||
fontWeight="200" | ||
> | ||
{title} | ||
</Text> | ||
{/* TODO: Make this general error modal */} | ||
<Text fontSize="0.9em">{content}</Text> | ||
<Button | ||
padding="20px" | ||
color="white.80" | ||
fontSize="1.2em" | ||
fontWeight="200" | ||
borderWidth="thin" | ||
borderColor="white.40" | ||
borderRadius="100px" | ||
_hover={{ | ||
borderColor: "white.60", | ||
color: "white", | ||
}} | ||
_focus={{ | ||
backgroundColor: "transparent", | ||
}} | ||
transition="0.15s" | ||
backgroundColor="transparent" | ||
onClick={onClose} | ||
> | ||
Close | ||
</Button> | ||
</Flex> | ||
</ModalBody> | ||
</> | ||
) | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1478,9 +1478,9 @@ | |
dependencies: | ||
"@noble/hashes" "1.3.2" | ||
|
||
"@noble/ed25519@https://github.com/renegade-fi/noble-ed25519#prehashed-context": | ||
"@noble/ed25519@git+https://github.com/renegade-fi/noble-ed25519.git#prehashed-context": | ||
version "1.7.1" | ||
resolved "https://github.com/renegade-fi/noble-ed25519#dcd9e5541c527e23b07f09db09d3a2c32ff61b2c" | ||
resolved "git+https://github.com/renegade-fi/noble-ed25519.git#dcd9e5541c527e23b07f09db09d3a2c32ff61b2c" | ||
|
||
"@noble/[email protected]", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.2": | ||
version "1.3.2" | ||
|
@@ -1551,8 +1551,10 @@ | |
"@react-hook/event" "^1.2.1" | ||
"@react-hook/throttle" "^2.2.0" | ||
|
||
"@renegade-fi/renegade-js@../../renegade-js": | ||
"@renegade-fi/renegade-js@^0.3.8": | ||
version "0.3.8" | ||
resolved "https://registry.yarnpkg.com/@renegade-fi/renegade-js/-/renegade-js-0.3.8.tgz#1c0d88d5dfc7874b37c3e021ec394128be5ff0cb" | ||
integrity sha512-RBJSj5cemkkwuBqup072BmBW26NY0OPBEj3m78JEa2K3hrDVqAVm9edVO+4U4BMDKc0BQoofL129h1n8UK2xJw== | ||
dependencies: | ||
"@noble/ed25519" "https://github.com/renegade-fi/noble-ed25519#prehashed-context" | ||
"@noble/hashes" "^1.3.0" | ||
|