Skip to content

Commit

Permalink
Merge pull request #3 from fakepixels/tina-debug-1006
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
fakepixels authored Oct 6, 2024
2 parents bdb2317 + 970331c commit 863ecec
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ a {
}

.templateSection > div {
max-width: 100%;;
max-width: 100%;
}
29 changes: 16 additions & 13 deletions src/components/IdentityWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { normalize } from 'viem/ens';
import { useAccount } from 'wagmi';
import { publicClient } from '../client';
import { motion } from 'framer-motion'; // Import framer-motion
import { FarcasterSocialIcon } from './FarcasterIcon';
import { FarcasterSocialIcon } from '../svg/FarcasterIcon';

export default function IdentityWrapper() {
const { address } = useAccount();
Expand All @@ -22,8 +22,9 @@ export default function IdentityWrapper() {
const [isOpen, setIsOpen] = useState(false); // State to manage dropdown visibility

useEffect(() => {
console.log('Address:', address); // Debug log

const fetchEnsText = async () => {

if (address) {
const cachedData = localStorage.getItem(address);
if (cachedData) {
Expand All @@ -32,37 +33,38 @@ export default function IdentityWrapper() {
}

try {
const name = await getName({ chain: base, address: address }); // Get the name of the address
console.log('Name:', name);
const normalizedAddress = normalize(name as string); // Normalize the fetched name
console.log('Normalized Address:', normalizedAddress);

const name = await getName({ chain: base, address: address });
const normalizedAddress = normalize(name as string);

const twitterText = await publicClient.getEnsText({
name: normalizedAddress,
key: 'com.twitter',
});

const githubText = await publicClient.getEnsText({
name: normalizedAddress,
key: 'com.github',
});

const farcasterText = await publicClient.getEnsText({
name: normalizedAddress,
key: 'xyz.farcaster',
});

const urlText = await publicClient.getEnsText({
name: normalizedAddress,
key: 'url',
});
console.log('ENS Text Responses:', {
twitterText,
githubText,
urlText,
});


const fetchedData = {
twitter: twitterText,
github: githubText,
farcaster: farcasterText,
url: urlText,
};

setEnsText(fetchedData);
localStorage.setItem(address, JSON.stringify(fetchedData));
} catch (error) {
Expand All @@ -82,8 +84,9 @@ export default function IdentityWrapper() {
animate={{ opacity: 1, y: 0 }} // Animated state
transition={{ duration: 0.5 }} // Animation duration
>

{/* biome-ignore lint/a11y/useKeyWithClickEvents: <explanation> */}
<div className='flex cursor-pointer items-center justify-between space-x-2 rounded-full bg-white bg-opacity-20 p-2 transition-all duration-300 hover:bg-opacity-30' onClick={() => setIsOpen(!isOpen)}>
<div className='flex cursor-pointer items-center justify-between space-x-2 rounded-full bg-white bg-opacity-20 p-2 transition-all duration-300 hover:bg-opacity-30' onClick={() => setIsOpen(!isOpen)}>
<div className='flex items-center space-x-2'>
<Avatar address={address} chain={base} />
<Name address={address} chain={base} className="text-m text-white" />
Expand Down Expand Up @@ -150,7 +153,7 @@ export default function IdentityWrapper() {
)}
</motion.div>
) : (
<div className="text-white">
<div className='text-center text-white'>
Connect your wallet to view your profile card.
</div>
)}
Expand Down
11 changes: 1 addition & 10 deletions src/components/WalletWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import {
ConnectWallet,
Wallet,
WalletDropdown,
WalletDropdownBasename,
WalletDropdownDisconnect,
WalletDropdownFundLink,
WalletDropdownLink,

} from '@coinbase/onchainkit/wallet';

type WalletWrapperParams = {
Expand Down Expand Up @@ -46,14 +45,6 @@ export default function WalletWrapper({
<Address />
<EthBalance />
</Identity>
<WalletDropdownBasename />
<WalletDropdownLink
icon="wallet"
target="_blank"
href="https://wallet.coinbase.com"
>
Wallet
</WalletDropdownLink>
<WalletDropdownFundLink text="Fund" />
<WalletDropdownDisconnect />
</WalletDropdown>
Expand Down
File renamed without changes.
27 changes: 27 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,33 @@ const config: Config = {
fontFamily: {
sans: ['DM Sans', 'sans-serif'],
},
fontSize: {
'xs': ['0.75rem', { lineHeight: '1rem' }],
'sm': ['0.875rem', { lineHeight: '1.25rem' }],
'base': ['1rem', { lineHeight: '1.5rem' }],
'lg': ['1.125rem', { lineHeight: '1.75rem' }],
'xl': ['1.25rem', { lineHeight: '1.75rem' }],
'2xl': ['1.5rem', { lineHeight: '2rem' }],
'3xl': ['1.875rem', { lineHeight: '2.25rem' }],
'4xl': ['2.25rem', { lineHeight: '2.5rem' }],
'5xl': ['3rem', { lineHeight: '1' }],
'6xl': ['3.75rem', { lineHeight: '1' }],
'7xl': ['4.5rem', { lineHeight: '1' }],
'8xl': ['6rem', { lineHeight: '1' }],
'9xl': ['8rem', { lineHeight: '1' }],
},
spacing: {
'1': '0.25rem',
'2': '0.5rem',
'3': '0.75rem',
'4': '1rem',
'5': '1.25rem',
'6': '1.5rem',
'7': '1.75rem',
'8': '2rem',
'9': '2.25rem',
'10': '2.5rem',
},
},
container: {
center: true,
Expand Down

0 comments on commit 863ecec

Please sign in to comment.