Skip to content

Commit

Permalink
Merge branch 'main' into env/mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
canhtrinh committed Jan 18, 2024
2 parents c3d5768 + 4054ec9 commit 8359973
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ export const InterchainTokenList: FC<InterchainTokenListProps> = ({

if (hasPartialSelection) {
// select the remaining tokens
unselectedTokens?.forEach((token, i) => {
const partialTokens =
unselectedTokens.length > selectedTokens.length
? unselectedTokens
: selectedTokens;
partialTokens?.forEach((token, i) => {
setTimeout(() => onToggleSelection?.(token.chainId), i * 25);
});
return;
Expand All @@ -51,7 +55,7 @@ export const InterchainTokenList: FC<InterchainTokenListProps> = ({
tokens?.forEach((token, i) => {
setTimeout(() => onToggleSelection?.(token.chainId), i * 25);
});
}, [onToggleSelection, selectedTokens.length, tokens, unselectedTokens]);
}, [onToggleSelection, selectedTokens, tokens, unselectedTokens]);

if (!tokens.length) {
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import { Card, Tabs } from "@axelarjs/ui";
import { FC, useState } from "react";
import { useState, type FC, type ReactNode } from "react";

import { useAccount } from "wagmi";

import RecentTransactionsList from "./RecentTransactionsList";
import { CONTRACT_METHODS, type ContractMethod } from "./types";

export const CONTRACT_METHODS_LABELS: Partial<Record<ContractMethod, string>> =
{
InterchainTransfer: "Interchain Transfer",
InterchainTokenDeploymentStarted: "Token Deployment",
};
export const CONTRACT_METHODS_LABELS: Partial<
Record<ContractMethod, ReactNode>
> = {
InterchainTransfer: "Interchain Transfer",
InterchainTokenDeploymentStarted: (
<>
Interchain <span className="mx-1 hidden md:block">Token</span> Deployment
</>
),
};

type Props = {
maxTransactions?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export function useSendInterchainTokenState(props: {
const eligibleTargetChains = useMemo(() => {
return (referenceToken?.matchingTokens ?? [])
.filter((x) => x.isRegistered && x.chainId !== props.sourceChain.chain_id)
.map((x) => computed.indexedByChainId[x.chainId ?? 0]);
.map((x) => computed.indexedByChainId[x.chainId ?? 0])
.filter(Boolean);
}, [
referenceToken?.matchingTokens,
props.sourceChain.chain_id,
Expand Down
23 changes: 20 additions & 3 deletions apps/maestro/src/features/Transactions/Transactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,28 @@ const ToastElement: FC<{
</>
);

const [, actions] = useTransactionsContainer();

const handleDismiss = useCallback(() => {
toast.dismiss(txHash);

// dismiss permanently if tx status is error or insufficient_fee
if (
groupedStatusesProps.some(
(x) => x.status === "error" || x.status === "insufficient_fee"
)
) {
actions.removeTransaction(txHash);
}
}, [actions, groupedStatusesProps, txHash]);

return (
<div className="bg-base-300 border-base-200 relative grid gap-2 rounded-md p-2 pl-4 pr-8 shadow-md shadow-black/10">
<Button
className="absolute right-2 top-2"
size="xs"
shape="circle"
onClick={toast.dismiss.bind(null, txHash)}
onClick={handleDismiss}
>
<XIcon size={12} />
</Button>
Expand All @@ -163,11 +178,13 @@ const ToastElement: FC<{
);
};

const GMPTransaction: FC<{
type GMPTxStatusProps = {
txHash: `0x${string}`;
chainId: number;
txType?: keyof typeof TX_LABEL_MAP;
}> = (props) => {
};

const GMPTransaction: FC<GMPTxStatusProps> = (props) => {
const {
computed: { chains: total, executed },
isLoading,
Expand Down
4 changes: 2 additions & 2 deletions apps/maestro/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ export default function Home() {
<div className="mt-4">
<section className="my-10 space-y-4">
<div className="text-center text-xl font-bold">
RECENT INTERCHAIN TRANSACTIONS
{Boolean(chain) && "MY "}RECENT INTERCHAIN TRANSACTIONS
</div>
<RecentTransactions maxTransactions={10} />
<RecentTransactions maxTransactions={50} />
</section>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions apps/maestro/src/ui/layouts/MainLayout/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ const TestnetBanner = ({ onClose = () => {} }) => (
</Button>
<Card.Title>New to the Interchain Token Service?</Card.Title>
<p>
Run a few flows in our testnet (with test tokens) and experiment here
with small amounts first.
We encourage you to experiment with{" "}
<a href={process.env.NEXT_PUBLIC_TESTNET_URL}>testnet</a> first!
</p>
<Card.Actions className="justify-end">
<LinkButton
Expand Down

1 comment on commit 8359973

@vercel
Copy link

@vercel vercel bot commented on 8359973 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.