-
Notifications
You must be signed in to change notification settings - Fork 20
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 #112 from alleslabs/fix/past-txs
fix: refactor pastTxs page, add new messages, change filter action section
- Loading branch information
Showing
38 changed files
with
1,605 additions
and
1,630 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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { AllTransaction, PastTransaction } from "lib/types"; | ||
import { ActionMsgType } from "lib/types"; | ||
import { extractMsgType } from "lib/utils"; | ||
|
||
import { MultipleActionsMsg } from "./MultipleActionsMsg"; | ||
import { SingleActionMsg } from "./SingleActionMsg"; | ||
import { SingleMsg } from "./SingleMsg"; | ||
|
||
interface RenderActionMessagesProps { | ||
transaction: AllTransaction | PastTransaction; | ||
} | ||
|
||
export const RenderActionMessages = ({ | ||
transaction, | ||
}: RenderActionMessagesProps) => { | ||
if (transaction.actionMsgType === ActionMsgType.SINGLE_ACTION_MSG) { | ||
return ( | ||
<SingleActionMsg | ||
messages={transaction.messages} | ||
type={extractMsgType(transaction.messages[0].type)} | ||
success={transaction.success} | ||
/> | ||
); | ||
} | ||
if (transaction.actionMsgType === ActionMsgType.MULTIPLE_ACTION_MSG) { | ||
return <MultipleActionsMsg messages={transaction.messages} />; | ||
} | ||
return ( | ||
<SingleMsg | ||
type="Message" | ||
tags={ | ||
transaction.messages.length === 1 | ||
? [extractMsgType(transaction.messages[0].type).substring(3)] | ||
: [transaction.messages.length.toString()] | ||
} | ||
/> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Button } from "@chakra-ui/react"; | ||
import { useWallet } from "@cosmos-kit/react"; | ||
import { BsArrowCounterclockwise } from "react-icons/bs"; | ||
|
||
import { useRedo } from "lib/pages/past-txs/hooks/useRedo"; | ||
import type { Message } from "lib/types"; | ||
import { extractMsgType } from "lib/utils"; | ||
|
||
interface RedoButtonProps { | ||
message: Message; | ||
} | ||
|
||
export const RedoButton = ({ message }: RedoButtonProps) => { | ||
const onClickRedo = useRedo(); | ||
const { currentChainName } = useWallet(); | ||
|
||
return ( | ||
<Button | ||
leftIcon={<BsArrowCounterclockwise />} | ||
variant="outline" | ||
iconSpacing="2" | ||
size="sm" | ||
onClick={(e) => | ||
onClickRedo( | ||
e, | ||
extractMsgType(message.type), | ||
message.msg, | ||
currentChainName | ||
) | ||
} | ||
> | ||
Redo | ||
</Button> | ||
); | ||
}; |
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,32 @@ | ||
import { Button } from "@chakra-ui/react"; | ||
import { useState } from "react"; | ||
|
||
import { FailedModal } from "lib/pages/instantiate/component"; | ||
import { useResend } from "lib/pages/past-txs/hooks/useResend"; | ||
import type { Message } from "lib/types"; | ||
|
||
interface ResendButtonProps { | ||
messages: Message[]; | ||
} | ||
export const ResendButton = ({ messages }: ResendButtonProps) => { | ||
const onClickResend = useResend(); | ||
const [error, setError] = useState(""); | ||
const [isButtonLoading, setIsButtonLoading] = useState(false); | ||
|
||
return ( | ||
<> | ||
<Button | ||
variant="outline" | ||
iconSpacing="0" | ||
size="sm" | ||
onClick={(e) => | ||
onClickResend(e, messages, setIsButtonLoading, setError) | ||
} | ||
isDisabled={isButtonLoading} | ||
> | ||
Resend | ||
</Button> | ||
{error && <FailedModal errorLog={error} onClose={() => setError("")} />} | ||
</> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import { | ||
Modal, | ||
ModalHeader, | ||
Flex, | ||
Icon, | ||
Text, | ||
ModalOverlay, | ||
ModalContent, | ||
ModalCloseButton, | ||
useDisclosure, | ||
ModalBody, | ||
Button, | ||
Heading, | ||
ModalFooter, | ||
} from "@chakra-ui/react"; | ||
import { useWallet } from "@cosmos-kit/react"; | ||
import { BsArrowCounterclockwise } from "react-icons/bs"; | ||
import { MdReplay } from "react-icons/md"; | ||
|
||
import { useRedo } from "lib/pages/past-txs/hooks/useRedo"; | ||
import type { Message } from "lib/types"; | ||
import { extractMsgType } from "lib/utils"; | ||
|
||
interface RedoModalProps { | ||
message: Message; | ||
} | ||
|
||
export const RedoModal = ({ message }: RedoModalProps) => { | ||
const { isOpen, onOpen, onClose } = useDisclosure(); | ||
const onClickRedo = useRedo(); | ||
const { currentChainName } = useWallet(); | ||
|
||
return ( | ||
<> | ||
<Flex onClick={onOpen}> | ||
<Button | ||
leftIcon={<BsArrowCounterclockwise />} | ||
variant="outline" | ||
iconSpacing="2" | ||
size="sm" | ||
> | ||
Redo | ||
</Button> | ||
</Flex> | ||
<Modal isOpen={isOpen} onClose={onClose} isCentered> | ||
<ModalOverlay /> | ||
<ModalContent w="640px"> | ||
<ModalHeader> | ||
<Flex w="full" direction="row" alignItems="center" gap={2} pt={1}> | ||
<Icon as={MdReplay} boxSize={6} color="gray.600" /> | ||
<Heading variant="h5" as="h5"> | ||
Redo Instantiate | ||
</Heading> | ||
</Flex> | ||
</ModalHeader> | ||
<ModalCloseButton color="gray.600" /> | ||
<ModalBody maxH="400px" overflow="overlay"> | ||
<Flex direction="column" gap={5}> | ||
<Flex direction="row" gap={4}> | ||
<Text variant="body1"> | ||
This contract was instantiated through{" "} | ||
<span style={{ fontWeight: 700 }}> | ||
‘MsgInstantiateContract2’ | ||
</span> | ||
, which our app does not currently support. <br /> <br /> You | ||
can instead instantiate the contract using{" "} | ||
<span style={{ fontWeight: 700 }}> | ||
‘MsgInstantiateContract’ | ||
</span>{" "} | ||
for the time being | ||
</Text> | ||
</Flex> | ||
</Flex> | ||
</ModalBody> | ||
<ModalFooter> | ||
<Flex | ||
w="full" | ||
direction="row" | ||
align="center" | ||
justifyContent="end" | ||
gap="4" | ||
> | ||
<Button | ||
cursor="pointer" | ||
variant="ghost" | ||
onClick={onClose} | ||
color="primary.main" | ||
> | ||
Cancel | ||
</Button> | ||
<Button | ||
onClick={(e) => | ||
onClickRedo( | ||
e, | ||
extractMsgType(message.type), | ||
message.msg, | ||
currentChainName | ||
) | ||
} | ||
>{`Redo with \u2018MsgInstantiateContract\u2019`}</Button> | ||
</Flex> | ||
</ModalFooter> | ||
</ModalContent> | ||
</Modal> | ||
</> | ||
); | ||
}; |
Oops, something went wrong.
b45b19d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
osmosis-celatone-frontend-staging – ./
osmosis-celatone-frontend-staging-alles-labs.vercel.app
osmosis-staging.celat.one
celatone-frontend-staging.vercel.app
osmosis-celatone-frontend-staging-git-develop-alles-labs.vercel.app
b45b19d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
terra-celatone-frontend-staging – ./
terra-celatone-frontend-staging-git-develop-alles-labs.vercel.app
terra-staging.celat.one
terra-celatone-frontend-staging.vercel.app
terra-celatone-frontend-staging-alles-labs.vercel.app
b45b19d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
celatone-demo-terra – ./
celatone-demo-terra-alles-labs.vercel.app
celatone-demo-terra-git-develop-alles-labs.vercel.app
celatone-demo-terra.vercel.app