Package Exports
- @co-labs/oc-transparency-page
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@co-labs/oc-transparency-page) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Open Collective Transparency Page React Component
A React Component to integrate a transparency page of your collective into your project
Install
npm i @co-labs/oc-transparency-page
Usage
import React from 'react'
import TransparencyPage from 'oc-transparency-page'
import 'oc-transparency-page/dist/index.css'
import { ApolloProvider, ApolloClient, InMemoryCache } from '@apollo/client';
/**
* An Open Collective Api Key is highly recommended !
* @type {string}
*/
const apiKey = '';
const client = new ApolloClient({
uri: 'https://api.opencollective.com/graphql/v2'+apiKey,
cache: new InMemoryCache()
});
const App = () => {
return <ApolloProvider client={client}>
<TransparencyPage client={client} slug={'co-labs'} messages={{'allExpensesFrom' : 'Toutes les dépenses du {date}'}} />
</ApolloProvider>
}
export default App
How to overwrite messages ?
You can customize the messages by including your own labels inside the messages props
License
MIT © Co-Labs