accounts/**

This commit is contained in:
Karol Wypchlo 2021-02-24 17:23:55 +01:00
parent 8bf09345ff
commit 632f7a5ba7
1 changed files with 9 additions and 6 deletions

View File

@ -42,6 +42,7 @@ const ActiveBadge = () => {
};
export default function Payments() {
const { data: user } = useSWR("/user", fetcher);
const [selectedPlanId, setSelectedPlanId] = useState("initial_free");
const selectedPlan = plans.find(({ id }) => selectedPlanId === id);
const handleSubscribe = async () => {
@ -143,12 +144,14 @@ export default function Payments() {
</button>
</div>
</div>
<div className="text-sm text-gray-500 text-center my-3">
To manage your active subscription, payment methods and view your billing history, go to{" "}
<a href="/api/stripe/customerPortal" className="text-green-600 hover:text-green-900">
Stripe Customer Portal
</a>
</div>
{Boolean(user?.stripeCustomerId) && (
<div className="text-sm text-gray-500 text-center my-3">
To manage your active subscription, payment methods and view your billing history, go to{" "}
<a href="/api/stripe/customerPortal" className="text-green-600 hover:text-green-900">
Stripe Customer Portal
</a>
</div>
)}
</form>
</section>
</div>