@greatapps/common 1.1.671 → 1.1.672
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/layouts/NavBar.mjs +5 -3
- package/dist/components/layouts/NavBar.mjs.map +1 -1
- package/dist/components/layouts/NotificationsPopover.mjs +5 -3
- package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
- package/dist/components/layouts/ProfilePopover.mjs +6 -4
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +9 -7
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
- package/dist/components/modals/BuyCreditsModal.mjs +17 -18
- package/dist/components/modals/BuyCreditsModal.mjs.map +1 -1
- package/dist/components/modals/CreditsDisabledModal.mjs +6 -4
- package/dist/components/modals/CreditsDisabledModal.mjs.map +1 -1
- package/dist/components/modals/PaidPlanRequiredModal.mjs +5 -3
- package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
- package/dist/components/modals/cards/AddCardModal.mjs +27 -24
- package/dist/components/modals/cards/AddCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CannotDeleteCardModal.mjs +9 -7
- package/dist/components/modals/cards/CannotDeleteCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CardFormFields.mjs +25 -22
- package/dist/components/modals/cards/CardFormFields.mjs.map +1 -1
- package/dist/components/modals/cards/DeleteCardModal.mjs +10 -8
- package/dist/components/modals/cards/DeleteCardModal.mjs.map +1 -1
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs +4 -2
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +1 -1
- package/dist/components/navigation/OverdueInvoiceBanner.mjs +4 -2
- package/dist/components/navigation/OverdueInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/PendingCancellationBanner.mjs +4 -6
- package/dist/components/navigation/PendingCancellationBanner.mjs.map +1 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs +8 -6
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -1
- package/dist/components/navigation/UpcomingInvoiceBanner.mjs +4 -6
- package/dist/components/navigation/UpcomingInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/BottomLinks.mjs +5 -3
- package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/CreditsCard.mjs +3 -1
- package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/PlanCard.mjs +3 -1
- package/dist/components/navigation/subcomponents/PlanCard.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +5 -3
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
- package/dist/components/pages/NotFoundPage.mjs +5 -3
- package/dist/components/pages/NotFoundPage.mjs.map +1 -1
- package/dist/components/pages/notifications/Notifications.mjs +13 -10
- package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
- package/dist/components/ui/buttons/CopyButton.mjs +9 -5
- package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
- package/dist/components/ui/data-display/CardItem.mjs +7 -5
- package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
- package/dist/components/ui/data-display/PaymentInfoCard.mjs +10 -8
- package/dist/components/ui/data-display/PaymentInfoCard.mjs.map +1 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs +3 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -1
- package/dist/components/ui/form/ComboboxField.mjs +11 -6
- package/dist/components/ui/form/ComboboxField.mjs.map +1 -1
- package/dist/components/ui/form/DatePicker.mjs +5 -2
- package/dist/components/ui/form/DatePicker.mjs.map +1 -1
- package/dist/components/ui/form/DateRangePicker.mjs +5 -2
- package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
- package/dist/components/ui/form/PhoneInput.mjs +5 -3
- package/dist/components/ui/form/PhoneInput.mjs.map +1 -1
- package/dist/components/ui/form/SelectField.mjs +6 -3
- package/dist/components/ui/form/SelectField.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs +11 -18
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs +6 -15
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs.map +1 -1
- package/dist/i18n/messages/en-us.mjs +231 -0
- package/dist/i18n/messages/en-us.mjs.map +1 -1
- package/dist/i18n/messages/es-es.mjs +231 -0
- package/dist/i18n/messages/es-es.mjs.map +1 -1
- package/dist/i18n/messages/pt-br.mjs +239 -0
- package/dist/i18n/messages/pt-br.mjs.map +1 -1
- package/dist/modules/cards/hooks/handle-delete-card.hook.mjs +2 -1
- package/dist/modules/cards/hooks/handle-delete-card.hook.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/layouts/NavBar.tsx +5 -3
- package/src/components/layouts/NotificationsPopover.tsx +5 -3
- package/src/components/layouts/ProfilePopover.tsx +6 -4
- package/src/components/layouts/UsersSelectorPopover.tsx +9 -7
- package/src/components/modals/BuyCreditsModal.tsx +18 -16
- package/src/components/modals/CreditsDisabledModal.tsx +6 -6
- package/src/components/modals/PaidPlanRequiredModal.tsx +5 -3
- package/src/components/modals/cards/AddCardModal.tsx +29 -27
- package/src/components/modals/cards/CannotDeleteCardModal.tsx +9 -8
- package/src/components/modals/cards/CardFormFields.tsx +25 -22
- package/src/components/modals/cards/DeleteCardModal.tsx +10 -8
- package/src/components/navigation/CancelledSubscriptionBanner.tsx +4 -2
- package/src/components/navigation/OverdueInvoiceBanner.tsx +4 -2
- package/src/components/navigation/PendingCancellationBanner.tsx +4 -2
- package/src/components/navigation/ProjectSelectorPopover.tsx +8 -6
- package/src/components/navigation/UpcomingInvoiceBanner.tsx +4 -2
- package/src/components/navigation/subcomponents/BottomLinks.tsx +5 -3
- package/src/components/navigation/subcomponents/CreditsCard.tsx +3 -1
- package/src/components/navigation/subcomponents/PlanCard.tsx +3 -1
- package/src/components/navigation/subcomponents/ProjectSelector.tsx +5 -3
- package/src/components/pages/NotFoundPage.tsx +5 -3
- package/src/components/pages/notifications/Notifications.tsx +13 -10
- package/src/components/ui/buttons/CopyButton.tsx +10 -5
- package/src/components/ui/data-display/CardItem.tsx +7 -5
- package/src/components/ui/data-display/PaymentInfoCard.tsx +10 -8
- package/src/components/ui/feedback/DefaultCircularProgress.tsx +3 -1
- package/src/components/ui/form/ComboboxField.tsx +11 -6
- package/src/components/ui/form/DatePicker.tsx +5 -2
- package/src/components/ui/form/DateRangePicker.tsx +5 -2
- package/src/components/ui/form/PhoneInput.tsx +5 -3
- package/src/components/ui/form/SelectField.tsx +6 -3
- package/src/components/widgets/ImageUpload/ImageCropModal.tsx +19 -11
- package/src/components/widgets/ImageUpload/ImageTooSmallModal.tsx +6 -5
- package/src/i18n/messages/en-us.ts +234 -0
- package/src/i18n/messages/es-es.ts +234 -0
- package/src/i18n/messages/pt-br.ts +248 -0
- package/src/modules/cards/hooks/handle-delete-card.hook.ts +8 -3
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
CardExpiryElement,
|
|
17
17
|
CardNumberElement,
|
|
18
18
|
} from "@stripe/react-stripe-js";
|
|
19
|
+
import { useTranslations } from "next-intl";
|
|
19
20
|
|
|
20
21
|
const stripeElementOptions = {
|
|
21
22
|
style: {
|
|
@@ -91,6 +92,7 @@ export function CardFormFields({
|
|
|
91
92
|
onStripeChange,
|
|
92
93
|
stripeErrors,
|
|
93
94
|
}: CardFormFieldsProps) {
|
|
95
|
+
const translate = useTranslations();
|
|
94
96
|
const {
|
|
95
97
|
register,
|
|
96
98
|
watch,
|
|
@@ -103,8 +105,8 @@ export function CardFormFields({
|
|
|
103
105
|
return (
|
|
104
106
|
<div className="flex flex-col gap-5">
|
|
105
107
|
<FormField
|
|
106
|
-
label=
|
|
107
|
-
placeholder=
|
|
108
|
+
label={translate('common.cards.form.nameOnCard')}
|
|
109
|
+
placeholder={translate('common.cards.form.typeHere')}
|
|
108
110
|
{...register("name")}
|
|
109
111
|
error={!!errors.name}
|
|
110
112
|
errorMessage={errors.name?.message}
|
|
@@ -112,7 +114,7 @@ export function CardFormFields({
|
|
|
112
114
|
|
|
113
115
|
<div className="flex flex-col gap-1.5">
|
|
114
116
|
<label className="paragraph-xsmall-semibold text-zinc-600">
|
|
115
|
-
|
|
117
|
+
{translate('common.cards.form.cardNumber')}
|
|
116
118
|
</label>
|
|
117
119
|
<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">
|
|
118
120
|
<div className="w-full">
|
|
@@ -134,7 +136,7 @@ export function CardFormFields({
|
|
|
134
136
|
<div className="flex gap-4">
|
|
135
137
|
<div className="flex-1 flex flex-col gap-1.5">
|
|
136
138
|
<label className="paragraph-xsmall-semibold text-zinc-600">
|
|
137
|
-
|
|
139
|
+
{translate('common.cards.form.cardExpiry')}
|
|
138
140
|
</label>
|
|
139
141
|
<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">
|
|
140
142
|
<div className="w-full">
|
|
@@ -154,7 +156,7 @@ export function CardFormFields({
|
|
|
154
156
|
</div>
|
|
155
157
|
|
|
156
158
|
<div className="flex-1 flex flex-col gap-1.5">
|
|
157
|
-
<label className="paragraph-xsmall-semibold text-zinc-600">
|
|
159
|
+
<label className="paragraph-xsmall-semibold text-zinc-600">{translate('common.cards.form.cardCvc')}</label>
|
|
158
160
|
<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">
|
|
159
161
|
<div className="w-full">
|
|
160
162
|
<CardCvcElement
|
|
@@ -174,8 +176,8 @@ export function CardFormFields({
|
|
|
174
176
|
</div>
|
|
175
177
|
|
|
176
178
|
<SelectField
|
|
177
|
-
label=
|
|
178
|
-
placeholder=
|
|
179
|
+
label={translate('common.cards.form.country')}
|
|
180
|
+
placeholder={translate('common.cards.form.select')}
|
|
179
181
|
value={watch("country")}
|
|
180
182
|
onChange={(value) => setValue("country", value as string)}
|
|
181
183
|
options={COUNTRIES.map((c) => ({ value: c.iso, label: c.name }))}
|
|
@@ -183,8 +185,8 @@ export function CardFormFields({
|
|
|
183
185
|
|
|
184
186
|
<div className="flex gap-4">
|
|
185
187
|
<SelectField
|
|
186
|
-
label=
|
|
187
|
-
placeholder=
|
|
188
|
+
label={translate('common.cards.form.personType')}
|
|
189
|
+
placeholder={translate('common.cards.form.select')}
|
|
188
190
|
value={personType}
|
|
189
191
|
onChange={(value) => {
|
|
190
192
|
setValue("personType", value as "pf" | "pj");
|
|
@@ -192,15 +194,15 @@ export function CardFormFields({
|
|
|
192
194
|
setValue("cnpj", "");
|
|
193
195
|
}}
|
|
194
196
|
options={[
|
|
195
|
-
{ value: "pf", label:
|
|
196
|
-
{ value: "pj", label:
|
|
197
|
+
{ value: "pf", label: translate('common.cards.form.personTypePf') },
|
|
198
|
+
{ value: "pj", label: translate('common.cards.form.personTypePj') },
|
|
197
199
|
]}
|
|
198
200
|
containerClassName="flex-1"
|
|
199
201
|
/>
|
|
200
202
|
<div className="flex-1">
|
|
201
203
|
{personType === "pj" ? (
|
|
202
204
|
<FormField
|
|
203
|
-
label=
|
|
205
|
+
label={translate('common.cards.form.cnpj')}
|
|
204
206
|
placeholder="__.___.___/____-__"
|
|
205
207
|
{...register("cnpj", {
|
|
206
208
|
onChange: (e) => {
|
|
@@ -212,7 +214,7 @@ export function CardFormFields({
|
|
|
212
214
|
/>
|
|
213
215
|
) : (
|
|
214
216
|
<FormField
|
|
215
|
-
label=
|
|
217
|
+
label={translate('common.cards.form.cpf')}
|
|
216
218
|
placeholder="___.___.___-__"
|
|
217
219
|
{...register("cpf", {
|
|
218
220
|
onChange: (e) => {
|
|
@@ -234,6 +236,7 @@ type BillingFormFieldsProps = {
|
|
|
234
236
|
};
|
|
235
237
|
|
|
236
238
|
export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
239
|
+
const translate = useTranslations();
|
|
237
240
|
const {
|
|
238
241
|
register,
|
|
239
242
|
setValue,
|
|
@@ -264,15 +267,15 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
264
267
|
return (
|
|
265
268
|
<div className="flex flex-col gap-5">
|
|
266
269
|
<FormField
|
|
267
|
-
label=
|
|
268
|
-
placeholder=
|
|
270
|
+
label={translate('common.cards.form.fullName')}
|
|
271
|
+
placeholder={translate('common.cards.form.typeHere')}
|
|
269
272
|
{...register("fullName")}
|
|
270
273
|
error={!!errors.fullName}
|
|
271
274
|
errorMessage={errors.fullName?.message}
|
|
272
275
|
/>
|
|
273
276
|
|
|
274
277
|
<FormField
|
|
275
|
-
label=
|
|
278
|
+
label={translate('common.cards.form.cep')}
|
|
276
279
|
placeholder="_____-___"
|
|
277
280
|
{...register("cep", {
|
|
278
281
|
onChange: (e) => handleCepChange(e.target.value),
|
|
@@ -284,7 +287,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
284
287
|
<div className="flex gap-4">
|
|
285
288
|
<div className="flex-[4]">
|
|
286
289
|
<FormField
|
|
287
|
-
label=
|
|
290
|
+
label={translate('common.cards.form.street')}
|
|
288
291
|
placeholder=""
|
|
289
292
|
{...register("street")}
|
|
290
293
|
error={!!errors.street}
|
|
@@ -293,7 +296,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
293
296
|
</div>
|
|
294
297
|
<div className="flex-[1]">
|
|
295
298
|
<FormField
|
|
296
|
-
label=
|
|
299
|
+
label={translate('common.cards.form.streetNumber')}
|
|
297
300
|
placeholder=""
|
|
298
301
|
{...register("streetNumber")}
|
|
299
302
|
error={!!errors.streetNumber}
|
|
@@ -305,7 +308,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
305
308
|
<div className="flex gap-4">
|
|
306
309
|
<div className="flex-1">
|
|
307
310
|
<FormField
|
|
308
|
-
label=
|
|
311
|
+
label={translate('common.cards.form.city')}
|
|
309
312
|
placeholder=""
|
|
310
313
|
{...register("city")}
|
|
311
314
|
error={!!errors.city}
|
|
@@ -314,7 +317,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
314
317
|
</div>
|
|
315
318
|
<div className="flex-1">
|
|
316
319
|
<FormField
|
|
317
|
-
label=
|
|
320
|
+
label={translate('common.cards.form.state')}
|
|
318
321
|
placeholder=""
|
|
319
322
|
{...register("state")}
|
|
320
323
|
error={!!errors.state}
|
|
@@ -325,14 +328,14 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
325
328
|
|
|
326
329
|
<div className="flex gap-4">
|
|
327
330
|
<FormField
|
|
328
|
-
label=
|
|
331
|
+
label={translate('common.cards.form.neighborhood')}
|
|
329
332
|
placeholder=""
|
|
330
333
|
{...register("neighborhood")}
|
|
331
334
|
error={!!errors.neighborhood}
|
|
332
335
|
errorMessage={errors.neighborhood?.message}
|
|
333
336
|
/>
|
|
334
337
|
<FormField
|
|
335
|
-
label=
|
|
338
|
+
label={translate('common.cards.form.complement')}
|
|
336
339
|
optional
|
|
337
340
|
placeholder=""
|
|
338
341
|
{...register("complement")}
|
|
@@ -17,8 +17,10 @@ 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';
|
|
20
21
|
|
|
21
22
|
export function DeleteCardModal() {
|
|
23
|
+
const translate = useTranslations();
|
|
22
24
|
const { activeModal, modalData, closeModal } = useModalManager();
|
|
23
25
|
const { form, isValidConfirmation, resetConfirmation } = useDeleteConfirmation();
|
|
24
26
|
const deleteCard = useDeleteCard();
|
|
@@ -50,7 +52,7 @@ export function DeleteCardModal() {
|
|
|
50
52
|
message={
|
|
51
53
|
error instanceof Error
|
|
52
54
|
? error.message
|
|
53
|
-
: '
|
|
55
|
+
: translate('common.cards.delete.errorToast')
|
|
54
56
|
}
|
|
55
57
|
/>
|
|
56
58
|
),
|
|
@@ -67,7 +69,7 @@ export function DeleteCardModal() {
|
|
|
67
69
|
(t) => (
|
|
68
70
|
<Toast
|
|
69
71
|
variant="success"
|
|
70
|
-
message={
|
|
72
|
+
message={translate('common.cards.delete.successToast', { digits: cardLastDigits })}
|
|
71
73
|
toastId={t}
|
|
72
74
|
/>
|
|
73
75
|
),
|
|
@@ -85,10 +87,10 @@ export function DeleteCardModal() {
|
|
|
85
87
|
</div>
|
|
86
88
|
<div className="flex flex-col gap-2">
|
|
87
89
|
<DialogTitle className="paragraph-medium-semibold text-zinc-950">
|
|
88
|
-
|
|
90
|
+
{translate('common.cards.delete.title')}
|
|
89
91
|
</DialogTitle>
|
|
90
92
|
<DialogDescription className="paragraph-small-regular text-zinc-600">
|
|
91
|
-
|
|
93
|
+
{translate('common.cards.delete.description')}{' '}
|
|
92
94
|
<span className="font-semibold text-zinc-950">
|
|
93
95
|
•••• {cardLastDigits}
|
|
94
96
|
</span>
|
|
@@ -99,9 +101,9 @@ export function DeleteCardModal() {
|
|
|
99
101
|
|
|
100
102
|
<div className="px-4 lg:px-5 py-5">
|
|
101
103
|
<FormField
|
|
102
|
-
label=
|
|
104
|
+
label={translate('common.cards.delete.confirmLabel')}
|
|
103
105
|
required
|
|
104
|
-
placeholder=
|
|
106
|
+
placeholder={translate('common.cards.delete.confirmPlaceholder')}
|
|
105
107
|
{...form.register('confirmText')}
|
|
106
108
|
/>
|
|
107
109
|
</div>
|
|
@@ -113,7 +115,7 @@ export function DeleteCardModal() {
|
|
|
113
115
|
loading={form.formState.isSubmitting}
|
|
114
116
|
className="h-10!"
|
|
115
117
|
>
|
|
116
|
-
{form.formState.isSubmitting ? '
|
|
118
|
+
{form.formState.isSubmitting ? translate('common.cards.delete.deleting') : translate('common.actions.delete')}
|
|
117
119
|
</Button>
|
|
118
120
|
<Button
|
|
119
121
|
type="button"
|
|
@@ -122,7 +124,7 @@ export function DeleteCardModal() {
|
|
|
122
124
|
onClick={handleClose}
|
|
123
125
|
disabled={form.formState.isSubmitting}
|
|
124
126
|
>
|
|
125
|
-
|
|
127
|
+
{translate('common.actions.cancel')}
|
|
126
128
|
</Button>
|
|
127
129
|
</div>
|
|
128
130
|
</form>
|
|
@@ -5,12 +5,14 @@ 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';
|
|
8
9
|
|
|
9
10
|
interface CancelledSubscriptionBannerProps {
|
|
10
11
|
onReactivate?: () => void;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscriptionBannerProps) {
|
|
15
|
+
const translate = useTranslations();
|
|
14
16
|
const { data: { data: [subscription] = [] } = {} } = useActiveSubscription();
|
|
15
17
|
const [visible, setVisible] = useState(true);
|
|
16
18
|
const [animated, setAnimated] = useState(false);
|
|
@@ -40,7 +42,7 @@ export function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscript
|
|
|
40
42
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
41
43
|
<IconAlertOctagon size={16} className="text-white shrink-0" />
|
|
42
44
|
<span className="paragraph-xsmall-semibold text-white">
|
|
43
|
-
|
|
45
|
+
{translate('common.navigation.banners.cancelled.message')}
|
|
44
46
|
</span>
|
|
45
47
|
</div>
|
|
46
48
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -50,7 +52,7 @@ export function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscript
|
|
|
50
52
|
onClick={onReactivate}
|
|
51
53
|
>
|
|
52
54
|
<span className="paragraph-xsmall-semibold text-white underline">
|
|
53
|
-
|
|
55
|
+
{translate('common.navigation.banners.cancelled.choosePlan')}
|
|
54
56
|
</span>
|
|
55
57
|
</button>
|
|
56
58
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
@@ -2,12 +2,14 @@
|
|
|
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';
|
|
5
6
|
|
|
6
7
|
interface OverdueInvoiceBannerProps {
|
|
7
8
|
onDetails?: () => void;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export function OverdueInvoiceBanner({ onDetails }: OverdueInvoiceBannerProps) {
|
|
12
|
+
const translate = useTranslations();
|
|
11
13
|
const [visible, setVisible] = useState(true);
|
|
12
14
|
const [animated, setAnimated] = useState(false);
|
|
13
15
|
|
|
@@ -28,7 +30,7 @@ export function OverdueInvoiceBanner({ onDetails }: OverdueInvoiceBannerProps) {
|
|
|
28
30
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
29
31
|
<IconAlertTriangle size={16} className="text-white shrink-0" />
|
|
30
32
|
<span className="paragraph-xsmall-semibold text-white">
|
|
31
|
-
|
|
33
|
+
{translate('common.navigation.banners.overdue.message')}
|
|
32
34
|
</span>
|
|
33
35
|
</div>
|
|
34
36
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -37,7 +39,7 @@ export function OverdueInvoiceBanner({ onDetails }: OverdueInvoiceBannerProps) {
|
|
|
37
39
|
className="flex items-center justify-center p-1.5 cursor-pointer"
|
|
38
40
|
onClick={onDetails}
|
|
39
41
|
>
|
|
40
|
-
<span className="paragraph-xsmall-semibold text-white underline">
|
|
42
|
+
<span className="paragraph-xsmall-semibold text-white underline">{translate('common.navigation.banners.overdue.details')}</span>
|
|
41
43
|
</button>
|
|
42
44
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
43
45
|
<IconX size={18} className="text-orange-200" />
|
|
@@ -3,6 +3,7 @@
|
|
|
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';
|
|
6
7
|
|
|
7
8
|
interface PendingCancellationBannerProps {
|
|
8
9
|
limitDate?: Date | null;
|
|
@@ -13,6 +14,7 @@ export function PendingCancellationBanner({
|
|
|
13
14
|
limitDate,
|
|
14
15
|
onReactivate,
|
|
15
16
|
}: PendingCancellationBannerProps) {
|
|
17
|
+
const translate = useTranslations();
|
|
16
18
|
const [visible, setVisible] = useState(true);
|
|
17
19
|
const [animated, setAnimated] = useState(false);
|
|
18
20
|
|
|
@@ -35,7 +37,7 @@ export function PendingCancellationBanner({
|
|
|
35
37
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
36
38
|
<IconAlertTriangle size={16} className="text-zinc-950 shrink-0" />
|
|
37
39
|
<span className="paragraph-xsmall-semibold text-zinc-950">
|
|
38
|
-
|
|
40
|
+
{translate('common.navigation.banners.pending.message', { limitDate: formattedLimitDate ?? '' })}
|
|
39
41
|
</span>
|
|
40
42
|
</div>
|
|
41
43
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -45,7 +47,7 @@ export function PendingCancellationBanner({
|
|
|
45
47
|
onClick={onReactivate}
|
|
46
48
|
>
|
|
47
49
|
<span className="paragraph-xsmall-semibold text-zinc-950 underline">
|
|
48
|
-
|
|
50
|
+
{translate('common.navigation.banners.pending.reactivate')}
|
|
49
51
|
</span>
|
|
50
52
|
</button>
|
|
51
53
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { Dispatch, RefObject, SetStateAction, UIEvent, useCallback } from 'react';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
4
5
|
import {
|
|
5
6
|
Button,
|
|
6
7
|
Command,
|
|
@@ -61,6 +62,7 @@ export function ProjectSelectorPopover({
|
|
|
61
62
|
onSearchChange,
|
|
62
63
|
children,
|
|
63
64
|
}: ProjectSelectorPopoverProps) {
|
|
65
|
+
const translate = useTranslations();
|
|
64
66
|
const handleListScroll = useCallback((event: UIEvent<HTMLDivElement>) => {
|
|
65
67
|
if (!hasNextPage || isFetchingNextPage || !onLoadMore) return;
|
|
66
68
|
|
|
@@ -96,10 +98,10 @@ export function ProjectSelectorPopover({
|
|
|
96
98
|
>
|
|
97
99
|
<div className="flex flex-col p-3 gap-2">
|
|
98
100
|
<div className="flex items-center justify-between">
|
|
99
|
-
<span className="paragraph-small-semibold">
|
|
101
|
+
<span className="paragraph-small-semibold">{translate('common.navigation.projectSelector.title')}</span>
|
|
100
102
|
</div>
|
|
101
103
|
<Command className="gap-2" defaultValue=" " shouldFilter={!onSearchChange} value=" " onValueChange={() => {}}>
|
|
102
|
-
<CommandInput placeholder=
|
|
104
|
+
<CommandInput placeholder={translate('common.navigation.projectSelector.searchPlaceholder')} value={search} onValueChange={onSearchChange} />
|
|
103
105
|
<CommandList
|
|
104
106
|
className="custom-scrollbar paragraph-small-medium text-gray-600 max-h-[227px]"
|
|
105
107
|
onScroll={handleListScroll}
|
|
@@ -115,14 +117,14 @@ export function ProjectSelectorPopover({
|
|
|
115
117
|
<div className="flex flex-col items-center justify-center gap-2 h-full text-gray-400 py-4">
|
|
116
118
|
<IconFolderOpen size={28} className="text-gray-300" />
|
|
117
119
|
<span className="paragraph-small-medium text-center text-gray-500">
|
|
118
|
-
|
|
120
|
+
{translate('common.navigation.projectSelector.emptyLine1')}
|
|
119
121
|
<br />
|
|
120
|
-
|
|
122
|
+
{translate('common.navigation.projectSelector.emptyLine2')}
|
|
121
123
|
</span>
|
|
122
124
|
</div>
|
|
123
125
|
) : (
|
|
124
126
|
<>
|
|
125
|
-
<CommandEmpty>
|
|
127
|
+
<CommandEmpty>{translate('common.navigation.projectSelector.noResults')}</CommandEmpty>
|
|
126
128
|
{projects.map((project) => {
|
|
127
129
|
const isSelected = selectedProject?.id === project.id;
|
|
128
130
|
return (
|
|
@@ -167,7 +169,7 @@ export function ProjectSelectorPopover({
|
|
|
167
169
|
className="h-10! paragraph-small-medium text-gray-600 hover:text-gray-950 hover:bg-zinc-50 w-full justify-center"
|
|
168
170
|
onClick={onManageProjects}
|
|
169
171
|
>
|
|
170
|
-
|
|
172
|
+
{translate('common.navigation.projectSelector.manageProjects')}
|
|
171
173
|
</Button>
|
|
172
174
|
</>
|
|
173
175
|
)}
|
|
@@ -3,6 +3,7 @@
|
|
|
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';
|
|
6
7
|
|
|
7
8
|
interface UpcomingInvoiceBannerProps {
|
|
8
9
|
dueDate?: Date | null;
|
|
@@ -10,6 +11,7 @@ interface UpcomingInvoiceBannerProps {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export function UpcomingInvoiceBanner({ dueDate, onDetails }: UpcomingInvoiceBannerProps) {
|
|
14
|
+
const translate = useTranslations();
|
|
13
15
|
const [visible, setVisible] = useState(true);
|
|
14
16
|
const [animated, setAnimated] = useState(false);
|
|
15
17
|
|
|
@@ -32,7 +34,7 @@ export function UpcomingInvoiceBanner({ dueDate, onDetails }: UpcomingInvoiceBan
|
|
|
32
34
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
33
35
|
<IconAlertTriangle size={16} className="text-zinc-950 shrink-0" />
|
|
34
36
|
<span className="paragraph-xsmall-semibold text-zinc-950">
|
|
35
|
-
|
|
37
|
+
{translate('common.navigation.banners.upcoming.message', { dueDate: formattedDueDate ?? '' })}
|
|
36
38
|
</span>
|
|
37
39
|
</div>
|
|
38
40
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -41,7 +43,7 @@ export function UpcomingInvoiceBanner({ dueDate, onDetails }: UpcomingInvoiceBan
|
|
|
41
43
|
className="flex items-center justify-center p-1.5 cursor-pointer"
|
|
42
44
|
onClick={onDetails}
|
|
43
45
|
>
|
|
44
|
-
<span className="paragraph-xsmall-semibold text-zinc-950 underline">
|
|
46
|
+
<span className="paragraph-xsmall-semibold text-zinc-950 underline">{translate('common.navigation.banners.upcoming.details')}</span>
|
|
45
47
|
</button>
|
|
46
48
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
47
49
|
<IconX size={18} className="text-zinc-700" />
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { IconHelp, IconBulb, IconStar, type TablerIcon } from '@tabler/icons-react';
|
|
4
4
|
import { useIsDefaultWhitelabel, useWhitelabel } from '../../../providers/whitelabel.provider';
|
|
5
|
+
import { useTranslations } from 'next-intl';
|
|
5
6
|
|
|
6
7
|
interface BottomLink {
|
|
7
8
|
label: string;
|
|
@@ -17,6 +18,7 @@ function openFrillWidget() {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export function BottomLinks() {
|
|
21
|
+
const translate = useTranslations();
|
|
20
22
|
const { whitelabel } = useWhitelabel();
|
|
21
23
|
const isMainWhitelabel = useIsDefaultWhitelabel();
|
|
22
24
|
|
|
@@ -26,7 +28,7 @@ export function BottomLinks() {
|
|
|
26
28
|
...(isMainWhitelabel
|
|
27
29
|
? [
|
|
28
30
|
{
|
|
29
|
-
label: '
|
|
31
|
+
label: translate('common.navigation.bottomLinks.news'),
|
|
30
32
|
icon: IconStar,
|
|
31
33
|
className: 'novidades',
|
|
32
34
|
onClick: openFrillWidget,
|
|
@@ -34,14 +36,14 @@ export function BottomLinks() {
|
|
|
34
36
|
]
|
|
35
37
|
: []),
|
|
36
38
|
{
|
|
37
|
-
label: '
|
|
39
|
+
label: translate('common.navigation.bottomLinks.helpCenter'),
|
|
38
40
|
icon: IconHelp,
|
|
39
41
|
href: helpUrl,
|
|
40
42
|
},
|
|
41
43
|
...(isMainWhitelabel
|
|
42
44
|
? [
|
|
43
45
|
{
|
|
44
|
-
label: '
|
|
46
|
+
label: translate('common.navigation.bottomLinks.sendSuggestions'),
|
|
45
47
|
icon: IconBulb,
|
|
46
48
|
href: 'https://ideias.greatpages.com.br/b/y0geg1ve/feature-ideas',
|
|
47
49
|
},
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useAppNavigationContext } from '../AppNavigationContext';
|
|
4
4
|
import { Progress } from '../../../index';
|
|
5
|
+
import { useTranslations } from 'next-intl';
|
|
5
6
|
import { useBuyCreditsModal } from '../../../store/useBuyCreditsModal';
|
|
6
7
|
import { useCreditsDisabledModal } from '../../../store/useCreditsDisabledModal';
|
|
7
8
|
import { useAuth } from '../../../providers/auth.provider';
|
|
@@ -13,6 +14,7 @@ export interface CreditsCardProps {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export function CreditsCard({ used, total, onClick }: CreditsCardProps) {
|
|
17
|
+
const translate = useTranslations();
|
|
16
18
|
const { breakpoint } = useAppNavigationContext();
|
|
17
19
|
const { openModal } = useBuyCreditsModal();
|
|
18
20
|
const { openModal: openDisabledModal } = useCreditsDisabledModal();
|
|
@@ -35,7 +37,7 @@ export function CreditsCard({ used, total, onClick }: CreditsCardProps) {
|
|
|
35
37
|
onClick={handleClick}
|
|
36
38
|
>
|
|
37
39
|
<div className="flex items-center justify-between">
|
|
38
|
-
<span className="paragraph-xsmall-semibold text-white">
|
|
40
|
+
<span className="paragraph-xsmall-semibold text-white">{translate('common.navigation.creditsCard.label')}</span>
|
|
39
41
|
<span className="paragraph-xsmall-medium text-white/50">{used} / {total}</span>
|
|
40
42
|
</div>
|
|
41
43
|
<Progress className="bg-white/10 h-[6px]" indicatorColor="bg-white" value={Math.round((used / total) * 100)} />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { Button, Progress } from '../../../index';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
4
5
|
|
|
5
6
|
export interface PlanCardProps {
|
|
6
7
|
planName: string;
|
|
@@ -10,6 +11,7 @@ export interface PlanCardProps {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export function PlanCard({ planName, trialLabel, progressValue, onKnowPlans }: PlanCardProps) {
|
|
14
|
+
const translate = useTranslations();
|
|
13
15
|
return (
|
|
14
16
|
<div className="flex flex-col rounded-md p-4 gap-4 bg-gray-50">
|
|
15
17
|
<div className="flex flex-col gap-1">
|
|
@@ -22,7 +24,7 @@ export function PlanCard({ planName, trialLabel, progressValue, onKnowPlans }: P
|
|
|
22
24
|
className="paragraph-small-semibold text-gray-950"
|
|
23
25
|
onClick={onKnowPlans}
|
|
24
26
|
>
|
|
25
|
-
|
|
27
|
+
{translate('common.navigation.planCard.knowPlans')}
|
|
26
28
|
</Button>
|
|
27
29
|
</div>
|
|
28
30
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useState, useRef, useEffect, useMemo, RefObject } from 'react';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
4
5
|
import { useMobileNavbarSheet } from '../../../store/useMobileNavbarSheet';
|
|
5
6
|
import { useAppNavigationContext } from '../AppNavigationContext';
|
|
6
7
|
import { ProjectSelectorPopover } from '../ProjectSelectorPopover';
|
|
@@ -30,6 +31,7 @@ export function ProjectSelector({
|
|
|
30
31
|
onSelectProject,
|
|
31
32
|
onManageProjects,
|
|
32
33
|
}: ProjectSelectorProps) {
|
|
34
|
+
const translate = useTranslations();
|
|
33
35
|
const isMainWhitelabel = useIsDefaultWhitelabel();
|
|
34
36
|
const { breakpoint } = useAppNavigationContext();
|
|
35
37
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
@@ -124,10 +126,10 @@ export function ProjectSelector({
|
|
|
124
126
|
{activeSection === 'projects' && (
|
|
125
127
|
<div className="flex flex-col p-3 gap-2 border border-gray-200 rounded-lg animate-in fade-in duration-400">
|
|
126
128
|
<div className="flex items-center justify-between">
|
|
127
|
-
<span className="paragraph-small-semibold">
|
|
129
|
+
<span className="paragraph-small-semibold">{translate('common.navigation.projectSelector.title')}</span>
|
|
128
130
|
</div>
|
|
129
131
|
<Command className="gap-2" shouldFilter={false}>
|
|
130
|
-
<CommandInput placeholder=
|
|
132
|
+
<CommandInput placeholder={translate('common.navigation.projectSelector.searchPlaceholder')} value={search} onValueChange={setSearch} />
|
|
131
133
|
<CommandList
|
|
132
134
|
className="custom-scrollbar paragraph-small-medium text-gray-600 h-[227px]"
|
|
133
135
|
onScroll={(event) => {
|
|
@@ -141,7 +143,7 @@ export function ProjectSelector({
|
|
|
141
143
|
}
|
|
142
144
|
}}
|
|
143
145
|
>
|
|
144
|
-
<CommandEmpty>
|
|
146
|
+
<CommandEmpty>{translate('common.navigation.projectSelector.noResults')}</CommandEmpty>
|
|
145
147
|
{showListSkeleton ? (
|
|
146
148
|
<>
|
|
147
149
|
<ProjectItemSkeleton />
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import Image from "next/image";
|
|
4
4
|
import { useEffect } from "react";
|
|
5
|
+
import { useTranslations } from "next-intl";
|
|
5
6
|
import { useRouter } from "next/navigation";
|
|
6
7
|
import { useWhitelabel, useIsDefaultWhitelabel } from "../../providers/whitelabel.provider";
|
|
7
8
|
import { Button } from "../ui/buttons/Button";
|
|
@@ -18,6 +19,7 @@ function GreatAppsLogo() {
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export function NotFoundPage() {
|
|
22
|
+
const translate = useTranslations();
|
|
21
23
|
const router = useRouter();
|
|
22
24
|
|
|
23
25
|
useEffect(() => {
|
|
@@ -47,11 +49,11 @@ export function NotFoundPage() {
|
|
|
47
49
|
</div>
|
|
48
50
|
|
|
49
51
|
<h1 className="max-w-[554px] px-6 font-[family-name:var(--font-outfit)] text-[32px] leading-[36px] font-semibold text-zinc-950 sm:px-0 sm:text-[56px] sm:leading-[56px]">
|
|
50
|
-
|
|
52
|
+
{translate('common.notFound.title')}
|
|
51
53
|
</h1>
|
|
52
54
|
|
|
53
55
|
<p className="max-w-[496px] px-6 paragraph-medium-medium text-zinc-950 sm:px-0">
|
|
54
|
-
|
|
56
|
+
{translate('common.notFound.description')}
|
|
55
57
|
</p>
|
|
56
58
|
|
|
57
59
|
<Button
|
|
@@ -65,7 +67,7 @@ export function NotFoundPage() {
|
|
|
65
67
|
}
|
|
66
68
|
}}
|
|
67
69
|
>
|
|
68
|
-
|
|
70
|
+
{translate('common.notFound.backToHome')}
|
|
69
71
|
</Button>
|
|
70
72
|
</div>
|
|
71
73
|
</div>
|