feat(company): add expiry warning banner, route wrapper, and conditional UI for expired companies
- Add CompanyExpireWarning component to layout header for expiring subscription alerts - Add CompanyExpire wrapper to guard rules and data-source routes - Refactor CompanyExpireGuard to support optional fullscreen mode via prop - Add responsive Popover support to VoiceCheck for mobile breakpoints - Hide rule CRUD action buttons when company validity is expired - Update profile page to display expiry status alongside validity date - Update i18n strings for clearer expiry messaging Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
Row,
|
||||
Space,
|
||||
Tag,
|
||||
Typography,
|
||||
} from 'antd';
|
||||
import React, { useEffect } from 'react';
|
||||
import { clearAccessToken } from '@/access';
|
||||
@@ -22,6 +23,8 @@ import useUserInfo from '@/hooks/useUserInfo';
|
||||
import { changeUserPass } from '@/services/api';
|
||||
import { $t } from '@/utils/i18n';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
const Profile: React.FC = () => {
|
||||
const { userInfo, setUserInfo } = useUserInfo();
|
||||
const { isGlobalCompany } = useAccess();
|
||||
@@ -77,13 +80,20 @@ const Profile: React.FC = () => {
|
||||
items.push({
|
||||
key: '6',
|
||||
span: 'filled',
|
||||
label: $t('pages.company.permanent'),
|
||||
children: userCompany?.validityEndTime
|
||||
? userCompany.validityEndTime
|
||||
: $t('pages.company.permanent'),
|
||||
label: $t('table.validityEndTime'),
|
||||
children: userCompany?.validityEndTime ? (
|
||||
<Space>
|
||||
{userCompany.validityEndTime}
|
||||
<Text type="danger" style={{ fontSize: '12px' }}>
|
||||
{$t('pages.company.expired')}
|
||||
</Text>
|
||||
</Space>
|
||||
) : (
|
||||
$t('pages.company.permanent')
|
||||
),
|
||||
});
|
||||
}
|
||||
}, [userInfo]);
|
||||
}, [userCompany, isGlobalCompany]);
|
||||
|
||||
const changePasswordSuccessHadle = async () => {
|
||||
let countdown = 5;
|
||||
|
||||
Reference in New Issue
Block a user