diff --git a/src/App.tsx b/src/App.tsx
index 2f39ee7..67b1384 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,4 +1,5 @@
import React, { useState, useEffect } from "react";
+import { Typography } from "@material-ui/core";
import { Provider } from "@project-serum/anchor";
// @ts-ignore
import Wallet from "@project-serum/sol-wallet-adapter";
@@ -41,18 +42,25 @@ function App() {
}, [params]);
return (
-
- {isConnected && (
-
-
-
+
+ {isConnected ? (
+
+ ) : (
+ Disconnected
)}
);
diff --git a/src/components/Context.tsx b/src/components/Context.tsx
index c2ab581..92528d5 100644
--- a/src/components/Context.tsx
+++ b/src/components/Context.tsx
@@ -11,7 +11,12 @@ import { TokenListContainer, TokenInfo } from "@solana/spl-token-registry";
import { getOwnedTokenAccounts } from "../utils/tokens";
const SRM_MINT = new PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt");
-const USDC_MINT = new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
+export const USDC_MINT = new PublicKey(
+ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
+);
+export const USDT_MINT = new PublicKey(
+ "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
+);
const SwapContext = React.createContext
(null);
diff --git a/src/components/Swap.tsx b/src/components/Swap.tsx
index 001e6a8..4f22661 100644
--- a/src/components/Swap.tsx
+++ b/src/components/Swap.tsx
@@ -1,5 +1,4 @@
-import React, { useState, useContext } from "react";
-import { BN } from "@project-serum/anchor";
+import { useState } from "react";
import { PublicKey } from "@solana/web3.js";
import { TokenListContainer } from "@solana/spl-token-registry";
import { Provider } from "@project-serum/anchor";
@@ -24,11 +23,13 @@ import {
useOwnedTokenAccount,
useMintAccount,
} from "./Context";
+import TokenDialog from "./TokenDialog";
-const useStyles = makeStyles((theme) => ({
+const useStyles = makeStyles(() => ({
card: {
width: "450px",
borderRadius: "10px",
+ border: "solid 1pt #e0e0e0",
},
cardContent: {
marginLeft: "6px",
@@ -229,6 +230,7 @@ function SwapTokenForm({
amount: number;
setAmount: (a: number) => void;
}) {
+ const [showTokenDialog, setShowTokenDialog] = useState(false);
const tokenAccount = useOwnedTokenAccount(mint);
const mintAccount = useMintAccount(mint);
@@ -241,7 +243,7 @@ function SwapTokenForm({
justifyContent: "space-between",
}}
>
-
+ setShowTokenDialog(true)} />
+ setShowTokenDialog(false)}
+ />
);
}
-function TokenButton({ mint }: { mint: PublicKey }) {
+function TokenButton({
+ mint,
+ onClick,
+}: {
+ mint: PublicKey;
+ onClick: () => void;
+}) {
return (
-