@@ -3,8 +3,11 @@ import { useState, useEffect, useRef } from 'react';
33import { useSearch } from '../hooks/useSearch' ;
44import { useProfile } from '../hooks/useProfile' ;
55import { Link } from '@tanstack/react-router' ;
6- import { LuSearch , LuMapPin , LuMail , LuGlobe , LuTwitter , LuGithub , LuMessageSquare , LuSend } from "react-icons/lu" ;
6+ import { LuSearch , LuMapPin , LuMail , LuGlobe , LuTwitter , LuGithub , LuMessageSquare , LuSend , LuWallet } from "react-icons/lu" ;
77import { useDebounce } from 'use-debounce' ;
8+ import { getChainIconUrl } from '../utils/chainIcons' ;
9+ import { shouldAttemptDirectLookup } from '../utils/validation' ;
10+ import { ChainIcon } from '../components/ChainIcon' ;
811
912export const Route = createLazyFileRoute ( '/' ) ( {
1013 component : Home ,
@@ -172,7 +175,7 @@ function Home() {
172175
173176 { /* Profile information with avatar */ }
174177 < div className = "p-2" >
175- < div className = "flex items-start space-x-2" >
178+ < div className = "flex items-start space-x-2 pb-3 " >
176179 { /* Avatar */ }
177180 < div className = { `${ profile . header || profile . records ?. header ? '-mt-7' : '' } flex-shrink-0` } >
178181 { getProfilePicture ( profile ) ? (
@@ -200,6 +203,22 @@ function Home() {
200203 { getDescription ( profile ) }
201204 </ p >
202205
206+ { /* Chain addresses */ }
207+ { profile . chains && Object . keys ( profile . chains ) . length > 0 && (
208+ < div className = "mt-1.5 flex flex-wrap gap-x-2 gap-y-1" >
209+ { Object . entries ( profile . chains ) . map ( ( [ chain , address ] ) => (
210+ < div key = { chain } className = "flex items-center text-xs text-gray-500" title = { `${ chain . toUpperCase ( ) } : ${ address } ` } >
211+ < ChainIcon
212+ chain = { chain }
213+ iconUrl = { getChainIconUrl ( chain ) }
214+ className = "mr-1"
215+ />
216+ < span className = "truncate max-w-[100px]" > { address } </ span >
217+ </ div >
218+ ) ) }
219+ </ div >
220+ ) }
221+
203222 { /* Profile metadata - making it more compact */ }
204223 < div className = "mt-1.5 flex flex-wrap gap-x-3 gap-y-1 text-xs text-gray-500" >
205224 { profile . records ?. location && (
@@ -256,12 +275,21 @@ function Home() {
256275 ) ;
257276 }
258277
259- // Case 2: No results found for an active search - try direct profile lookup
260- if ( debouncedSearchTerm && ! isInitialLoading && ! isLoading ) {
278+ // Case 2: No results found for an active search - try direct profile lookup only if it looks like an ENS name or address
279+ if ( debouncedSearchTerm && ! isInitialLoading && ! isLoading && shouldAttemptDirectLookup ( debouncedSearchTerm ) ) {
261280 return < ProfileFallback searchTerm = { debouncedSearchTerm } /> ;
262281 }
263282
264- // Case 3: Initial loading with no previous data
283+ // Case 3: No results found and not a valid ENS name/address format
284+ if ( debouncedSearchTerm && ! isInitialLoading && ! isLoading ) {
285+ return (
286+ < div className = "p-6 text-center" >
287+ < p className = "text-gray-500" > No results found for "{ debouncedSearchTerm } "</ p >
288+ </ div >
289+ ) ;
290+ }
291+
292+ // Case 4: Initial loading with no previous data
265293 if ( isInitialLoading ) {
266294 return (
267295 < div className = "text-center p-6" >
@@ -273,10 +301,13 @@ function Home() {
273301 ) ;
274302 }
275303
276- // Case 4 : Default state - no search input yet
304+ // Case 5 : Default state - no search input yet
277305 return (
278306 < div className = "p-6 text-center" >
279307 < p className = "text-gray-500" > Enter a search term to find profiles</ p >
308+ < p className = "text-sm text-gray-400 mt-2" >
309+ Try searching for an ENS name (e.g., "vitalik.eth") or an Ethereum address
310+ </ p >
280311 </ div >
281312 ) ;
282313 } ;
0 commit comments