Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Navigation, Fallback, Code Snippets, Reverse Resolution, and I… #254

Merged
merged 1 commit into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions app/local/config/navigation/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ export const navigation: SectionData[] = [
title: 'Web & Querying',
icon: '🌐',
links: [
{
title: 'Quickstart',
href: '/web/quickstart',
icon: '⚡',
},
{
title: 'Tools and Libraries',
href: '/web/libraries',
icon: '🛠️',
},
{
title: 'Quickstart',
href: '/web/quickstart',
icon: '⚡',
},
{
title: 'Address Lookup',
href: '/web/resolution',
Expand All @@ -109,11 +109,6 @@ export const navigation: SectionData[] = [
href: '/web/reverse',
icon: '🔍',
},
{
title: 'Multichain',
href: '/web/multichain',
icon: '⛓️',
},
{
title: 'List Names',
href: '/web/enumerate',
Expand All @@ -133,6 +128,11 @@ export const navigation: SectionData[] = [
title: 'Issuing Subdomains',
href: '/web/subdomains',
},
{
title: 'Multichain',
href: '/web/multichain',
icon: '⛓️',
},
{
title: 'Subgraph',
href: '/web/subgraph',
Expand Down
14 changes: 14 additions & 0 deletions app/public/fallback.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/resolution/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,11 @@ More about loading information from a resolver can be found [here](/resolvers/in

In addition, all of the above functions can be sent to the `resolve()` function, specified in [ENSIP-10](/ensip/10).
This allows for not only multicall functionality, but also easier implementation of EIP-3668, and more.

## Reverse Resolution

Due to the modular nature of how ENS is designed, it is also possible to lookup the "primary name" of an address.
This process actually uses forward resolution under the hood, you read that right - its just forwards resolution.

To look up the primary name of a given address you must do a resolver lookup for `addr.reverse` and then query the `name()` field on the resolver.
This name field returns the "preferred" name for the address. Note that the implementing client MUST perform a forward resolution on this name to verify the address matches the one you are looking up.
102 changes: 102 additions & 0 deletions docs/web/index.mdx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should some of these new elements be broken out into reusable components?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fallback image doesn't seem to be working for luc.cash and puma.eth. I assume this is because https://docs.ens.domains/fallback.svg won't exist until this PR is merged but wanted to double check

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: update to dark border color

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,60 @@ export const meta = {

This section walks you through how to leverage the ENS open standards to improve the user experience of your app.

<div className="card1 px-8 py-4 space-y-3">
<div className="flex justify-center items-stretch gap-2">
<div className="not-prose border px-3 p-2 flex flex-col rounded-md justify-between">
<span>0x225...c3B5</span>
<span>0x179...9285</span>
<span>0xd8d...6045</span>
<span>0x225...c3B5</span>
<span>0x225...c3B5</span>
</div>
<span className="pt-3 flex flex-col">
<span>➡️</span>
<span className="opacity-90">➡️</span>
<span className="opacity-75">➡️</span>
<span className="opacity-50">➡️</span>
<span className="opacity-25">➡️</span>
</span>
<div className="border not-prose px-3 p-2 gap-2 flex flex-col rounded-md">
{[
'luc.eth', 'gregskril.eth', 'vitalik.eth', 'luc.cash', 'puma.eth'].map((name) => (
<div className="flex items-center gap-2">
<div className="w-8 aspect-square">
<object data={"https://enstate.rs/i/" + name} type="image/jpeg" className="bg-blue-500 w-full h-full">
<img src="https://docs.ens.domains/fallback.svg" />
</object>
</div>
<span>{name}</span>
</div>
))}
</div>
</div>
</div>

<div className="card1 px-8 py-4 space-y-3">
<div className="flex justify-center items-start gap-2">
<div className="border not-prose px-3 p-2 gap-2 flex flex-col rounded-md">
<div className="flex items-center gap-2">
<div className="w-8 aspect-square">
<object data={"https://enstate.rs/i/luc.eth"} type="image/jpeg" className="bg-blue-500 w-full h-full">
<img src="https://docs.ens.domains/fallback.svg" />
</object>
</div>
<span>luc.eth</span>
</div>
</div>
<span className="pt-3">
<span>➡️</span>
</span>
<div className="not-prose border px-3 p-2 flex flex-col rounded-md justify-start gap-1">
<span>DevRel @ ENS. Create Epic Shit</span>
<span>0x225...c3B5</span>
</div>
</div>
</div>

## Quickstart

If you are looking to jumpstart your journey with ENS, or you are looking for a quick reference, visit the [Quickstart](/web/quickstart) page.
Expand Down Expand Up @@ -42,6 +96,33 @@ If you just want to see some code in action we have a variety of codesnippet & t

## Avatars, Addresses & Records

<div className="card1 px-8 py-4 space-y-3">
<div className="flex justify-center items-start gap-2">
<div className="border not-prose px-3 p-2 gap-2 flex flex-col rounded-md">
<div className="flex items-center gap-2">
{
['gregskril.eth', 'matoken.eth', 'luc.eth'].map(name => (
<div className="w-8 aspect-square">
<object data={"https://enstate.rs/i/" + name} type="image/jpeg" className="bg-blue-500 w-full h-full">
<img src="https://docs.ens.domains/fallback.svg" />
</object>
</div>
))
}
</div>
</div>
<div className="not-prose border px-3 p-2 flex flex-col rounded-md justify-start gap-1">
<span>0x179...9285</span>
<span>0x5A3...0615</span>
<span>0x225...c3B5</span>
</div>
<div className="not-prose border px-3 p-2 flex flex-col rounded-md justify-start gap-1">
<span>DevRel @ ENS. Create Epic Shit</span>
<span>Europe/Amsterdam</span>
</div>
</div>
</div>

Information about a name can be fetched from its resolver, this can be done using pre-built features included in your tooling, or manually by calling the resolver contract directly.
If you're interested in interacting with the resolver contract directly, you might find the [Resolver Reference](/resolvers/interfaces) section helpful.

Expand All @@ -53,6 +134,17 @@ If you're interested in interacting with the resolver contract directly, you mig

## Subnames

<div className="card1 p-4 flex justify-center items-center overflow-hidden text-xl">
<div className="text-right font-bold">
{
["vault", "domico", "subname", "nick", "cold"].map((subname, i) => (
<div className={["opacity-20", "opacity-50", "", "opacity-50", "opacity-20"][i]}>{subname}</div>
))
}
</div>
<div className="font-bold text-ens-light-yellow-primary dark:text-ens-dark-yellow-primary">.nick.eth</div>
</div>

<EmbedLink
href="/web/subdomains"
title="Issuing Subnames"
Expand All @@ -61,6 +153,16 @@ If you're interested in interacting with the resolver contract directly, you mig

## Registration

<div className="card1 p-4 flex justify-center items-center overflow-hidden text-xl">
<div className="text-right font-bold">
{
["vault", "domico", "subname", "nick", "cold"].map((subname, i) => (
<div className={["opacity-20", "opacity-50", "", "opacity-50", "opacity-20"][i]}>{subname}</div>
))
}
</div>
<div className="font-bold dark:text-ens-dark-blue-primary text-ens-light-blue-primary">.eth</div>
</div>
<EmbedLink
href="/registry/eth"
title="ETH Registrar"
Expand Down
12 changes: 4 additions & 8 deletions docs/web/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,17 @@ import { formatAddress } from 'ens-tools';

export const YourApp: FC = () => {
const { address } = useAccount();
const { data: ensName } = useEnsName({
address,
});
const { data: ensAvatar } = useEnsAvatar({
address,
});
const { data: name } = useEnsName({ address });
const { data: avatar } = useEnsAvatar({ name });

return (
<div className="flex items-center gap-2">
<img
src={ensAvatar || 'https://v3x.space/ens-docs/pfp.webp'}
src={avatar || 'https://docs.ens.domains/fallback.svg'}
className="w-8 h-8 rounded-full"
/>
<div className="flex flex-col gap-0 leading-3 pr-10">
{ensName && <span className="font-bold">{ensName}</span>}
{name && <span className="font-bold">{name}</span>}
<span>{formatAddress(address)}</span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/web/records.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ The image is then displayed as a banner on the profile page and tends to be in a
<div className="">
<div className="flex gap-4 not-prose">
{
["luc.eth", "pedrouid.eth", "notben.eth"].map(async (name) => {
["luc.eth", "pedrouid.eth", "coltron.eth"].map(async (name) => {
const request = await fetch("https://worker.enstate.rs/n/" + name);
const data = await request.json();

Expand Down
Loading