0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-31 22:51:25 -05:00

fix(console): upsell should locate on modal footer (#5356)

This commit is contained in:
Darcy Ye 2024-02-01 12:18:28 +08:00 committed by GitHub
parent 9cddd78adc
commit 0b2226de5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
import { withAppInsights } from '@logto/app-insights/react';
import { type SsoConnectorWithProviderConfig, ReservedPlanId } from '@logto/schemas';
import { conditional } from '@silverhand/essentials';
import { useContext, useCallback } from 'react';
import { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation } from 'react-router-dom';
import useSWR from 'swr';
@ -13,7 +13,6 @@ import ItemPreview from '@/components/ItemPreview';
import ListPage from '@/components/ListPage';
import { defaultPageSize } from '@/consts';
import { isCloud } from '@/consts/env';
import { subscriptionPage } from '@/consts/pages';
import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider';
import { TenantsContext } from '@/contexts/TenantsProvider';
import Button from '@/ds-components/Button';
@ -46,10 +45,6 @@ function EnterpriseSsoConnectors() {
const isSsoEnabled = !isCloud || currentPlan.quota.ssoEnabled;
const handleButtonClick = useCallback(() => {
navigate(isSsoEnabled ? createEnterpriseSsoPathname : subscriptionPage);
}, [isSsoEnabled, navigate]);
const url = buildUrl('api/sso-connectors', {
page: String(page),
page_size: String(pageSize),
@ -150,11 +145,13 @@ function EnterpriseSsoConnectors() {
description="enterprise_sso.placeholder_description"
action={
<Button
title={isSsoEnabled ? 'enterprise_sso.create' : 'upsell.upgrade_plan'}
title="enterprise_sso.create"
type="primary"
size="large"
icon={conditional(isSsoEnabled && <Plus />)}
onClick={handleButtonClick}
icon={<Plus />}
onClick={() => {
navigate(createEnterpriseSsoPathname);
}}
/>
}
/>