@co-labs/oc-transparency-page

1.9.0 • Public • Published

Open Collective Transparency Page React Component

A React Component to integrate a transparency page of your collective into your project

NPM JavaScript Style Guide

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

Package Sidebar

Install

npm i @co-labs/oc-transparency-page

Weekly Downloads

1

Version

1.9.0

License

MIT

Unpacked Size

107 kB

Total Files

7

Last publish

Collaborators

  • colabs_admin