Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/components/Sidenav/DowngradedNotification.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { WarningIcon } from '@phosphor-icons/react';
import { useTranslationContext } from '@/i18n';

interface DowngradedNotificationProps {
daysUntilDeletion?: number;
onUpgradeClick: () => void;
}

const DowngradedNotification = ({ daysUntilDeletion, onUpgradeClick }: DowngradedNotificationProps) => {
const { translate } = useTranslationContext();

return (
<div className="flex gap-1.5 items-start p-3 rounded-lg bg-yellow/10 border border-yellow/20">
<WarningIcon className="size-5 shrink-0 text-yellow" weight="fill" />
<div className="flex flex-col gap-0.5 min-w-0">
<p className="text-xs leading-tight text-gray-100">
{translate('mailDowngraded.message', { days: daysUntilDeletion ?? '--' })}
</p>
<button
type="button"
onClick={onUpgradeClick}
className="self-start text-xs font-medium text-primary hover:underline"
>
{translate('mailDowngraded.upgrade')}
</button>
</div>
</div>
);
};

export default DowngradedNotification;
4 changes: 4 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"upgrade": "Upgrade",
"send": "Send"
},
"mailDowngraded": {
"message": "You downgraded to a plan that doesn't support Internxt Mail. Your account will be deleted in {{days}} days.",
"upgrade": "Upgrade"
},
"filter": {
"all": "All",
"none": "None",
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"upgrade": "Mejorar plan",
"send": "Enviar"
},
"mailDowngraded": {
"message": "Has bajado a un plan que no incluye Internxt Mail. Tu cuenta se eliminará en {{days}} días.",
"upgrade": "Mejorar plan"
},
"filter": {
"all": "Todos",
"none": "Ninguno",
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"upgrade": "Mettre à niveau",
"send": "Envoyer"
},
"mailDowngraded": {
"message": "Vous êtes passé à un plan qui ne prend pas en charge Internxt Mail. Votre compte sera supprimé dans {{days}} jours.",
"upgrade": "Mettre à niveau"
},
"filter": {
"all": "Tous",
"none": "Aucun",
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"upgrade": "Aggiorna piano",
"send": "Invia"
},
"mailDowngraded": {
"message": "Sei passato a un piano che non supporta Internxt Mail. Il tuo account verrà eliminato tra {{days}} giorni.",
"upgrade": "Aggiorna piano"
},
"filter": {
"all": "Tutti",
"none": "Nessuno",
Expand Down
Loading