Skip to content

fix(buy-now): Use standardised getMetadata method - #453

Merged
colbr merged 2 commits into
developfrom
fix/colbr/parse-metadata
Apr 2, 2022
Merged

fix(buy-now): Use standardised getMetadata method#453
colbr merged 2 commits into
developfrom
fix/colbr/parse-metadata

Conversation

@colbr

@colbr colbr commented Mar 30, 2022

Copy link
Copy Markdown
Contributor

Associated Notion Card


1. Pull request checklist

  • Notion card has been moved to the Code Review column
  • Notion card has a link to this PR
  • A reviewer has been assigned to the Notion card

2. PR type

Bugfix/refactoring

3. What is the old behaviour?

SetBuyNow and BuyNow modals weren't properly parsing metadata.

4. What is the new behaviour?

SetBuyNow and BuyNow now use getMetadata to retrieve metadata.

5. Other information

@colbr
colbr requested review from padala and stacy-hunt as code owners March 30, 2022 06:54
@netlify

netlify Bot commented Mar 30, 2022

Copy link
Copy Markdown

Deploy Preview for wilderworld-app ready!

Name Link
🔨 Latest commit ce2a418
🔍 Latest deploy log https://app.netlify.com/sites/wilderworld-app/deploys/62441f01ab231a0008cf948b
😎 Deploy Preview https://deploy-preview-453--wilderworld-app.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Comment thread src/containers/flows/BuyNow/index.tsx
@colbr
colbr requested a review from padala March 30, 2022 09:15

@domw30 domw30 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice 👍

@eric-zero-dev eric-zero-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work!

const { instance: sdk } = useZnsSdk();

const getMetadata = async (uri: string) => {
const raw = await sdk.utility.getMetadataFromUri(uri);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Let's import import { DomainMetadata } from '@zero-tech/zns-sdk/lib/types'; and use const raw: DomainMetadata = await sdk.utility.getMetadataFromUri(uri);, so that we can know it is converting SDK's DomainMetadata to dApp's Metadata ;

Comment on lines +31 to +33
return {
getMetadata,
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great! I think we can add setMetadata and use it in Edit Metadata flow. So getter/setter with hooks. Maybe we can do it later👍

@colbr colbr added this to the v0.14.0 milestone Apr 2, 2022
@colbr colbr added the enhancement New feature or request label Apr 2, 2022
@colbr colbr self-assigned this Apr 2, 2022
@colbr
colbr merged commit d3d74ef into develop Apr 2, 2022
@colbr
colbr deleted the fix/colbr/parse-metadata branch April 2, 2022 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants