Skip to content

Commit

Permalink
fix(settings): randomize pinning service templates (#2027)
Browse files Browse the repository at this point in the history
* fix(settings): randomize pinning service templates

* fix: endpoint should not include /pins suffix
  • Loading branch information
lidel authored Sep 19, 2022
1 parent 3aae1f2 commit cd211ac
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/constants/pinning.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// This is a list of predefined templates for popular services from the IPFS
// community. We are open to reviewing PRs that add more entries here,
// but only well-established and mission-aligned services will be accepted.
// Services listed here are returned in a random order to ensure UI does not
// promote any of them more than others.

const complianceReportsHomepage = 'https://ipfs-shipyard.github.io/pinning-service-compliance'

Expand Down Expand Up @@ -33,21 +35,21 @@ const pinningServiceTemplates = [
{
name: 'Web3.Storage',
icon: 'https://dweb.link/ipfs/bafybeiaqsdwuwemchbofzok4cq7cuvotfs6bgickxdqr6f7hdt7a64cwwa/Web3.Storage-logo.svg',
apiEndpoint: 'https://api.web3.storage/pins',
apiEndpoint: 'https://api.web3.storage',
visitServiceUrl: 'https://web3.storage/docs/how-tos/pinning-services-api/'
},
{
name: 'Estuary',
icon: 'https://dweb.link/ipfs/bafkreicn36fjx2tlanzslpayomdhgerh7oovlaasfkg7ltzgztf7a3buu4?filename=Estuary-logo.svg',
apiEndpoint: 'https://api.estuary.tech/pinning/pins',
apiEndpoint: 'https://api.estuary.tech/pinning',
visitServiceUrl: 'https://docs.estuary.tech/tutorial-get-an-api-key'
}

].map((service) => {
const domain = new URL(service.apiEndpoint).hostname
service.complianceReportUrl = `${complianceReportsHomepage}/${domain}.html`
return service
})
}).map(service => ({ service, sort: Math.random() })).sort((a, b) => a.sort - b.sort).map(({ service }) => service)

export {
complianceReportsHomepage,
Expand Down

0 comments on commit cd211ac

Please sign in to comment.