This commit is contained in:
Karol Wypchlo 2021-02-25 16:51:38 +01:00
parent 906895a323
commit b59cfa6a7a
1 changed files with 4 additions and 2 deletions

View File

@ -57,7 +57,9 @@ export default function Payments() {
};
useEffect(() => {
setActivePlanId(subscription?.plan?.id ?? null);
const plan = plans.find(({ stripe }) => subscription?.plan?.id === stripe);
setActivePlanId(plan);
}, [subscription, setActivePlanId]);
return (
@ -75,7 +77,7 @@ export default function Payments() {
<div className="bg-white overflow-hidden shadow rounded-lg">
<div className="px-4 py-5 sm:p-6">
<dt className="text-sm font-medium text-gray-500 truncate">Subscription status</dt>
<dd className="mt-1 text-3xl font-semibold text-gray-900">{subscription?.status ?? "—"}</dd>
<dd className="mt-1 text-3xl font-semibold text-gray-900 capitalize">{subscription?.status ?? "—"}</dd>
</div>
</div>