mirror of
https://github.com/logto-io/logto.git
synced 2025-04-14 23:11:31 -05:00
fix(console): fix visibility of Stripe customer portal (#7165)
This commit is contained in:
parent
5003166e51
commit
e11cb003dc
2 changed files with 7 additions and 3 deletions
|
@ -11,6 +11,7 @@ import IconButton from '@/ds-components/IconButton';
|
|||
import TextLink from '@/ds-components/TextLink';
|
||||
import { ToggleTip } from '@/ds-components/Tip';
|
||||
import useSubscribe from '@/hooks/use-subscribe';
|
||||
import { isPaidPlan } from '@/utils/subscription';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
@ -24,7 +25,7 @@ function BillInfo({ cost, isManagePaymentVisible }: Props) {
|
|||
const { visitManagePaymentPage } = useSubscribe();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const {
|
||||
currentSubscription: { isEnterprisePlan },
|
||||
currentSubscription: { isEnterprisePlan, planId },
|
||||
} = useContext(SubscriptionDataContext);
|
||||
|
||||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
||||
|
@ -34,7 +35,7 @@ function BillInfo({ cost, isManagePaymentVisible }: Props) {
|
|||
<div className={styles.billInfo}>
|
||||
<div className={styles.price}>
|
||||
<span>{`$${(cost / 100).toLocaleString()}`}</span>
|
||||
{cost > 0 && (
|
||||
{isPaidPlan(planId, isEnterprisePlan) && (
|
||||
<ToggleTip content={<DynamicT forKey="subscription.next_bill_tip" />}>
|
||||
<IconButton size="small">
|
||||
<Tip />
|
||||
|
|
|
@ -54,7 +54,10 @@ function CurrentPlan({ periodicUsage, usageAddOnSkus }: Props) {
|
|||
<PlanUsage periodicUsage={periodicUsage} usageAddOnSkus={usageAddOnSkus} />
|
||||
</FormField>
|
||||
<FormField title="subscription.next_bill">
|
||||
<BillInfo cost={upcomingCost} isManagePaymentVisible={Boolean(upcomingCost)} />
|
||||
<BillInfo
|
||||
cost={upcomingCost}
|
||||
isManagePaymentVisible={isPaidPlan(planId, isEnterprisePlan)}
|
||||
/>
|
||||
</FormField>
|
||||
{isPaidPlan(planId, isEnterprisePlan) && !isEnterprisePlan && (
|
||||
<AddOnUsageChangesNotification className={styles.notification} />
|
||||
|
|
Loading…
Add table
Reference in a new issue