Skip to content

Create useProfile Hook #1082

@lightwalker-eth

Description

@lightwalker-eth

Background

Goals

Each app (including ENSAdmin) should define their own "wrapper" data model around their useRecords queries that is specific to their use case.

This data model should take the responsibility of hiding the nuances or complexities of a raw useRecords API response from the broader app. The broader app should be given a more simple and tailored data model to work with to make related code in the app as simple as possible.

  • Design a nice data model for ENSProfile in ENSAdmin that's completely optimized for ENS Profiles in ENSAdmin and doesn't worry about being useful outside of ENSAdmin contexts.
  • Create a useProfile hook that internally calls useRecords and then performs the data transformations that might be required to return the nice, clean, and specialized ENSProfile data model.
  • Update the code in ProfileHeader, ProfileInformation, SocialLinks, Addresses, and AdditionalRecords so that their input changes to just taking an ENSProfile as returned by useProfile.
    • Remove logic in these UI components that are too specific to the nuances or complexities of a raw useRecords data model.

Metadata

Metadata

Assignees

Labels

Projects

Status

On deck

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions