feat: finalize TrialOverAlert on billing page
This commit is contained in:
32
packages/web/src/components/TrialOverAlert/index.ee.tsx
Normal file
32
packages/web/src/components/TrialOverAlert/index.ee.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import * as React from 'react';
|
||||
import Alert from '@mui/material/Alert';
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
import * as URLS from 'config/urls';
|
||||
import { generateInternalLink } from 'helpers/translation-values';
|
||||
import useTrialStatus from 'hooks/useTrialStatus.ee';
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
|
||||
|
||||
export default function TrialOverAlert() {
|
||||
const formatMessage = useFormatMessage();
|
||||
const trialStatus = useTrialStatus();
|
||||
|
||||
if (!trialStatus || !trialStatus.over) return <React.Fragment />;
|
||||
|
||||
return (
|
||||
<Alert
|
||||
severity="error"
|
||||
sx={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<Typography variant="subtitle2" sx={{ lineHeight: 1.5 }}>
|
||||
{formatMessage('trialOverAlert.text', {
|
||||
link: generateInternalLink(URLS.SETTINGS_PLAN_UPGRADE)
|
||||
})}
|
||||
</Typography>
|
||||
</Alert>
|
||||
);
|
||||
}
|
@@ -13,6 +13,7 @@ import Grid from '@mui/material/Grid';
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
import { TBillingCardAction } from '@automatisch/types';
|
||||
import TrialOverAlert from 'components/TrialOverAlert/index.ee';
|
||||
import * as URLS from 'config/urls';
|
||||
import useBillingAndUsageData from 'hooks/useBillingAndUsageData.ee';
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
@@ -96,19 +97,7 @@ export default function UsageDataInformation() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Stack sx={{ width: '100%', mb: 2 }} spacing={2}>
|
||||
<Alert
|
||||
severity="error"
|
||||
sx={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<Typography variant="subtitle2">
|
||||
Your free trial is over. Please{' '}
|
||||
<Link to={URLS.SETTINGS_PLAN_UPGRADE}>upgrade </Link>
|
||||
your plan to continue using Automatisch.
|
||||
</Typography>
|
||||
</Alert>
|
||||
<TrialOverAlert />
|
||||
</Stack>
|
||||
<Card sx={{ mb: 3, p: 2 }}>
|
||||
<CardContent sx={{ display: 'flex', flexDirection: 'column' }}>
|
||||
|
Reference in New Issue
Block a user