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