Skip to content

Commit

Permalink
pull wallet name as env variable instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mackenziewildman committed Jul 12, 2023
1 parent bb93ef9 commit e47fe54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/app/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ interface HomeProps {
}

export default function Home({ session }: HomeProps) {
const chainName = (process.env.NEXT_PUBLIC_CHAIN_NAME === undefined) ? "Solana": process.env.NEXT_PUBLIC_CHAIN_NAME;
const me = useMe();
const dropQuery = useQuery(GetDrop);
const collection = dropQuery.data?.drop.collection;
Expand Down Expand Up @@ -94,7 +95,7 @@ export default function Home({ session }: HomeProps) {
>
<div className='rounded-lg bg-contrast p-6 flex flex-col items-center mt-4'>
<span className='text-xs text-gray-300'>
{me?.assetType == "SOL"? "Solana": me?.assetType == "MATIC"? "Polygon": ""} wallet address
{chainName} wallet address
</span>
<div className='flex gap-2 mt-1'>
<span className='text-xs'>
Expand Down
9 changes: 4 additions & 5 deletions src/app/collectibles/[collectible]/transfer/Transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { useForm } from 'react-hook-form';
import { Icon } from '../../../../components/Icon';
import useMe from '@/hooks/useMe';

interface TransferMintData {
transferAsset: TransferAssetPayload;
Expand All @@ -24,8 +23,8 @@ interface TransferForm {
export default function Transfer({ collectible }: { collectible: string }) {
const router = useRouter();
const [nftSent, setNftSent] = useState<boolean>(false);

const me = useMe();
const chainName = (process.env.NEXT_PUBLIC_CHAIN_NAME === undefined) ? "Solana": process.env.NEXT_PUBLIC_CHAIN_NAME;

const { register, handleSubmit, formState, setError } =
useForm<TransferForm>();
Expand Down Expand Up @@ -59,15 +58,15 @@ export default function Transfer({ collectible }: { collectible: string }) {
return (
<div className='flex flex-col justify-center items-center min-h-screen w-[366px]'>
<h1 className='text-3xl font-bold text-center'>
Send this NFT to a {me?.assetType == "SOL"? "Solana": me?.assetType == "MATIC"? "Polygon": ""} wallet
Send this NFT to a {chainName} wallet
</h1>
{!nftSent ? (
<form
className='flex flex-col mt-14 w-full'
onSubmit={handleSubmit(submit)}
>
<label className='text-sm text-subtletext' htmlFor='wallet'>
{me?.assetType == "SOL"? "Solana": me?.assetType == "MATIC"? "Polygon": ""} wallet address
{chainName} wallet address
</label>
<input
id='wallet'
Expand Down

0 comments on commit e47fe54

Please sign in to comment.