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