Skip to content

Commit

Permalink
fix: domain navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
blessingbytes committed Jan 28, 2025
1 parent aadcd72 commit 346cfbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
6 changes: 6 additions & 0 deletions pages/identities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ const Identities: NextPage = () => {
execute();
}

useEffect(()=>{
if(ownedIdentities.length > 0 ){
router.push(`/identities/${ownedIdentities[0].id}`);
}
},[ownedIdentities,router])

const connectWallet = async (connector: Connector) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Expand Down
16 changes: 2 additions & 14 deletions pages/identities/[tokenId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,7 @@ const TokenIdPage: NextPage = () => {
.then((response) => response.json())
.then((data) => {
setOwnedIdentities(data.full_ids);
// setLoading(false);
});

// fetch(
// `${
// process.env.NEXT_PUBLIC_SERVER_LINK
// }/addr_to_external_domains?addr=${hexToDecimal(address)}`
// )
// .then((response) => response.json())
// .then((data: ExternalDomains) => {
// setExternalDomains(data.domains);
// });
}
}, [address, router.asPath]);
const connectWallet = async (connector: Connector) => {
Expand All @@ -187,7 +176,6 @@ const TokenIdPage: NextPage = () => {
localStorage.setItem("SID-connectedWallet", connector.id);
localStorage.setItem("SID-lastUsedConnector", connector.id);
};
//console.log({ router: router.query.tokenId, searchParams });
return (
<>
<div className={styles.screen}>
Expand All @@ -202,7 +190,7 @@ const TokenIdPage: NextPage = () => {
<div
className={`${
!hideActions ? "lg:mx-0" : "lg:ml-20 border"
} mx-auto md:mx-0 bg-[#FFFFFF] w-[90%] md:w-[217px] shadow-md rounded-2xl h-[319px] md:h-[533px] md:p-5 relative text-center`}
} mx-auto mt-5 md:mt-0 md:mx-0 bg-[#FFFFFF] w-[90%] md:w-[217px] shadow-sm rounded-2xl h-[319px] md:h-[533px] md:p-5 relative text-center border border-[#4545451A]`}
>
<div className="h-[280px] md:h-[480px] overflow-y-auto">
{ownedIdentities.map((domain, index) => (
Expand All @@ -215,7 +203,7 @@ const TokenIdPage: NextPage = () => {
key={index}
onClick={() => router.push(`/identities/${domain.id}`)}
>
{domain.id}
{domain.domain ? domain.domain : domain.id}
</button>
))}
</div>
Expand Down

0 comments on commit 346cfbc

Please sign in to comment.