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