This repository was archived by the owner on Aug 5, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
chore: Apply minor UI/UX updates to ensv2-ready-resolution best practice
#231
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
09559a1
Apply feedback item 1 from the 06/16/26 Google Doc
Y3drk 5f35423
Apply feedback item 5 from the 06/16/26 Google Doc - update AT benchm…
Y3drk 8d604eb
Apply feedback items 2 & 3 from the 06/16/26 Google Doc
Y3drk 484b7d4
Resolving conflicts with main
Y3drk c1260d8
Apply feedback item 4 from the 06/16/26 Google Doc
Y3drk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,16 @@ | ||
| import { getDefinedApps } from "./registry.ts"; | ||
| import type { App } from "./types.ts"; | ||
| import { type App, type AppType, AppTypes } from "./types.ts"; | ||
|
|
||
| import.meta.glob("./*/index.ts", { eager: true }); | ||
|
|
||
| export const APPS: App[] = [...getDefinedApps()]; | ||
|
|
||
| /** | ||
| * Display groups of the app leaderboard snippets on the main page. | ||
| * * Divides the app types into two groups based on their position on the landing page (top and bottom). | ||
| * * Decides the order of the app types inside each group. | ||
| */ | ||
|
|
||
| export const TOP_DISPLAY_APP_TYPES: AppType[] = [AppTypes.Wallet, AppTypes.DeFi]; | ||
|
|
||
| export const BOTTOM_DISPLAY_APP_TYPES: AppType[] = [AppTypes.Exchange, AppTypes.Explorer]; |
Binary file modified
BIN
+12.1 KB
(130%)
...alletchan-wallet/benchmarks/correctly-resolve-ensv2-test-name-address-proof.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-371 KB
(6.7%)
...dy-resolution/images/correctly-resolve-ensv2-test-name-address-fail-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32 KB
...ion/images/correctly-resolve-ensv2-test-name-address-not-applicable-example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+56.1 KB
...dy-resolution/images/correctly-resolve-ensv2-test-name-address-pass-example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-32.5 KB
...dy-resolution/images/correctly-resolve-ensv2-test-name-address-pass-example.png
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
ensawards.org/src/components/organisms/AppLeaderboardSnippet.astro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| --- | ||
| import { Image } from "astro:assets"; | ||
| import type { ImageMetadata } from "astro"; | ||
| import LeaderboardCard from "@/components/atoms/cards/LeaderboardCard.astro"; | ||
| import ItemsList from "@/components/molecules/ItemsList.astro"; | ||
| import { shadcnButtonVariants } from "@/components/ui/shadcnButtonStyles"; | ||
| import { APPS } from "data/apps"; | ||
| import { type AppType } from "data/apps/types.ts"; | ||
| import { cn } from "@/utils/tailwindClassConcatenation"; | ||
| import { formatBestPracticeTarget } from "data/ens-best-practices/utils.ts"; | ||
| import { calcAppScore, sortApps, formatAppType } from "data/apps/utils.ts"; | ||
|
|
||
| interface Props { | ||
| appType: AppType; | ||
| } | ||
|
|
||
| const { appType } = Astro.props; | ||
|
|
||
| const images = import.meta.glob<{ default: ImageMetadata }>("/src/assets/*.{jpeg,jpg,png,gif,svg}"); | ||
| const placeIcons = [ | ||
| "/src/assets/firstPlaceAward.svg", | ||
| "/src/assets/secondPlaceAward.svg", | ||
| "/src/assets/thirdPlaceAward.svg", | ||
| ]; | ||
|
|
||
| const relevantApps = APPS.filter((app) => app.type === appType); | ||
| const rankedApps = relevantApps | ||
| .map((app) => ({ app, score: calcAppScore(app) })) | ||
| .sort((a, b) => sortApps(a.app, b.app)) | ||
| .slice(0, 3); | ||
| --- | ||
|
|
||
| { | ||
| rankedApps.length > 0 && ( | ||
| <ItemsList | ||
| header={`Top ${formatBestPracticeTarget(appType, { lowercase: false, plural: true })}`} | ||
| containerStyles="gap-3 sm:gap-2 sm:justify-start max-sm:justify-center"> | ||
| {rankedApps.map(({ app, score }, idx) => { | ||
| const AppIcon = app.icon; | ||
| return ( | ||
| <LeaderboardCard | ||
| key={`${appType}-review-card-${app.id}`} | ||
| name={app.name} | ||
| ensAwardsScore={score} | ||
| viewDetailsHref={`/app/${app.appSlug}`} | ||
| viewDetailsText={`${formatAppType(appType, { plural: false, lowercase: false })} report`}> | ||
| <AppIcon slot="rankedEntityIcon" className="w-10 h-10 rounded-md" /> | ||
| <Image | ||
| alt={`${idx + 1}-place`} | ||
| src={images[placeIcons[idx]]()} | ||
| slot="placeIcon" | ||
| /> | ||
| </LeaderboardCard> | ||
| ); | ||
| })} | ||
| <a | ||
| href={`/leaderboards/${appType}`} | ||
| class={cn( | ||
| shadcnButtonVariants({ | ||
| variant: "ghost", | ||
| size: "default", | ||
| className: "cursor-pointer rounded-full text-sm max-sm:w-full", | ||
| }), | ||
| )}> | ||
| View full {formatAppType(appType, { plural: false, lowercase: true })}{" "} | ||
| leaderboard | ||
| </a> | ||
| </ItemsList> | ||
| ) | ||
| } |
82 changes: 82 additions & 0 deletions
82
ensawards.org/src/components/organisms/ProtocolLeaderboardSnippet.astro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| --- | ||
| import { Image } from "astro:assets"; | ||
| import type { ImageMetadata } from "astro"; | ||
| import LeaderboardCard from "@/components/atoms/cards/LeaderboardCard.astro"; | ||
| import ItemsList from "@/components/molecules/ItemsList.astro"; | ||
| import type { ProtocolType } from "data/protocols/types"; | ||
| import { getContractNamingScoresByProtocolType } from "@/contract-pipelines/utils.ts"; | ||
| import { getProtocolById, formatProtocolType } from "data/protocols/utils.ts"; | ||
| import { type ProtocolId } from "data/protocols/types.ts"; | ||
| import { shadcnButtonVariants } from "@/components/ui/shadcnButtonStyles"; | ||
| import { formatBestPracticeTarget } from "data/ens-best-practices/utils.ts"; | ||
| import { cn } from "@/utils/tailwindClassConcatenation"; | ||
| import { EnsAwardsScoreResultTypes } from "data/shared/ens-awards-score"; | ||
|
|
||
| interface Props { | ||
| protocolType: ProtocolType; | ||
| } | ||
|
|
||
| const { protocolType } = Astro.props; | ||
|
|
||
| const images = import.meta.glob<{ default: ImageMetadata }>("/src/assets/*.{jpeg,jpg,png,gif,svg}"); | ||
| const placeIcons = [ | ||
| "/src/assets/firstPlaceAward.svg", | ||
| "/src/assets/secondPlaceAward.svg", | ||
| "/src/assets/thirdPlaceAward.svg", | ||
| ]; | ||
|
|
||
| const protocolScores = getContractNamingScoresByProtocolType(protocolType); | ||
|
|
||
| const protocolScoresEntries = [...Object.entries(protocolScores)]; | ||
| --- | ||
|
|
||
| { | ||
| protocolScoresEntries.length > 0 && ( | ||
| <ItemsList | ||
| header={`Top ${formatBestPracticeTarget(protocolType, { lowercase: false, plural: true })}`} | ||
| containerStyles="gap-3 sm:gap-2 sm:justify-start max-sm:justify-center"> | ||
| {protocolScoresEntries | ||
| .slice(0, 3) | ||
| .map(([scoredProtocolId, ensAwardsScore], idx) => { | ||
| // Type casting is necessary due to `Record`'s type nature. | ||
| // We are completely sure of its correctness | ||
| const protocolId = scoredProtocolId as ProtocolId; | ||
| const protocol = getProtocolById(protocolId); | ||
| const ProtocolIcon = protocol.icon; | ||
| return ( | ||
| <LeaderboardCard | ||
| key={`leaderboard-card-${protocol.protocolSlug}`} | ||
| name={protocol.name} | ||
| ensAwardsScore={{ | ||
| type: EnsAwardsScoreResultTypes.Defined, | ||
| score: ensAwardsScore, | ||
| label: undefined, | ||
| }} | ||
| viewDetailsHref={`/protocol/${protocol.protocolSlug}`} | ||
| viewDetailsText={`${formatProtocolType(protocolType)} report`}> | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| <Image | ||
| alt={`${idx + 1}-place`} | ||
| src={images[placeIcons[idx]]()} | ||
| slot="placeIcon" | ||
| /> | ||
| <ProtocolIcon | ||
| slot="rankedEntityIcon" | ||
| className="w-10 h-10 rounded-md" | ||
| /> | ||
| </LeaderboardCard> | ||
| ); | ||
| })} | ||
| <a | ||
| href={`/leaderboards/${protocolType}`} | ||
| class={cn( | ||
| shadcnButtonVariants({ | ||
| variant: "ghost", | ||
| size: "default", | ||
| className: "cursor-pointer rounded-full text-sm max-sm:w-full", | ||
| }), | ||
| )}> | ||
| View full {formatProtocolType(protocolType)} leaderboard | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| </a> | ||
| </ItemsList> | ||
| ) | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.