accounts/**
This commit is contained in:
parent
8bf09345ff
commit
632f7a5ba7
|
@ -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>
|
||||||
|
{Boolean(user?.stripeCustomerId) && (
|
||||||
<div className="text-sm text-gray-500 text-center my-3">
|
<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{" "}
|
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">
|
<a href="/api/stripe/customerPortal" className="text-green-600 hover:text-green-900">
|
||||||
Stripe Customer Portal
|
Stripe Customer Portal
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in New Issue