@greatapps/common 1.1.674 → 1.1.675
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +6 -8
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +19 -20
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +11 -10
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs +28 -34
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +5 -7
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +9 -8
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/TwoFactorAuthModal.mjs +23 -22
- package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/constants.mjs +4 -4
- package/dist/components/account/constants.mjs.map +1 -1
- package/dist/components/account/hooks/useChangeEmailForm.mjs +3 -5
- package/dist/components/account/hooks/useChangeEmailForm.mjs.map +1 -1
- package/dist/components/account/hooks/useChangePasswordForm.mjs +3 -26
- package/dist/components/account/hooks/useChangePasswordForm.mjs.map +1 -1
- package/dist/components/account/hooks/useChangePhoneForm.mjs +9 -18
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -1
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +3 -26
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/account/hooks/useOtpVerification.mjs +3 -19
- package/dist/components/account/hooks/useOtpVerification.mjs.map +1 -1
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +4 -27
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs +28 -25
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs +6 -8
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs +27 -24
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -1
- package/dist/components/account/sections/MyProfileSection.mjs +22 -37
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/account/sections/PreferencesSection.mjs +24 -48
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
- package/dist/components/account/sections/SecuritySection.mjs +9 -11
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
- package/dist/components/account/sections/TokenSection.mjs +8 -24
- package/dist/components/account/sections/TokenSection.mjs.map +1 -1
- package/dist/components/layouts/AppMobileNavBar.mjs +148 -2
- package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
- package/dist/components/layouts/NavBar.mjs +3 -5
- package/dist/components/layouts/NavBar.mjs.map +1 -1
- package/dist/components/layouts/NotificationsPopover.mjs +3 -5
- package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
- package/dist/components/layouts/ProfilePopover.mjs +4 -6
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +7 -9
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
- package/dist/components/modals/BuyCreditsModal.mjs +18 -17
- package/dist/components/modals/BuyCreditsModal.mjs.map +1 -1
- package/dist/components/modals/CreditsDisabledModal.mjs +4 -6
- package/dist/components/modals/CreditsDisabledModal.mjs.map +1 -1
- package/dist/components/modals/PaidPlanRequiredModal.mjs +3 -5
- package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
- package/dist/components/modals/cards/AddCardModal.mjs +24 -27
- package/dist/components/modals/cards/AddCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CannotDeleteCardModal.mjs +7 -9
- package/dist/components/modals/cards/CannotDeleteCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CardFormFields.mjs +22 -25
- package/dist/components/modals/cards/CardFormFields.mjs.map +1 -1
- package/dist/components/modals/cards/DeleteCardModal.mjs +8 -10
- package/dist/components/modals/cards/DeleteCardModal.mjs.map +1 -1
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs +2 -4
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +1 -1
- package/dist/components/navigation/OverdueInvoiceBanner.mjs +2 -4
- package/dist/components/navigation/OverdueInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/PendingCancellationBanner.mjs +6 -4
- package/dist/components/navigation/PendingCancellationBanner.mjs.map +1 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs +6 -8
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -1
- package/dist/components/navigation/UpcomingInvoiceBanner.mjs +6 -4
- package/dist/components/navigation/UpcomingInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/BottomLinks.mjs +3 -5
- package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/CreditsCard.mjs +1 -3
- package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/PlanCard.mjs +1 -3
- package/dist/components/navigation/subcomponents/PlanCard.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +3 -5
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
- package/dist/components/pages/NotFoundPage.mjs +3 -5
- package/dist/components/pages/NotFoundPage.mjs.map +1 -1
- package/dist/components/pages/notifications/Notifications.mjs +10 -13
- package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
- package/dist/components/ui/buttons/CopyButton.mjs +5 -9
- package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
- package/dist/components/ui/data-display/CardItem.mjs +5 -7
- package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
- package/dist/components/ui/data-display/PaymentInfoCard.mjs +8 -10
- package/dist/components/ui/data-display/PaymentInfoCard.mjs.map +1 -1
- package/dist/components/ui/feedback/CircularProgress.mjs.map +1 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs +1 -3
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -1
- package/dist/components/ui/form/ComboboxField.mjs +6 -11
- package/dist/components/ui/form/ComboboxField.mjs.map +1 -1
- package/dist/components/ui/form/DatePicker.mjs +2 -5
- package/dist/components/ui/form/DatePicker.mjs.map +1 -1
- package/dist/components/ui/form/DateRangePicker.mjs +2 -5
- package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
- package/dist/components/ui/form/PhoneInput.mjs +3 -5
- package/dist/components/ui/form/PhoneInput.mjs.map +1 -1
- package/dist/components/ui/form/SelectField.mjs +3 -6
- package/dist/components/ui/form/SelectField.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs +18 -11
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs +15 -6
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs.map +1 -1
- package/dist/index.mjs +2 -16
- package/dist/index.mjs.map +1 -1
- package/dist/modules/cards/hooks/handle-delete-card.hook.mjs +1 -2
- package/dist/modules/cards/hooks/handle-delete-card.hook.mjs.map +1 -1
- package/dist/modules/images/utils/validate-image.mjs +8 -8
- package/dist/modules/images/utils/validate-image.mjs.map +1 -1
- package/dist/modules/plans/types/plan.type.mjs +0 -3
- package/dist/modules/plans/types/plan.type.mjs.map +1 -1
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs +34 -56
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/periodicity.mjs +14 -20
- package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
- package/dist/providers/auth.provider.mjs +1 -9
- package/dist/providers/auth.provider.mjs.map +1 -1
- package/dist/server.mjs +0 -2
- package/dist/server.mjs.map +1 -1
- package/dist/utils/format/currency.mjs +4 -32
- package/dist/utils/format/currency.mjs.map +1 -1
- package/dist/utils/intl/locales.mjs +2 -3
- package/dist/utils/intl/locales.mjs.map +1 -1
- package/package.json +1 -7
- package/src/components/account/ConfigurationsMyAccountModal.tsx +6 -10
- package/src/components/account/ConfirmDeleteAccountModal.tsx +13 -22
- package/src/components/account/ConfirmGlobalPreferencesModal.tsx +10 -12
- package/src/components/account/DeleteAccountModal.tsx +24 -34
- package/src/components/account/DisableTwoFactorAuthModal.tsx +6 -11
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +6 -8
- package/src/components/account/TwoFactorAuthModal.tsx +29 -33
- package/src/components/account/constants.ts +5 -8
- package/src/components/account/hooks/useChangeEmailForm.tsx +3 -5
- package/src/components/account/hooks/useChangePasswordForm.tsx +6 -20
- package/src/components/account/hooks/useChangePhoneForm.tsx +10 -16
- package/src/components/account/hooks/useDisableTwoFactorAuthForm.tsx +6 -20
- package/src/components/account/hooks/useOtpVerification.tsx +4 -16
- package/src/components/account/hooks/useTwoFactorAuthForm.tsx +7 -21
- package/src/components/account/sections/ChangeEmailModal.tsx +21 -35
- package/src/components/account/sections/ChangePasswordSection.tsx +6 -10
- package/src/components/account/sections/ChangePhoneModal.tsx +22 -50
- package/src/components/account/sections/MyProfileSection.tsx +23 -37
- package/src/components/account/sections/PreferencesSection.tsx +25 -52
- package/src/components/account/sections/SecuritySection.tsx +10 -19
- package/src/components/account/sections/TokenSection.tsx +10 -22
- package/src/components/layouts/AppMobileNavBar.tsx +154 -1
- package/src/components/layouts/NavBar.tsx +3 -5
- package/src/components/layouts/NotificationsPopover.tsx +3 -5
- package/src/components/layouts/ProfilePopover.tsx +4 -6
- package/src/components/layouts/UsersSelectorPopover.tsx +7 -9
- package/src/components/modals/BuyCreditsModal.tsx +16 -18
- package/src/components/modals/CreditsDisabledModal.tsx +6 -6
- package/src/components/modals/PaidPlanRequiredModal.tsx +3 -5
- package/src/components/modals/cards/AddCardModal.tsx +27 -29
- package/src/components/modals/cards/CannotDeleteCardModal.tsx +8 -9
- package/src/components/modals/cards/CardFormFields.tsx +22 -25
- package/src/components/modals/cards/DeleteCardModal.tsx +8 -10
- package/src/components/navigation/CancelledSubscriptionBanner.tsx +2 -4
- package/src/components/navigation/OverdueInvoiceBanner.tsx +2 -4
- package/src/components/navigation/PendingCancellationBanner.tsx +2 -4
- package/src/components/navigation/ProjectSelectorPopover.tsx +6 -8
- package/src/components/navigation/UpcomingInvoiceBanner.tsx +2 -4
- package/src/components/navigation/subcomponents/BottomLinks.tsx +3 -5
- package/src/components/navigation/subcomponents/CreditsCard.tsx +1 -3
- package/src/components/navigation/subcomponents/PlanCard.tsx +1 -3
- package/src/components/navigation/subcomponents/ProjectSelector.tsx +3 -5
- package/src/components/pages/NotFoundPage.tsx +3 -5
- package/src/components/pages/notifications/Notifications.tsx +10 -13
- package/src/components/ui/buttons/CopyButton.tsx +5 -10
- package/src/components/ui/data-display/CardItem.tsx +5 -7
- package/src/components/ui/data-display/PaymentInfoCard.tsx +8 -10
- package/src/components/ui/feedback/CircularProgress.tsx +0 -4
- package/src/components/ui/feedback/DefaultCircularProgress.tsx +1 -3
- package/src/components/ui/form/ComboboxField.tsx +6 -11
- package/src/components/ui/form/DatePicker.tsx +2 -5
- package/src/components/ui/form/DateRangePicker.tsx +2 -5
- package/src/components/ui/form/PhoneInput.tsx +3 -5
- package/src/components/ui/form/SelectField.tsx +3 -6
- package/src/components/widgets/ImageUpload/ImageCropModal.tsx +11 -19
- package/src/components/widgets/ImageUpload/ImageTooSmallModal.tsx +5 -6
- package/src/index.ts +2 -12
- package/src/modules/cards/hooks/handle-delete-card.hook.ts +3 -8
- package/src/modules/images/utils/validate-image.ts +8 -23
- package/src/modules/plans/types/plan.type.ts +0 -3
- package/src/modules/plans/utils/map-api-plan-to-ui.ts +46 -103
- package/src/modules/subscriptions/utils/periodicity.ts +12 -29
- package/src/providers/auth.provider.tsx +1 -13
- package/src/server.ts +0 -2
- package/src/utils/format/currency.ts +7 -62
- package/src/utils/intl/locales.ts +2 -3
- package/dist/i18n/config.mjs +0 -13
- package/dist/i18n/config.mjs.map +0 -1
- package/dist/i18n/country-language.mjs +0 -74
- package/dist/i18n/country-language.mjs.map +0 -1
- package/dist/i18n/messages/en-us.mjs +0 -492
- package/dist/i18n/messages/en-us.mjs.map +0 -1
- package/dist/i18n/messages/es-es.mjs +0 -492
- package/dist/i18n/messages/es-es.mjs.map +0 -1
- package/dist/i18n/messages/index.mjs +0 -16
- package/dist/i18n/messages/index.mjs.map +0 -1
- package/dist/i18n/messages/pt-br.mjs +0 -505
- package/dist/i18n/messages/pt-br.mjs.map +0 -1
- package/dist/i18n/normalize.mjs +0 -12
- package/dist/i18n/normalize.mjs.map +0 -1
- package/dist/i18n/resolve-locale.mjs +0 -42
- package/dist/i18n/resolve-locale.mjs.map +0 -1
- package/dist/i18n.mjs +0 -14
- package/dist/i18n.mjs.map +0 -1
- package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs +0 -20
- package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs.map +0 -1
- package/dist/utils/intl/cookie-domain.mjs +0 -17
- package/dist/utils/intl/cookie-domain.mjs.map +0 -1
- package/dist/utils/intl/locale-cookie.mjs +0 -13
- package/dist/utils/intl/locale-cookie.mjs.map +0 -1
- package/src/i18n/config.ts +0 -17
- package/src/i18n/country-language.ts +0 -60
- package/src/i18n/messages/en-us.ts +0 -512
- package/src/i18n/messages/es-es.ts +0 -513
- package/src/i18n/messages/index.ts +0 -24
- package/src/i18n/messages/pt-br.ts +0 -536
- package/src/i18n/normalize.ts +0 -15
- package/src/i18n/resolve-locale.ts +0 -77
- package/src/i18n.ts +0 -10
- package/src/modules/accounts/hooks/use-currency-formatter.hook.tsx +0 -32
- package/src/utils/intl/cookie-domain.ts +0 -29
- package/src/utils/intl/locale-cookie.ts +0 -18
|
@@ -17,7 +17,6 @@ import { useForm } from 'react-hook-form';
|
|
|
17
17
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
18
18
|
import { CardNumberElement, useElements, useStripe } from '@stripe/react-stripe-js';
|
|
19
19
|
import { toast } from 'sonner';
|
|
20
|
-
import { useTranslations } from 'next-intl';
|
|
21
20
|
|
|
22
21
|
const INITIAL_STRIPE_STATUS: StripeElementsStatus = {
|
|
23
22
|
cardNumber: false,
|
|
@@ -25,15 +24,15 @@ const INITIAL_STRIPE_STATUS: StripeElementsStatus = {
|
|
|
25
24
|
cardCvc: false,
|
|
26
25
|
};
|
|
27
26
|
|
|
27
|
+
const STEPS = [
|
|
28
|
+
{ number: 1, label: 'Cobrança' },
|
|
29
|
+
{ number: 2, label: 'Cartão' },
|
|
30
|
+
] as const;
|
|
31
|
+
|
|
28
32
|
function CardStepper({ currentStep }: { readonly currentStep: number }) {
|
|
29
|
-
const translate = useTranslations();
|
|
30
|
-
const steps = [
|
|
31
|
-
{ number: 1, label: translate('common.cards.add.stepBilling') },
|
|
32
|
-
{ number: 2, label: translate('common.cards.add.stepCard') },
|
|
33
|
-
];
|
|
34
33
|
return (
|
|
35
34
|
<div className="flex items-center justify-start gap-2 px-4 py-3 bg-zinc-50 border-b border-zinc-200 lg:border-b-0">
|
|
36
|
-
{
|
|
35
|
+
{STEPS.map((step, idx) => {
|
|
37
36
|
const isCompleted = currentStep > step.number;
|
|
38
37
|
const isCurrent = currentStep === step.number;
|
|
39
38
|
const isPending = !isCompleted && !isCurrent;
|
|
@@ -62,7 +61,7 @@ function CardStepper({ currentStep }: { readonly currentStep: number }) {
|
|
|
62
61
|
>
|
|
63
62
|
{step.label}
|
|
64
63
|
</span>
|
|
65
|
-
{idx <
|
|
64
|
+
{idx < STEPS.length - 1 && (
|
|
66
65
|
<IconChevronRight size={16} className="text-zinc-300 ml-1" />
|
|
67
66
|
)}
|
|
68
67
|
</div>
|
|
@@ -73,7 +72,6 @@ function CardStepper({ currentStep }: { readonly currentStep: number }) {
|
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
export default function AddCardModal() {
|
|
76
|
-
const translate = useTranslations();
|
|
77
75
|
const { activeModal, modalData, closeModal } = useModalManager();
|
|
78
76
|
const isOpen = activeModal === 'addCardModal';
|
|
79
77
|
const { isExternalContracting, redirectToExternal } = useExternalContracting();
|
|
@@ -139,9 +137,9 @@ export default function AddCardModal() {
|
|
|
139
137
|
|
|
140
138
|
async function handleSubmit(data: CardFormData) {
|
|
141
139
|
const newStripeErrors: Record<string, string | undefined> = {};
|
|
142
|
-
if (!stripeStatus.cardNumber) newStripeErrors.cardNumber =
|
|
143
|
-
if (!stripeStatus.cardExpiry) newStripeErrors.cardExpiry =
|
|
144
|
-
if (!stripeStatus.cardCvc) newStripeErrors.cardCvc =
|
|
140
|
+
if (!stripeStatus.cardNumber) newStripeErrors.cardNumber = 'Número do cartão é obrigatório';
|
|
141
|
+
if (!stripeStatus.cardExpiry) newStripeErrors.cardExpiry = 'Data de validade é obrigatória';
|
|
142
|
+
if (!stripeStatus.cardCvc) newStripeErrors.cardCvc = 'Código de segurança é obrigatório';
|
|
145
143
|
setStripeErrors(newStripeErrors);
|
|
146
144
|
|
|
147
145
|
const stripeValid =
|
|
@@ -161,7 +159,7 @@ export default function AddCardModal() {
|
|
|
161
159
|
(t) => (
|
|
162
160
|
<Toast
|
|
163
161
|
variant="error"
|
|
164
|
-
message=
|
|
162
|
+
message="Não foi possível iniciar a autenticação do cartão, tente novamente."
|
|
165
163
|
toastId={t}
|
|
166
164
|
/>
|
|
167
165
|
),
|
|
@@ -182,7 +180,7 @@ export default function AddCardModal() {
|
|
|
182
180
|
(t) => (
|
|
183
181
|
<Toast
|
|
184
182
|
variant="error"
|
|
185
|
-
message={error.message ||
|
|
183
|
+
message={error.message || 'Falha na autenticação do cartão.'}
|
|
186
184
|
toastId={t}
|
|
187
185
|
/>
|
|
188
186
|
),
|
|
@@ -196,7 +194,7 @@ export default function AddCardModal() {
|
|
|
196
194
|
(t) => (
|
|
197
195
|
<Toast
|
|
198
196
|
variant="error"
|
|
199
|
-
message={
|
|
197
|
+
message={`Autenticação não concluída (status: ${setupIntent?.status ?? 'desconhecido'}).`}
|
|
200
198
|
toastId={t}
|
|
201
199
|
/>
|
|
202
200
|
),
|
|
@@ -231,7 +229,7 @@ export default function AddCardModal() {
|
|
|
231
229
|
}
|
|
232
230
|
|
|
233
231
|
toast.custom(
|
|
234
|
-
(t) => <Toast variant="success" message=
|
|
232
|
+
(t) => <Toast variant="success" message="Cartão adicionado com sucesso." toastId={t} />,
|
|
235
233
|
{ duration: 5000 }
|
|
236
234
|
);
|
|
237
235
|
handleClose();
|
|
@@ -240,7 +238,7 @@ export default function AddCardModal() {
|
|
|
240
238
|
(t) => (
|
|
241
239
|
<Toast
|
|
242
240
|
variant="error"
|
|
243
|
-
message=
|
|
241
|
+
message="Não foi possível salvar o seu novo cartão, tente novamente."
|
|
244
242
|
toastId={t}
|
|
245
243
|
/>
|
|
246
244
|
),
|
|
@@ -285,10 +283,10 @@ export default function AddCardModal() {
|
|
|
285
283
|
</div>
|
|
286
284
|
<div className="flex flex-col gap-2">
|
|
287
285
|
<DialogTitle className="paragraph-medium-semibold text-zinc-950">
|
|
288
|
-
|
|
286
|
+
Gerenciamento de cartões indisponível
|
|
289
287
|
</DialogTitle>
|
|
290
288
|
<span className="paragraph-small-regular text-zinc-600">
|
|
291
|
-
|
|
289
|
+
Acesse sua área de assinatura para gerenciar formas de pagamento.
|
|
292
290
|
</span>
|
|
293
291
|
</div>
|
|
294
292
|
</DialogHeader>
|
|
@@ -300,7 +298,7 @@ export default function AddCardModal() {
|
|
|
300
298
|
redirectToExternal('contracting');
|
|
301
299
|
}}
|
|
302
300
|
>
|
|
303
|
-
|
|
301
|
+
Acessar área de assinatura
|
|
304
302
|
</Button>
|
|
305
303
|
</div>
|
|
306
304
|
</DialogContent>
|
|
@@ -317,7 +315,7 @@ export default function AddCardModal() {
|
|
|
317
315
|
<DialogHeader className="p-0">
|
|
318
316
|
<div className="flex items-center justify-center px-4 py-3 relative border-b border-zinc-200 lg:border-b-0">
|
|
319
317
|
<DialogTitle className="paragraph-medium-semibold text-zinc-950 text-center">
|
|
320
|
-
|
|
318
|
+
Adicionar cartão
|
|
321
319
|
</DialogTitle>
|
|
322
320
|
<Button
|
|
323
321
|
type="button"
|
|
@@ -338,13 +336,13 @@ export default function AddCardModal() {
|
|
|
338
336
|
>
|
|
339
337
|
<div className={`flex flex-col gap-6 lg:gap-8 p-4 lg:p-5 flex-1 lg:flex-none ${currentStep !== 1 ? 'hidden' : ''}`}>
|
|
340
338
|
<h2 className="font-[family-name:var(--font-outfit)] text-[18px] leading-tight font-semibold text-zinc-950">
|
|
341
|
-
|
|
339
|
+
Adicione suas informações de cobrança
|
|
342
340
|
</h2>
|
|
343
341
|
<BillingFormFields form={form} />
|
|
344
342
|
</div>
|
|
345
343
|
<div className={`flex flex-col gap-6 lg:gap-8 p-4 lg:p-5 flex-1 lg:flex-none ${currentStep !== 2 ? 'hidden' : ''}`}>
|
|
346
344
|
<h2 className="font-[family-name:var(--font-outfit)] text-[18px] leading-tight font-semibold text-zinc-950">
|
|
347
|
-
|
|
345
|
+
Adicione informações do seu cartão
|
|
348
346
|
</h2>
|
|
349
347
|
<CardFormFields
|
|
350
348
|
form={form}
|
|
@@ -357,7 +355,7 @@ export default function AddCardModal() {
|
|
|
357
355
|
{currentStep === 1 ? (
|
|
358
356
|
<>
|
|
359
357
|
<Button variant="secondary" type="button" onClick={handleClose} className="h-10!">
|
|
360
|
-
|
|
358
|
+
Cancelar
|
|
361
359
|
</Button>
|
|
362
360
|
<Button
|
|
363
361
|
type="button"
|
|
@@ -365,13 +363,13 @@ export default function AddCardModal() {
|
|
|
365
363
|
onClick={handleContinue}
|
|
366
364
|
disabled={!isBillingValid}
|
|
367
365
|
>
|
|
368
|
-
|
|
366
|
+
Continuar
|
|
369
367
|
</Button>
|
|
370
368
|
</>
|
|
371
369
|
) : (
|
|
372
370
|
<>
|
|
373
371
|
<Button variant="secondary" type="button" onClick={handleBack} className="h-10!">
|
|
374
|
-
|
|
372
|
+
Voltar
|
|
375
373
|
</Button>
|
|
376
374
|
<Button
|
|
377
375
|
type="submit"
|
|
@@ -380,10 +378,10 @@ export default function AddCardModal() {
|
|
|
380
378
|
loading={isAuthenticating || isSubmitting}
|
|
381
379
|
>
|
|
382
380
|
{isAuthenticating
|
|
383
|
-
?
|
|
381
|
+
? 'Autenticando...'
|
|
384
382
|
: isSubmitting
|
|
385
|
-
?
|
|
386
|
-
:
|
|
383
|
+
? 'Adicionando cartão...'
|
|
384
|
+
: 'Adicionar cartão'}
|
|
387
385
|
</Button>
|
|
388
386
|
</>
|
|
389
387
|
)}
|
|
@@ -12,10 +12,8 @@ import { useCards } from '../../../modules/cards/hooks/cards.hook';
|
|
|
12
12
|
import { useActiveSubscription } from '../../../modules/subscriptions/hooks/find-active-subscription.hook';
|
|
13
13
|
import { useUpdateSubscriptionPayment } from '../../../modules/subscriptions/hooks/update-subscription-payment.hook';
|
|
14
14
|
import type { Card } from '../../../modules/cards/types';
|
|
15
|
-
import { useTranslations } from 'next-intl';
|
|
16
15
|
|
|
17
16
|
export function CannotDeleteCardModal() {
|
|
18
|
-
const translate = useTranslations();
|
|
19
17
|
const { activeModal, modalData, closeModal, openModal } = useModalManager();
|
|
20
18
|
const { data: cardsData } = useCards();
|
|
21
19
|
const { mutateAsync: updatePayment } = useUpdateSubscriptionPayment();
|
|
@@ -51,7 +49,7 @@ export function CannotDeleteCardModal() {
|
|
|
51
49
|
message={
|
|
52
50
|
error instanceof Error
|
|
53
51
|
? error.message
|
|
54
|
-
:
|
|
52
|
+
: 'Erro ao atualizar cartão da assinatura'
|
|
55
53
|
}
|
|
56
54
|
toastId={t}
|
|
57
55
|
/>
|
|
@@ -71,7 +69,7 @@ export function CannotDeleteCardModal() {
|
|
|
71
69
|
return (
|
|
72
70
|
<Dialog open={isOpen} onOpenChange={(open) => !open && closeModal()}>
|
|
73
71
|
<DialogTitle className="sr-only">
|
|
74
|
-
|
|
72
|
+
Não é possível excluir este cartão
|
|
75
73
|
</DialogTitle>
|
|
76
74
|
<DialogContent className="flex flex-col p-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-dvh top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-[436px] lg:h-auto lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%] overflow-hidden">
|
|
77
75
|
<div className="flex flex-col gap-5 p-4 lg:p-5">
|
|
@@ -81,10 +79,11 @@ export function CannotDeleteCardModal() {
|
|
|
81
79
|
|
|
82
80
|
<div className="flex flex-col gap-2">
|
|
83
81
|
<h2 className="paragraph-medium-semibold text-zinc-950">
|
|
84
|
-
|
|
82
|
+
Não é possível excluir este cartão
|
|
85
83
|
</h2>
|
|
86
84
|
<p className="paragraph-small-regular text-zinc-600">
|
|
87
|
-
|
|
85
|
+
Este cartão está em uso e tem uma assinatura ativa vinculada a ele.
|
|
86
|
+
Selecione outro cartão como padrão ou adicione um novo.
|
|
88
87
|
</p>
|
|
89
88
|
</div>
|
|
90
89
|
</div>
|
|
@@ -92,7 +91,7 @@ export function CannotDeleteCardModal() {
|
|
|
92
91
|
{availableCards.length > 0 && (
|
|
93
92
|
<div className="flex flex-col gap-3 px-4 lg:px-5 pb-4 lg:pb-5 overflow-y-auto max-h-[200px] flex-1 lg:flex-none">
|
|
94
93
|
<span className="paragraph-xsmall-semibold text-zinc-600">
|
|
95
|
-
|
|
94
|
+
Selecione um cartão como padrão:
|
|
96
95
|
</span>
|
|
97
96
|
{availableCards.map((card) => (
|
|
98
97
|
<CardItem
|
|
@@ -108,14 +107,14 @@ export function CannotDeleteCardModal() {
|
|
|
108
107
|
<div className="flex flex-row gap-2 p-4 lg:p-5 border-t border-zinc-200 mt-auto lg:mt-0">
|
|
109
108
|
<Button onClick={handleAddCard} className="h-10! flex-1">
|
|
110
109
|
<IconPlus size={20} />
|
|
111
|
-
|
|
110
|
+
Adicionar novo cartão
|
|
112
111
|
</Button>
|
|
113
112
|
<Button
|
|
114
113
|
variant="secondary"
|
|
115
114
|
onClick={() => closeModal()}
|
|
116
115
|
className="h-10! flex-1"
|
|
117
116
|
>
|
|
118
|
-
|
|
117
|
+
Cancelar
|
|
119
118
|
</Button>
|
|
120
119
|
</div>
|
|
121
120
|
</DialogContent>
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
CardExpiryElement,
|
|
17
17
|
CardNumberElement,
|
|
18
18
|
} from "@stripe/react-stripe-js";
|
|
19
|
-
import { useTranslations } from "next-intl";
|
|
20
19
|
|
|
21
20
|
const stripeElementOptions = {
|
|
22
21
|
style: {
|
|
@@ -92,7 +91,6 @@ export function CardFormFields({
|
|
|
92
91
|
onStripeChange,
|
|
93
92
|
stripeErrors,
|
|
94
93
|
}: CardFormFieldsProps) {
|
|
95
|
-
const translate = useTranslations();
|
|
96
94
|
const {
|
|
97
95
|
register,
|
|
98
96
|
watch,
|
|
@@ -105,8 +103,8 @@ export function CardFormFields({
|
|
|
105
103
|
return (
|
|
106
104
|
<div className="flex flex-col gap-5">
|
|
107
105
|
<FormField
|
|
108
|
-
label=
|
|
109
|
-
placeholder=
|
|
106
|
+
label="Nome impresso no cartão"
|
|
107
|
+
placeholder="Digite aqui"
|
|
110
108
|
{...register("name")}
|
|
111
109
|
error={!!errors.name}
|
|
112
110
|
errorMessage={errors.name?.message}
|
|
@@ -114,7 +112,7 @@ export function CardFormFields({
|
|
|
114
112
|
|
|
115
113
|
<div className="flex flex-col gap-1.5">
|
|
116
114
|
<label className="paragraph-xsmall-semibold text-zinc-600">
|
|
117
|
-
|
|
115
|
+
Número do cartão
|
|
118
116
|
</label>
|
|
119
117
|
<div className="h-10 px-3 flex items-center w-full border border-zinc-200 rounded-lg bg-white transition-colors focus-within:border-zinc-400 relative">
|
|
120
118
|
<div className="w-full">
|
|
@@ -136,7 +134,7 @@ export function CardFormFields({
|
|
|
136
134
|
<div className="flex gap-4">
|
|
137
135
|
<div className="flex-1 flex flex-col gap-1.5">
|
|
138
136
|
<label className="paragraph-xsmall-semibold text-zinc-600">
|
|
139
|
-
|
|
137
|
+
Data de validade
|
|
140
138
|
</label>
|
|
141
139
|
<div className="h-10 px-3 flex items-center w-full border border-zinc-200 rounded-lg bg-white transition-colors focus-within:border-zinc-400">
|
|
142
140
|
<div className="w-full">
|
|
@@ -156,7 +154,7 @@ export function CardFormFields({
|
|
|
156
154
|
</div>
|
|
157
155
|
|
|
158
156
|
<div className="flex-1 flex flex-col gap-1.5">
|
|
159
|
-
<label className="paragraph-xsmall-semibold text-zinc-600">
|
|
157
|
+
<label className="paragraph-xsmall-semibold text-zinc-600">CVC</label>
|
|
160
158
|
<div className="h-10 px-3 flex items-center w-full border border-zinc-200 rounded-lg bg-white transition-colors focus-within:border-zinc-400">
|
|
161
159
|
<div className="w-full">
|
|
162
160
|
<CardCvcElement
|
|
@@ -176,8 +174,8 @@ export function CardFormFields({
|
|
|
176
174
|
</div>
|
|
177
175
|
|
|
178
176
|
<SelectField
|
|
179
|
-
label=
|
|
180
|
-
placeholder=
|
|
177
|
+
label="País"
|
|
178
|
+
placeholder="Selecione"
|
|
181
179
|
value={watch("country")}
|
|
182
180
|
onChange={(value) => setValue("country", value as string)}
|
|
183
181
|
options={COUNTRIES.map((c) => ({ value: c.iso, label: c.name }))}
|
|
@@ -185,8 +183,8 @@ export function CardFormFields({
|
|
|
185
183
|
|
|
186
184
|
<div className="flex gap-4">
|
|
187
185
|
<SelectField
|
|
188
|
-
label=
|
|
189
|
-
placeholder=
|
|
186
|
+
label="Tipo de pessoa"
|
|
187
|
+
placeholder="Selecione"
|
|
190
188
|
value={personType}
|
|
191
189
|
onChange={(value) => {
|
|
192
190
|
setValue("personType", value as "pf" | "pj");
|
|
@@ -194,15 +192,15 @@ export function CardFormFields({
|
|
|
194
192
|
setValue("cnpj", "");
|
|
195
193
|
}}
|
|
196
194
|
options={[
|
|
197
|
-
{ value: "pf", label:
|
|
198
|
-
{ value: "pj", label:
|
|
195
|
+
{ value: "pf", label: "Pessoa física" },
|
|
196
|
+
{ value: "pj", label: "Pessoa jurídica" },
|
|
199
197
|
]}
|
|
200
198
|
containerClassName="flex-1"
|
|
201
199
|
/>
|
|
202
200
|
<div className="flex-1">
|
|
203
201
|
{personType === "pj" ? (
|
|
204
202
|
<FormField
|
|
205
|
-
label=
|
|
203
|
+
label="CNPJ"
|
|
206
204
|
placeholder="__.___.___/____-__"
|
|
207
205
|
{...register("cnpj", {
|
|
208
206
|
onChange: (e) => {
|
|
@@ -214,7 +212,7 @@ export function CardFormFields({
|
|
|
214
212
|
/>
|
|
215
213
|
) : (
|
|
216
214
|
<FormField
|
|
217
|
-
label=
|
|
215
|
+
label="CPF"
|
|
218
216
|
placeholder="___.___.___-__"
|
|
219
217
|
{...register("cpf", {
|
|
220
218
|
onChange: (e) => {
|
|
@@ -236,7 +234,6 @@ type BillingFormFieldsProps = {
|
|
|
236
234
|
};
|
|
237
235
|
|
|
238
236
|
export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
239
|
-
const translate = useTranslations();
|
|
240
237
|
const {
|
|
241
238
|
register,
|
|
242
239
|
setValue,
|
|
@@ -267,15 +264,15 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
267
264
|
return (
|
|
268
265
|
<div className="flex flex-col gap-5">
|
|
269
266
|
<FormField
|
|
270
|
-
label=
|
|
271
|
-
placeholder=
|
|
267
|
+
label="Nome completo"
|
|
268
|
+
placeholder="Digite aqui"
|
|
272
269
|
{...register("fullName")}
|
|
273
270
|
error={!!errors.fullName}
|
|
274
271
|
errorMessage={errors.fullName?.message}
|
|
275
272
|
/>
|
|
276
273
|
|
|
277
274
|
<FormField
|
|
278
|
-
label=
|
|
275
|
+
label="CEP"
|
|
279
276
|
placeholder="_____-___"
|
|
280
277
|
{...register("cep", {
|
|
281
278
|
onChange: (e) => handleCepChange(e.target.value),
|
|
@@ -287,7 +284,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
287
284
|
<div className="flex gap-4">
|
|
288
285
|
<div className="flex-[4]">
|
|
289
286
|
<FormField
|
|
290
|
-
label=
|
|
287
|
+
label="Endereço"
|
|
291
288
|
placeholder=""
|
|
292
289
|
{...register("street")}
|
|
293
290
|
error={!!errors.street}
|
|
@@ -296,7 +293,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
296
293
|
</div>
|
|
297
294
|
<div className="flex-[1]">
|
|
298
295
|
<FormField
|
|
299
|
-
label=
|
|
296
|
+
label="Número"
|
|
300
297
|
placeholder=""
|
|
301
298
|
{...register("streetNumber")}
|
|
302
299
|
error={!!errors.streetNumber}
|
|
@@ -308,7 +305,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
308
305
|
<div className="flex gap-4">
|
|
309
306
|
<div className="flex-1">
|
|
310
307
|
<FormField
|
|
311
|
-
label=
|
|
308
|
+
label="Cidade"
|
|
312
309
|
placeholder=""
|
|
313
310
|
{...register("city")}
|
|
314
311
|
error={!!errors.city}
|
|
@@ -317,7 +314,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
317
314
|
</div>
|
|
318
315
|
<div className="flex-1">
|
|
319
316
|
<FormField
|
|
320
|
-
label=
|
|
317
|
+
label="UF"
|
|
321
318
|
placeholder=""
|
|
322
319
|
{...register("state")}
|
|
323
320
|
error={!!errors.state}
|
|
@@ -328,14 +325,14 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
328
325
|
|
|
329
326
|
<div className="flex gap-4">
|
|
330
327
|
<FormField
|
|
331
|
-
label=
|
|
328
|
+
label="Bairro"
|
|
332
329
|
placeholder=""
|
|
333
330
|
{...register("neighborhood")}
|
|
334
331
|
error={!!errors.neighborhood}
|
|
335
332
|
errorMessage={errors.neighborhood?.message}
|
|
336
333
|
/>
|
|
337
334
|
<FormField
|
|
338
|
-
label=
|
|
335
|
+
label="Complemento"
|
|
339
336
|
optional
|
|
340
337
|
placeholder=""
|
|
341
338
|
{...register("complement")}
|
|
@@ -17,10 +17,8 @@ import { useModalManager } from '../../../store/useModalManager';
|
|
|
17
17
|
import { useDeleteConfirmation } from '../../../modules/cards/hooks/delete-confirmation.hook';
|
|
18
18
|
import { useDeleteCard } from '../../../modules/cards/hooks/delete-card.hook';
|
|
19
19
|
import { useCards } from '../../../modules/cards/hooks/cards.hook';
|
|
20
|
-
import { useTranslations } from 'next-intl';
|
|
21
20
|
|
|
22
21
|
export function DeleteCardModal() {
|
|
23
|
-
const translate = useTranslations();
|
|
24
22
|
const { activeModal, modalData, closeModal } = useModalManager();
|
|
25
23
|
const { form, isValidConfirmation, resetConfirmation } = useDeleteConfirmation();
|
|
26
24
|
const deleteCard = useDeleteCard();
|
|
@@ -52,7 +50,7 @@ export function DeleteCardModal() {
|
|
|
52
50
|
message={
|
|
53
51
|
error instanceof Error
|
|
54
52
|
? error.message
|
|
55
|
-
:
|
|
53
|
+
: 'Não foi possível excluir o cartão'
|
|
56
54
|
}
|
|
57
55
|
/>
|
|
58
56
|
),
|
|
@@ -69,7 +67,7 @@ export function DeleteCardModal() {
|
|
|
69
67
|
(t) => (
|
|
70
68
|
<Toast
|
|
71
69
|
variant="success"
|
|
72
|
-
message={
|
|
70
|
+
message={`O cartão •••• ${cardLastDigits} foi excluído com sucesso`}
|
|
73
71
|
toastId={t}
|
|
74
72
|
/>
|
|
75
73
|
),
|
|
@@ -87,10 +85,10 @@ export function DeleteCardModal() {
|
|
|
87
85
|
</div>
|
|
88
86
|
<div className="flex flex-col gap-2">
|
|
89
87
|
<DialogTitle className="paragraph-medium-semibold text-zinc-950">
|
|
90
|
-
|
|
88
|
+
Excluir cartão
|
|
91
89
|
</DialogTitle>
|
|
92
90
|
<DialogDescription className="paragraph-small-regular text-zinc-600">
|
|
93
|
-
{
|
|
91
|
+
Deseja realmente excluir o cartão:{' '}
|
|
94
92
|
<span className="font-semibold text-zinc-950">
|
|
95
93
|
•••• {cardLastDigits}
|
|
96
94
|
</span>
|
|
@@ -101,9 +99,9 @@ export function DeleteCardModal() {
|
|
|
101
99
|
|
|
102
100
|
<div className="px-4 lg:px-5 py-5">
|
|
103
101
|
<FormField
|
|
104
|
-
label=
|
|
102
|
+
label="Digite EXCLUIR abaixo"
|
|
105
103
|
required
|
|
106
|
-
placeholder=
|
|
104
|
+
placeholder="EXCLUIR"
|
|
107
105
|
{...form.register('confirmText')}
|
|
108
106
|
/>
|
|
109
107
|
</div>
|
|
@@ -115,7 +113,7 @@ export function DeleteCardModal() {
|
|
|
115
113
|
loading={form.formState.isSubmitting}
|
|
116
114
|
className="h-10!"
|
|
117
115
|
>
|
|
118
|
-
{form.formState.isSubmitting ?
|
|
116
|
+
{form.formState.isSubmitting ? 'Excluindo...' : 'Excluir'}
|
|
119
117
|
</Button>
|
|
120
118
|
<Button
|
|
121
119
|
type="button"
|
|
@@ -124,7 +122,7 @@ export function DeleteCardModal() {
|
|
|
124
122
|
onClick={handleClose}
|
|
125
123
|
disabled={form.formState.isSubmitting}
|
|
126
124
|
>
|
|
127
|
-
|
|
125
|
+
Cancelar
|
|
128
126
|
</Button>
|
|
129
127
|
</div>
|
|
130
128
|
</form>
|
|
@@ -5,14 +5,12 @@ import { IconAlertOctagon, IconX } from '@tabler/icons-react';
|
|
|
5
5
|
import { useActiveSubscription } from '../../modules/subscriptions/hooks/find-active-subscription.hook';
|
|
6
6
|
import { toCalendarDate } from '../../infra/utils/date';
|
|
7
7
|
import { getSubscriptionExpiryDate } from '../../modules/subscriptions/utils/get-subscription-expiry-date';
|
|
8
|
-
import { useTranslations } from 'next-intl';
|
|
9
8
|
|
|
10
9
|
interface CancelledSubscriptionBannerProps {
|
|
11
10
|
onReactivate?: () => void;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
export function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscriptionBannerProps) {
|
|
15
|
-
const translate = useTranslations();
|
|
16
14
|
const { data: { data: [subscription] = [] } = {} } = useActiveSubscription();
|
|
17
15
|
const [visible, setVisible] = useState(true);
|
|
18
16
|
const [animated, setAnimated] = useState(false);
|
|
@@ -42,7 +40,7 @@ export function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscript
|
|
|
42
40
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
43
41
|
<IconAlertOctagon size={16} className="text-white shrink-0" />
|
|
44
42
|
<span className="paragraph-xsmall-semibold text-white">
|
|
45
|
-
|
|
43
|
+
Assinatura cancelada! Suas páginas foram retiradas do ar.
|
|
46
44
|
</span>
|
|
47
45
|
</div>
|
|
48
46
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -52,7 +50,7 @@ export function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscript
|
|
|
52
50
|
onClick={onReactivate}
|
|
53
51
|
>
|
|
54
52
|
<span className="paragraph-xsmall-semibold text-white underline">
|
|
55
|
-
|
|
53
|
+
Escolher um novo plano
|
|
56
54
|
</span>
|
|
57
55
|
</button>
|
|
58
56
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import { IconAlertTriangle, IconX } from '@tabler/icons-react';
|
|
5
|
-
import { useTranslations } from 'next-intl';
|
|
6
5
|
|
|
7
6
|
interface OverdueInvoiceBannerProps {
|
|
8
7
|
onDetails?: () => void;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
export function OverdueInvoiceBanner({ onDetails }: OverdueInvoiceBannerProps) {
|
|
12
|
-
const translate = useTranslations();
|
|
13
11
|
const [visible, setVisible] = useState(true);
|
|
14
12
|
const [animated, setAnimated] = useState(false);
|
|
15
13
|
|
|
@@ -30,7 +28,7 @@ export function OverdueInvoiceBanner({ onDetails }: OverdueInvoiceBannerProps) {
|
|
|
30
28
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
31
29
|
<IconAlertTriangle size={16} className="text-white shrink-0" />
|
|
32
30
|
<span className="paragraph-xsmall-semibold text-white">
|
|
33
|
-
|
|
31
|
+
Sua assinatura está atrasada e suas páginas podem ser retiradas do ar a qualquer momento.
|
|
34
32
|
</span>
|
|
35
33
|
</div>
|
|
36
34
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -39,7 +37,7 @@ export function OverdueInvoiceBanner({ onDetails }: OverdueInvoiceBannerProps) {
|
|
|
39
37
|
className="flex items-center justify-center p-1.5 cursor-pointer"
|
|
40
38
|
onClick={onDetails}
|
|
41
39
|
>
|
|
42
|
-
<span className="paragraph-xsmall-semibold text-white underline">
|
|
40
|
+
<span className="paragraph-xsmall-semibold text-white underline">Detalhes</span>
|
|
43
41
|
</button>
|
|
44
42
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
45
43
|
<IconX size={18} className="text-orange-200" />
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import { IconAlertTriangle, IconX } from '@tabler/icons-react';
|
|
5
5
|
import { formatShortDate } from '../../infra/utils/date';
|
|
6
|
-
import { useTranslations } from 'next-intl';
|
|
7
6
|
|
|
8
7
|
interface PendingCancellationBannerProps {
|
|
9
8
|
limitDate?: Date | null;
|
|
@@ -14,7 +13,6 @@ export function PendingCancellationBanner({
|
|
|
14
13
|
limitDate,
|
|
15
14
|
onReactivate,
|
|
16
15
|
}: PendingCancellationBannerProps) {
|
|
17
|
-
const translate = useTranslations();
|
|
18
16
|
const [visible, setVisible] = useState(true);
|
|
19
17
|
const [animated, setAnimated] = useState(false);
|
|
20
18
|
|
|
@@ -37,7 +35,7 @@ export function PendingCancellationBanner({
|
|
|
37
35
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
38
36
|
<IconAlertTriangle size={16} className="text-zinc-950 shrink-0" />
|
|
39
37
|
<span className="paragraph-xsmall-semibold text-zinc-950">
|
|
40
|
-
|
|
38
|
+
Sua assinatura foi cancelada, você possui até {formattedLimitDate} com suas páginas online.
|
|
41
39
|
</span>
|
|
42
40
|
</div>
|
|
43
41
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -47,7 +45,7 @@ export function PendingCancellationBanner({
|
|
|
47
45
|
onClick={onReactivate}
|
|
48
46
|
>
|
|
49
47
|
<span className="paragraph-xsmall-semibold text-zinc-950 underline">
|
|
50
|
-
|
|
48
|
+
Reativar assinatura
|
|
51
49
|
</span>
|
|
52
50
|
</button>
|
|
53
51
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { Dispatch, RefObject, SetStateAction, UIEvent, useCallback } from 'react';
|
|
4
|
-
import { useTranslations } from 'next-intl';
|
|
5
4
|
import {
|
|
6
5
|
Button,
|
|
7
6
|
Command,
|
|
@@ -62,7 +61,6 @@ export function ProjectSelectorPopover({
|
|
|
62
61
|
onSearchChange,
|
|
63
62
|
children,
|
|
64
63
|
}: ProjectSelectorPopoverProps) {
|
|
65
|
-
const translate = useTranslations();
|
|
66
64
|
const handleListScroll = useCallback((event: UIEvent<HTMLDivElement>) => {
|
|
67
65
|
if (!hasNextPage || isFetchingNextPage || !onLoadMore) return;
|
|
68
66
|
|
|
@@ -98,10 +96,10 @@ export function ProjectSelectorPopover({
|
|
|
98
96
|
>
|
|
99
97
|
<div className="flex flex-col p-3 gap-2">
|
|
100
98
|
<div className="flex items-center justify-between">
|
|
101
|
-
<span className="paragraph-small-semibold">
|
|
99
|
+
<span className="paragraph-small-semibold">Projetos</span>
|
|
102
100
|
</div>
|
|
103
101
|
<Command className="gap-2" defaultValue=" " shouldFilter={!onSearchChange} value=" " onValueChange={() => {}}>
|
|
104
|
-
<CommandInput placeholder=
|
|
102
|
+
<CommandInput placeholder="Busque aqui" value={search} onValueChange={onSearchChange} />
|
|
105
103
|
<CommandList
|
|
106
104
|
className="custom-scrollbar paragraph-small-medium text-gray-600 max-h-[227px]"
|
|
107
105
|
onScroll={handleListScroll}
|
|
@@ -117,14 +115,14 @@ export function ProjectSelectorPopover({
|
|
|
117
115
|
<div className="flex flex-col items-center justify-center gap-2 h-full text-gray-400 py-4">
|
|
118
116
|
<IconFolderOpen size={28} className="text-gray-300" />
|
|
119
117
|
<span className="paragraph-small-medium text-center text-gray-500">
|
|
120
|
-
|
|
118
|
+
Nenhum projeto encontrado.
|
|
121
119
|
<br />
|
|
122
|
-
|
|
120
|
+
Crie um projeto para começar.
|
|
123
121
|
</span>
|
|
124
122
|
</div>
|
|
125
123
|
) : (
|
|
126
124
|
<>
|
|
127
|
-
<CommandEmpty>
|
|
125
|
+
<CommandEmpty>Nenhum resultado encontrado.</CommandEmpty>
|
|
128
126
|
{projects.map((project) => {
|
|
129
127
|
const isSelected = selectedProject?.id === project.id;
|
|
130
128
|
return (
|
|
@@ -169,7 +167,7 @@ export function ProjectSelectorPopover({
|
|
|
169
167
|
className="h-10! paragraph-small-medium text-gray-600 hover:text-gray-950 hover:bg-zinc-50 w-full justify-center"
|
|
170
168
|
onClick={onManageProjects}
|
|
171
169
|
>
|
|
172
|
-
|
|
170
|
+
Gerenciar projetos
|
|
173
171
|
</Button>
|
|
174
172
|
</>
|
|
175
173
|
)}
|