0.5.2 • Published 2 years ago

tcd-lesson-subscription v0.5.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

TCD Lesson Subscription

Prerequisites

  1. Following libraries must be installed for this component to work properly. Use yarn or npm to install these libraries.

    1. firebase@8.6.5

    2. @stripe/react-stripe-js

    3. @stripe/stripe-js

  2. Configure the firebase and stripe objects with proper credentials. For your convenience, I have put a sample configured files for both firebase and stripe in the example/config folder.

How to setup?

  1. Use the following command to add this library
yarn add tcd-lesson-subscription # npm install --save tcd-lesson-subscription
  1. Import the LessonSubscription component and use it like this:
import { LessonSubscription } from "tcd-lesson-subscription";

<LessonSubscription
  auth={firebase.auth()}
  functions={firebase.functions()}
  stripe={stripe}
/>

Example:

import React from "react";
import { LessonSubscription } from "tcd-lesson-subscription";
import firebase from "./config/firebase";
import { stripe } from "./config/stripe";

export function Subscription(props: any) {
  return (
    <LessonSubscription
      auth={firebase.auth()}
      functions={firebase.functions()}
      stripe={stripe}
    />
  );
}