mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-12-13 21:02:51 -05:00
Correct formating imports
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { APP_NAME } from '~/lib/constants';
|
||||
import sdk from '@farcaster/frame-sdk';
|
||||
import { useMiniApp } from '@neynar/react';
|
||||
import { APP_NAME } from '~/lib/constants';
|
||||
|
||||
type HeaderProps = {
|
||||
neynarUser?: {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
'use client';
|
||||
|
||||
import { useCallback, useState, useEffect } from 'react';
|
||||
import { Button } from './Button';
|
||||
import { useMiniApp } from '@neynar/react';
|
||||
import { type ComposeCast } from '@farcaster/frame-sdk';
|
||||
import { useMiniApp } from '@neynar/react';
|
||||
import { Button } from './Button';
|
||||
|
||||
interface EmbedConfig {
|
||||
path?: string;
|
||||
@@ -86,7 +86,7 @@ export function ShareButton({
|
||||
// Add UTM parameters
|
||||
url.searchParams.set(
|
||||
'utm_source',
|
||||
`share-cast-${context?.user?.fid || 'unknown'}`
|
||||
`share-cast-${context?.user?.fid || 'unknown'}`,
|
||||
);
|
||||
|
||||
// If custom image generator is provided, use it
|
||||
@@ -98,7 +98,7 @@ export function ShareButton({
|
||||
return url.toString();
|
||||
}
|
||||
return embed.url || '';
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Open cast composer with all supported intents
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import { cn } from '~/lib/utils';
|
||||
|
||||
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
|
||||
@@ -9,13 +8,13 @@ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
|
||||
type={type}
|
||||
className={cn(
|
||||
'flex h-10 w-full rounded-md border border-neutral-200 bg-white px-3 py-2 text-base ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-neutral-950 placeholder:text-neutral-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:border-neutral-800 dark:bg-neutral-950 dark:ring-offset-neutral-950 dark:file:text-neutral-50 dark:placeholder:text-neutral-400 dark:focus-visible:ring-neutral-300',
|
||||
className
|
||||
className,
|
||||
)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
Input.displayName = 'Input';
|
||||
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
import * as React from 'react';
|
||||
import * as LabelPrimitive from '@radix-ui/react-label';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
|
||||
import { cn } from '~/lib/utils';
|
||||
|
||||
const labelVariants = cva(
|
||||
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
|
||||
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
|
||||
);
|
||||
|
||||
const Label = React.forwardRef<
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
'use client';
|
||||
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useMiniApp } from '@neynar/react';
|
||||
import { ShareButton } from '../Share';
|
||||
import { Button } from '../Button';
|
||||
import { SignIn } from '../wallet/SignIn';
|
||||
import { type Haptics } from '@farcaster/frame-sdk';
|
||||
import { useMiniApp } from '@neynar/react';
|
||||
import { Button } from '../Button';
|
||||
import { ShareButton } from '../Share';
|
||||
import { SignIn } from '../wallet/SignIn';
|
||||
|
||||
/**
|
||||
* ActionsTab component handles mini app actions like sharing, notifications, and haptic feedback.
|
||||
@@ -98,7 +98,7 @@ export function ActionsTab() {
|
||||
setTimeout(
|
||||
() =>
|
||||
setNotificationState(prev => ({ ...prev, shareUrlCopied: false })),
|
||||
2000
|
||||
2000,
|
||||
);
|
||||
}
|
||||
}, [context?.user?.fid]);
|
||||
@@ -182,7 +182,7 @@ export function ActionsTab() {
|
||||
value={selectedHapticIntensity}
|
||||
onChange={e =>
|
||||
setSelectedHapticIntensity(
|
||||
e.target.value as Haptics.ImpactOccurredType
|
||||
e.target.value as Haptics.ImpactOccurredType,
|
||||
)
|
||||
}
|
||||
className="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-primary"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
'use client';
|
||||
|
||||
import { useCallback, useMemo, useState, useEffect } from 'react';
|
||||
import { useMiniApp } from '@neynar/react';
|
||||
import { useWallet as useSolanaWallet } from '@solana/wallet-adapter-react';
|
||||
import {
|
||||
useAccount,
|
||||
useSendTransaction,
|
||||
@@ -12,17 +14,15 @@ import {
|
||||
useChainId,
|
||||
type Connector,
|
||||
} from 'wagmi';
|
||||
import { useWallet as useSolanaWallet } from '@solana/wallet-adapter-react';
|
||||
import { base, degen, mainnet, optimism, unichain } from 'wagmi/chains';
|
||||
import { Button } from '../Button';
|
||||
import { truncateAddress } from '../../../lib/truncateAddress';
|
||||
import { renderError } from '../../../lib/errorUtils';
|
||||
import { SignEvmMessage } from '../wallet/SignEvmMessage';
|
||||
import { SendEth } from '../wallet/SendEth';
|
||||
import { SignSolanaMessage } from '../wallet/SignSolanaMessage';
|
||||
import { SendSolana } from '../wallet/SendSolana';
|
||||
import { USE_WALLET, APP_NAME } from '../../../lib/constants';
|
||||
import { useMiniApp } from '@neynar/react';
|
||||
import { renderError } from '../../../lib/errorUtils';
|
||||
import { truncateAddress } from '../../../lib/truncateAddress';
|
||||
import { Button } from '../Button';
|
||||
import { SendEth } from '../wallet/SendEth';
|
||||
import { SendSolana } from '../wallet/SendSolana';
|
||||
import { SignEvmMessage } from '../wallet/SignEvmMessage';
|
||||
import { SignSolanaMessage } from '../wallet/SignSolanaMessage';
|
||||
|
||||
/**
|
||||
* WalletTab component manages wallet-related UI for both EVM and Solana chains.
|
||||
@@ -112,7 +112,7 @@ function ConnectionControls({
|
||||
console.log('Manual Farcaster connection attempt');
|
||||
console.log(
|
||||
'Connectors:',
|
||||
connectors.map((c, i) => `${i}: ${c.name}`)
|
||||
connectors.map((c, i) => `${i}: ${c.name}`),
|
||||
);
|
||||
connect({ connector: connectors[0] });
|
||||
}}
|
||||
@@ -213,7 +213,7 @@ export function WalletTab() {
|
||||
console.log('- User FID:', context.user.fid);
|
||||
console.log(
|
||||
'- Available connectors:',
|
||||
connectors.map((c, i) => `${i}: ${c.name}`)
|
||||
connectors.map((c, i) => `${i}: ${c.name}`),
|
||||
);
|
||||
console.log('- Using connector:', connectors[0].name);
|
||||
console.log('- In Farcaster client:', isInFarcasterClient);
|
||||
@@ -278,7 +278,7 @@ export function WalletTab() {
|
||||
onSuccess: hash => {
|
||||
setEvmContractTransactionHash(hash);
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
}, [sendTransaction]);
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ import {
|
||||
useWaitForTransactionReceipt,
|
||||
} from 'wagmi';
|
||||
import { base } from 'wagmi/chains';
|
||||
import { Button } from '../Button';
|
||||
import { truncateAddress } from '../../../lib/truncateAddress';
|
||||
import { renderError } from '../../../lib/errorUtils';
|
||||
import { truncateAddress } from '../../../lib/truncateAddress';
|
||||
import { Button } from '../Button';
|
||||
|
||||
/**
|
||||
* SendEth component handles sending ETH transactions to protocol guild addresses.
|
||||
|
||||
@@ -6,9 +6,9 @@ import {
|
||||
useWallet as useSolanaWallet,
|
||||
} from '@solana/wallet-adapter-react';
|
||||
import { PublicKey, SystemProgram, Transaction } from '@solana/web3.js';
|
||||
import { Button } from '../Button';
|
||||
import { truncateAddress } from '../../../lib/truncateAddress';
|
||||
import { renderError } from '../../../lib/errorUtils';
|
||||
import { truncateAddress } from '../../../lib/truncateAddress';
|
||||
import { Button } from '../Button';
|
||||
|
||||
/**
|
||||
* SendSolana component handles sending SOL transactions on Solana.
|
||||
@@ -71,7 +71,7 @@ export function SendSolana() {
|
||||
fromPubkey: new PublicKey(fromPubkeyStr),
|
||||
toPubkey: new PublicKey(toPubkeyStr),
|
||||
lamports: 0n,
|
||||
})
|
||||
}),
|
||||
);
|
||||
transaction.recentBlockhash = blockhash;
|
||||
transaction.feePayer = new PublicKey(fromPubkeyStr);
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useAccount, useConnect, useSignMessage } from 'wagmi';
|
||||
import { base } from 'wagmi/chains';
|
||||
import { Button } from '../Button';
|
||||
import { config } from '../../providers/WagmiProvider';
|
||||
import { APP_NAME } from '../../../lib/constants';
|
||||
import { renderError } from '../../../lib/errorUtils';
|
||||
import { config } from '../../providers/WagmiProvider';
|
||||
import { Button } from '../Button';
|
||||
|
||||
/**
|
||||
* SignEvmMessage component handles signing messages on EVM-compatible chains.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
'use client';
|
||||
|
||||
import { useCallback, useState } from 'react';
|
||||
import { signIn, signOut, getCsrfToken } from 'next-auth/react';
|
||||
import sdk, { SignIn as SignInCore } from '@farcaster/frame-sdk';
|
||||
import { signIn, signOut, getCsrfToken } from 'next-auth/react';
|
||||
import { useSession } from 'next-auth/react';
|
||||
import { Button } from '../Button';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
'use client';
|
||||
|
||||
import { useCallback, useState } from 'react';
|
||||
import { Button } from '../Button';
|
||||
import { renderError } from '../../../lib/errorUtils';
|
||||
import { Button } from '../Button';
|
||||
|
||||
interface SignSolanaMessageProps {
|
||||
signMessage?: (message: Uint8Array) => Promise<Uint8Array>;
|
||||
|
||||
Reference in New Issue
Block a user