0.5.2 • Published 4 years ago
tcd-lesson-subscription v0.5.2
TCD Lesson Subscription
Prerequisites
Following libraries must be installed for this component to work properly. Use
yarnornpmto install these libraries.firebase@8.6.5
@stripe/react-stripe-js
@stripe/stripe-js
Configure the
firebaseandstripeobjects with proper credentials. For your convenience, I have put a sample configured files for bothfirebaseandstripein theexample/configfolder.
How to setup?
- Use the following command to add this library
yarn add tcd-lesson-subscription # npm install --save tcd-lesson-subscription- Import the
LessonSubscriptioncomponent 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}
/>
);
}