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

refactor: Rework image serving gateways #4604

Merged
merged 11 commits into from
Jan 5, 2023
Merged

Conversation

Jarsen136
Copy link
Contributor

Thank you for your contribution to the KodaDot NFT gallery.

👇 _ Let's make a quick check before the contribution.

PR Type

  • Bugfix

  • Feature

  • Refactoring

  • Now the ipfs provider config has been collected into @/utils/config/ipfs.

  • The utils function related to them has been moved to @/utils/ipfs from components/rmrk/utils.ts

  • The fallback ipfs provider would point to https://image.w.kodadot.xyz/.

Context

Before submitting pull request, please make sure:

  • My contribution builds clean without any errors or warnings
  • I've merged recent default branch -- main and I've no conflicts
  • I've tried to respect high code quality standards
  • I've didn't break any original functionality
  • I've posted a screenshot of demonstrated change in this PR

Optional

  • I've tested it at </bsx/collection>
  • I've tested PR on mobile
  • I've written unit tests 🧪
  • I've found edge cases

Had issue bounty label?

  • Fill up your KSM address: Payout

Community participation

Screenshot 📸

  • My fix has changed something on UI; a screenshot is best to understand changes for others.

@kodabot
Copy link
Collaborator

kodabot commented Jan 4, 2023

SUCCESS @Jarsen136 PR for issue #4598 which is assigned to you. Please wait for review and don't hesitate to grab another issue in the meantime!

@netlify
Copy link

netlify bot commented Jan 4, 2023

Deploy Preview for koda-nuxt ready!

Name Link
🔨 Latest commit 7284969
🔍 Latest deploy log https://app.netlify.com/sites/koda-nuxt/deploys/63b6bdcc94b2160008919fee
😎 Deploy Preview https://deploy-preview-4604--koda-nuxt.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.

utils/ipfs.ts Outdated
return ipfsUrl.replace('ipfs://', `${resolveProvider(provider)}ipfs/`)
}

return sanitizeArweaveUrl(ipfsUrl, provider as ArweaveProviders)
Copy link

Choose a reason for hiding this comment

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

Avoid too many return statements within this function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Usually, using multiple return would be necessary to enhance readability

ref: https://stackoverflow.com/questions/36707/should-a-function-have-only-one-return-statement

utils/ipfs.ts Show resolved Hide resolved
@Jarsen136 Jarsen136 marked this pull request as ready for review January 4, 2023 17:11
@Jarsen136 Jarsen136 requested a review from a team as a code owner January 4, 2023 17:11
@Jarsen136 Jarsen136 requested review from preschian and removed request for a team January 4, 2023 17:11
@yangwao
Copy link
Member

yangwao commented Jan 4, 2023

ouiii let's see

Copy link
Member

@preschian preschian left a comment

Choose a reason for hiding this comment

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

LGTM. at least most of the functions moved to utils 👍

how about this one? #4598 (comment) doable in the separate PR maybe?

@yangwao yangwao requested a review from vikiival January 5, 2023 10:21
@yangwao
Copy link
Member

yangwao commented Jan 5, 2023

how about this one? #4598 (comment) doable in the separate PR maybe?

yup

utils/cachingStrategy.ts Outdated Show resolved Hide resolved
@vikiival
Copy link
Member

vikiival commented Jan 5, 2023

99% of changes are about moving code to different files

@codeclimate
Copy link

codeclimate bot commented Jan 5, 2023

Code Climate has analyzed commit 7284969 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

@Jarsen136
Copy link
Contributor Author

99% of changes are about moving code to different files

Yup, most about moving the code.

  • Clean up some unused functions in components/rmrk/utils.ts file.
  • Now the ipfs provider config has been collected into @/utils/config/ipfs.
  • The utils function related to them has been moved to @/utils/ipfs from components/rmrk/utils.ts
  • The fallback ipfs provider would point to https://image.w.kodadot.xyz/.

@yangwao
Copy link
Member

yangwao commented Jan 5, 2023

pay 50 usd

@yangwao yangwao merged commit c34cd6c into kodadot:main Jan 5, 2023
@yangwao
Copy link
Member

yangwao commented Jan 5, 2023

😍 Perfect, I’ve sent the payout
💵 $50 @ 24.44 USD/KSM ~ 2.046 $KSM
🧗 Caiv9TbPz68q5dC8EcHu5xKYPRnremimGzqmEejDFNpWWLG
🔗 0x4392529434131ffe8adcd27599e6959f7e7ec3659eac62852b14b001c95b2073

🪅 Let’s grab another issue and get rewarded!
🪄 github.com/kodadot/nft-gallery/issues

@yangwao yangwao added the paid pull-request has been paid label Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
paid pull-request has been paid
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rework image serving gateways
5 participants