Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unavailable swaps #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/views/JupiterForm/JupiterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const JupiterForm: FunctionComponent<IJupiterFormProps> = (props) => {
<select
id="inputMint"
name="inputMint"
className="mt-1 bg-neutral block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"
className="block w-full py-2 pl-3 pr-10 mt-1 text-base border-gray-300 rounded-md bg-neutral focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"
value={formValue.inputMint?.toBase58()}
onChange={(e) => {
const pbKey = new PublicKey(e.currentTarget.value);
Expand All @@ -99,10 +99,10 @@ const JupiterForm: FunctionComponent<IJupiterFormProps> = (props) => {
}
}}
>
{allTokenMints.map((tokenMint) => {
{allTokenMints.filter(tokenMint => tokenMap.has(tokenMint)).map((tokenMint) => {
return (
<option key={tokenMint} value={tokenMint}>
{tokenMap.get(tokenMint)?.name || "unknown"}
{tokenMap.get(tokenMint)?.name || tokenMap.get(tokenMint)?.symbol || "unknown"}
</option>
);
})}
Expand All @@ -116,7 +116,7 @@ const JupiterForm: FunctionComponent<IJupiterFormProps> = (props) => {
<select
id="outputMint"
name="outputMint"
className="mt-1 bg-neutral block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"
className="block w-full py-2 pl-3 pr-10 mt-1 text-base border-gray-300 rounded-md bg-neutral focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"
value={formValue.outputMint?.toBase58()}
onChange={(e) => {
const pbKey = new PublicKey(e.currentTarget.value);
Expand All @@ -128,10 +128,10 @@ const JupiterForm: FunctionComponent<IJupiterFormProps> = (props) => {
}
}}
>
{validOutputMints.map((tokenMint) => {
{validOutputMints.filter(tokenMint => tokenMap.has(tokenMint)).map((tokenMint) => {
return (
<option key={tokenMint} value={tokenMint}>
{tokenMap.get(tokenMint)?.name || "unknown"}
{tokenMap.get(tokenMint)?.name || tokenMap.get(tokenMint)?.symbol || "unknown"}
</option>
);
})}
Expand All @@ -146,7 +146,7 @@ const JupiterForm: FunctionComponent<IJupiterFormProps> = (props) => {
<input
name="amount"
id="amount"
className="shadow-sm bg-neutral p-2 focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md"
className="block w-full p-2 border-gray-300 rounded-md shadow-sm bg-neutral focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"
value={formValue.amount}
type="text"
pattern="[0-9]*"
Expand Down Expand Up @@ -248,7 +248,7 @@ const JupiterForm: FunctionComponent<IJupiterFormProps> = (props) => {
}
}
}}
className="inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
className="inline-flex items-center px-4 py-2 text-base font-medium text-white bg-indigo-600 border border-transparent rounded-md shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
>
Swap Best Route
</button>
Expand Down