@greatapps/common 1.1.675 → 1.1.677
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 +8 -6
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +20 -19
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +10 -11
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs +34 -28
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +7 -5
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +8 -9
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/TwoFactorAuthModal.mjs +22 -23
- 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 +5 -3
- package/dist/components/account/hooks/useChangeEmailForm.mjs.map +1 -1
- package/dist/components/account/hooks/useChangePasswordForm.mjs +26 -3
- package/dist/components/account/hooks/useChangePasswordForm.mjs.map +1 -1
- package/dist/components/account/hooks/useChangePhoneForm.mjs +18 -9
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -1
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +26 -3
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/account/hooks/useOtpVerification.mjs +19 -3
- package/dist/components/account/hooks/useOtpVerification.mjs.map +1 -1
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +27 -4
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs +25 -28
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs +8 -6
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs +24 -27
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -1
- package/dist/components/account/sections/MyProfileSection.mjs +37 -22
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/account/sections/PreferencesSection.mjs +48 -24
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
- package/dist/components/account/sections/SecuritySection.mjs +11 -9
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
- package/dist/components/account/sections/TokenSection.mjs +24 -8
- package/dist/components/account/sections/TokenSection.mjs.map +1 -1
- package/dist/components/layouts/AppMobileNavBar.mjs +2 -148
- package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
- 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 +64 -46
- 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 +65 -51
- 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/CircularProgress.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/config.mjs +13 -0
- package/dist/i18n/config.mjs.map +1 -0
- package/dist/i18n/country-language.mjs +74 -0
- package/dist/i18n/country-language.mjs.map +1 -0
- package/dist/i18n/messages/en-us.mjs +494 -0
- package/dist/i18n/messages/en-us.mjs.map +1 -0
- package/dist/i18n/messages/es-es.mjs +494 -0
- package/dist/i18n/messages/es-es.mjs.map +1 -0
- package/dist/i18n/messages/index.mjs +16 -0
- package/dist/i18n/messages/index.mjs.map +1 -0
- package/dist/i18n/messages/pt-br.mjs +507 -0
- package/dist/i18n/messages/pt-br.mjs.map +1 -0
- package/dist/i18n/normalize.mjs +12 -0
- package/dist/i18n/normalize.mjs.map +1 -0
- package/dist/i18n/resolve-locale.mjs +42 -0
- package/dist/i18n/resolve-locale.mjs.map +1 -0
- package/dist/i18n.mjs +14 -0
- package/dist/i18n.mjs.map +1 -0
- package/dist/index.mjs +19 -3
- package/dist/index.mjs.map +1 -1
- package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs +20 -0
- package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs.map +1 -0
- 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/dist/modules/images/utils/validate-image.mjs +8 -8
- package/dist/modules/images/utils/validate-image.mjs.map +1 -1
- package/dist/modules/plans/hooks/list-plans.hook.mjs +2 -2
- package/dist/modules/plans/hooks/list-plans.hook.mjs.map +1 -1
- package/dist/modules/plans/types/plan.type.mjs +5 -1
- package/dist/modules/plans/types/plan.type.mjs.map +1 -1
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs +61 -35
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs.map +1 -1
- package/dist/modules/projects/services/projects.service.mjs +9 -0
- package/dist/modules/projects/services/projects.service.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/periodicity.mjs +20 -14
- package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
- package/dist/providers/auth.provider.mjs +9 -1
- package/dist/providers/auth.provider.mjs.map +1 -1
- package/dist/server.mjs +2 -0
- package/dist/server.mjs.map +1 -1
- package/dist/utils/format/currency.mjs +32 -4
- package/dist/utils/format/currency.mjs.map +1 -1
- package/dist/utils/intl/cookie-domain.mjs +17 -0
- package/dist/utils/intl/cookie-domain.mjs.map +1 -0
- package/dist/utils/intl/locale-cookie.mjs +13 -0
- package/dist/utils/intl/locale-cookie.mjs.map +1 -0
- package/dist/utils/intl/locales.mjs +3 -2
- package/dist/utils/intl/locales.mjs.map +1 -1
- package/package.json +7 -1
- package/src/components/account/ConfigurationsMyAccountModal.tsx +10 -6
- package/src/components/account/ConfirmDeleteAccountModal.tsx +22 -13
- package/src/components/account/ConfirmGlobalPreferencesModal.tsx +12 -10
- package/src/components/account/DeleteAccountModal.tsx +34 -24
- package/src/components/account/DisableTwoFactorAuthModal.tsx +11 -6
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +8 -6
- package/src/components/account/TwoFactorAuthModal.tsx +33 -29
- package/src/components/account/constants.ts +8 -5
- package/src/components/account/hooks/useChangeEmailForm.tsx +5 -3
- package/src/components/account/hooks/useChangePasswordForm.tsx +20 -6
- package/src/components/account/hooks/useChangePhoneForm.tsx +16 -10
- package/src/components/account/hooks/useDisableTwoFactorAuthForm.tsx +20 -6
- package/src/components/account/hooks/useOtpVerification.tsx +16 -4
- package/src/components/account/hooks/useTwoFactorAuthForm.tsx +21 -7
- package/src/components/account/sections/ChangeEmailModal.tsx +35 -21
- package/src/components/account/sections/ChangePasswordSection.tsx +10 -6
- package/src/components/account/sections/ChangePhoneModal.tsx +50 -22
- package/src/components/account/sections/MyProfileSection.tsx +37 -23
- package/src/components/account/sections/PreferencesSection.tsx +52 -25
- package/src/components/account/sections/SecuritySection.tsx +19 -10
- package/src/components/account/sections/TokenSection.tsx +22 -10
- package/src/components/layouts/AppMobileNavBar.tsx +1 -154
- 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 +89 -62
- package/src/components/modals/cards/CannotDeleteCardModal.tsx +9 -8
- package/src/components/modals/cards/CardFormFields.tsx +93 -75
- 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/CircularProgress.tsx +4 -0
- 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/config.ts +17 -0
- package/src/i18n/country-language.ts +60 -0
- package/src/i18n/messages/en-us.ts +514 -0
- package/src/i18n/messages/es-es.ts +515 -0
- package/src/i18n/messages/index.ts +24 -0
- package/src/i18n/messages/pt-br.ts +538 -0
- package/src/i18n/normalize.ts +15 -0
- package/src/i18n/resolve-locale.ts +77 -0
- package/src/i18n.ts +10 -0
- package/src/index.ts +13 -2
- package/src/modules/accounts/hooks/use-currency-formatter.hook.tsx +32 -0
- package/src/modules/cards/hooks/handle-delete-card.hook.ts +8 -3
- package/src/modules/images/utils/validate-image.ts +23 -8
- package/src/modules/plans/hooks/list-plans.hook.ts +2 -2
- package/src/modules/plans/types/plan.type.ts +4 -0
- package/src/modules/plans/utils/map-api-plan-to-ui.ts +109 -47
- package/src/modules/projects/services/projects.service.ts +12 -0
- package/src/modules/subscriptions/utils/periodicity.ts +29 -12
- package/src/providers/auth.provider.tsx +13 -1
- package/src/server.ts +2 -0
- package/src/utils/format/currency.ts +62 -7
- package/src/utils/intl/cookie-domain.ts +29 -0
- package/src/utils/intl/locale-cookie.ts +18 -0
- package/src/utils/intl/locales.ts +3 -2
|
@@ -4,20 +4,13 @@ import { ReactNode } from "react";
|
|
|
4
4
|
import Image from "next/image";
|
|
5
5
|
import { IconMenu2, IconX } from "@tabler/icons-react";
|
|
6
6
|
import { ProfilePopover } from "./ProfilePopover";
|
|
7
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/overlay/Tooltip";
|
|
8
7
|
import { useMobileNavbarSheet } from "../../store/useMobileNavbarSheet";
|
|
9
|
-
import {
|
|
10
|
-
useWhitelabel,
|
|
11
|
-
useIsDefaultWhitelabel,
|
|
12
|
-
} from "../../providers/whitelabel.provider";
|
|
13
|
-
import { cn } from "../../infra/utils/clsx";
|
|
8
|
+
import { useIsDefaultWhitelabel } from "../../providers/whitelabel.provider";
|
|
14
9
|
import type { ProfileMenuItem } from "./ProfilePopover";
|
|
15
10
|
|
|
16
11
|
export interface AppMobileNavBarProps {
|
|
17
12
|
/** Which app is currently active — controls which icon gets the indicator */
|
|
18
13
|
activeApp?: "gapps" | "gpages";
|
|
19
|
-
/** Called when the GreatApps logo is clicked */
|
|
20
|
-
onLogoClick?: () => void;
|
|
21
14
|
/** Called when the app icon (e.g. GreatPages) is clicked */
|
|
22
15
|
onAppIconClick?: () => void;
|
|
23
16
|
/** Extra slot rendered after the app icon (e.g. project selector) */
|
|
@@ -28,165 +21,19 @@ export interface AppMobileNavBarProps {
|
|
|
28
21
|
|
|
29
22
|
export function AppMobileNavBar({
|
|
30
23
|
activeApp,
|
|
31
|
-
onLogoClick,
|
|
32
24
|
onAppIconClick,
|
|
33
25
|
extraLeftSlot,
|
|
34
26
|
menuItems = [],
|
|
35
27
|
showMenuToggle = true,
|
|
36
28
|
}: AppMobileNavBarProps) {
|
|
37
29
|
const { isOpen, toggle } = useMobileNavbarSheet();
|
|
38
|
-
const { whitelabel } = useWhitelabel();
|
|
39
30
|
const isDefaultWl = useIsDefaultWhitelabel();
|
|
40
|
-
const primaryColor = whitelabel?.general?.primary_color;
|
|
41
|
-
const wlName = whitelabel?.name || "Great";
|
|
42
31
|
|
|
43
|
-
const isGappsActive = activeApp === "gapps";
|
|
44
32
|
const isGpagesActive = activeApp === "gpages";
|
|
45
33
|
|
|
46
|
-
const wlIcon = whitelabel?.secondary_logo ? (
|
|
47
|
-
<Image
|
|
48
|
-
className="size-7 object-contain"
|
|
49
|
-
src={`${process.env.NEXT_PUBLIC_STORAGE_URL}/${whitelabel.secondary_logo}`}
|
|
50
|
-
alt={`${wlName} Logo`}
|
|
51
|
-
width={28}
|
|
52
|
-
height={28}
|
|
53
|
-
/>
|
|
54
|
-
) : (
|
|
55
|
-
<div
|
|
56
|
-
className={cn(
|
|
57
|
-
"size-10 rounded-lg flex items-center justify-center transition-opacity duration-300",
|
|
58
|
-
!isGappsActive && "opacity-20",
|
|
59
|
-
)}
|
|
60
|
-
style={{ backgroundColor: primaryColor }}
|
|
61
|
-
>
|
|
62
|
-
<svg
|
|
63
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
64
|
-
width="24"
|
|
65
|
-
height="24"
|
|
66
|
-
viewBox="0 0 24 24"
|
|
67
|
-
fill="none"
|
|
68
|
-
stroke="white"
|
|
69
|
-
strokeWidth="2"
|
|
70
|
-
strokeLinecap="round"
|
|
71
|
-
strokeLinejoin="round"
|
|
72
|
-
>
|
|
73
|
-
<path d="M4 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4" />
|
|
74
|
-
<path d="M14 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4" />
|
|
75
|
-
<path d="M4 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4" />
|
|
76
|
-
<path d="M14 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4" />
|
|
77
|
-
</svg>
|
|
78
|
-
</div>
|
|
79
|
-
);
|
|
80
|
-
|
|
81
34
|
return (
|
|
82
35
|
<div className="fixed top-0 left-0 right-0 flex md:hidden items-center justify-between p-4 bg-white z-50 border-b border-gray-200">
|
|
83
36
|
<div className="flex items-center gap-1.5">
|
|
84
|
-
{/* GreatApps logo */}
|
|
85
|
-
<div className="relative">
|
|
86
|
-
<Tooltip>
|
|
87
|
-
<TooltipTrigger asChild>
|
|
88
|
-
<div
|
|
89
|
-
className={cn(
|
|
90
|
-
"flex items-center justify-center",
|
|
91
|
-
onLogoClick ? "cursor-pointer" : "",
|
|
92
|
-
)}
|
|
93
|
-
onClick={onLogoClick}
|
|
94
|
-
>
|
|
95
|
-
{isDefaultWl ? (
|
|
96
|
-
<div className="size-10 flex items-center justify-center rounded-lg">
|
|
97
|
-
<Image
|
|
98
|
-
src="/icons/great-icon.svg"
|
|
99
|
-
alt="Great Icon"
|
|
100
|
-
width={28}
|
|
101
|
-
height={28}
|
|
102
|
-
/>
|
|
103
|
-
</div>
|
|
104
|
-
) : (
|
|
105
|
-
wlIcon
|
|
106
|
-
)}
|
|
107
|
-
</div>
|
|
108
|
-
</TooltipTrigger>
|
|
109
|
-
<TooltipContent side="bottom">{wlName}</TooltipContent>
|
|
110
|
-
</Tooltip>
|
|
111
|
-
<div
|
|
112
|
-
className={cn(
|
|
113
|
-
"absolute -bottom-[17px] left-1/2 -translate-x-1/2 w-5 h-[3px] rounded-t-xl transition-opacity duration-300",
|
|
114
|
-
isDefaultWl ? "bg-gray-950" : "",
|
|
115
|
-
isGappsActive ? "opacity-100" : "opacity-0",
|
|
116
|
-
)}
|
|
117
|
-
style={!isDefaultWl ? { backgroundColor: primaryColor } : undefined}
|
|
118
|
-
/>
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
|
-
{/* GreatPages icon */}
|
|
122
|
-
<div className="relative">
|
|
123
|
-
<Tooltip>
|
|
124
|
-
<TooltipTrigger asChild>
|
|
125
|
-
<div
|
|
126
|
-
className={cn(
|
|
127
|
-
"size-10 rounded-lg flex items-center justify-center border-2 ring-2 transition-colors duration-300",
|
|
128
|
-
isGpagesActive
|
|
129
|
-
? isDefaultWl
|
|
130
|
-
? "bg-cyan-100 border-white ring-cyan-300"
|
|
131
|
-
: "border-white ring-transparent"
|
|
132
|
-
: isDefaultWl
|
|
133
|
-
? "hover:bg-gray-100 border-transparent ring-transparent"
|
|
134
|
-
: "border-transparent ring-transparent",
|
|
135
|
-
onAppIconClick ? "cursor-pointer" : "",
|
|
136
|
-
)}
|
|
137
|
-
style={
|
|
138
|
-
!isDefaultWl
|
|
139
|
-
? {
|
|
140
|
-
backgroundColor: primaryColor,
|
|
141
|
-
boxShadow: isGpagesActive
|
|
142
|
-
? `0 0 0 2px ${primaryColor}40`
|
|
143
|
-
: undefined,
|
|
144
|
-
opacity: !isGpagesActive ? 0.2 : undefined,
|
|
145
|
-
}
|
|
146
|
-
: undefined
|
|
147
|
-
}
|
|
148
|
-
onClick={onAppIconClick}
|
|
149
|
-
>
|
|
150
|
-
{isDefaultWl ? (
|
|
151
|
-
<Image
|
|
152
|
-
src="/icons/icon-navbar.svg"
|
|
153
|
-
alt="GreatPages"
|
|
154
|
-
width={24}
|
|
155
|
-
height={24}
|
|
156
|
-
/>
|
|
157
|
-
) : (
|
|
158
|
-
<svg
|
|
159
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
160
|
-
width="24"
|
|
161
|
-
height="24"
|
|
162
|
-
viewBox="0 0 24 24"
|
|
163
|
-
fill="none"
|
|
164
|
-
stroke="white"
|
|
165
|
-
strokeWidth="2"
|
|
166
|
-
strokeLinecap="round"
|
|
167
|
-
strokeLinejoin="round"
|
|
168
|
-
>
|
|
169
|
-
<path d="M4 8h16" />
|
|
170
|
-
<path d="M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12" />
|
|
171
|
-
<path d="M8 4v4" />
|
|
172
|
-
</svg>
|
|
173
|
-
)}
|
|
174
|
-
</div>
|
|
175
|
-
</TooltipTrigger>
|
|
176
|
-
<TooltipContent side="bottom">
|
|
177
|
-
{isDefaultWl ? "GreatPages" : "Páginas"}
|
|
178
|
-
</TooltipContent>
|
|
179
|
-
</Tooltip>
|
|
180
|
-
<div
|
|
181
|
-
className={cn(
|
|
182
|
-
"absolute -bottom-[17px] left-1/2 -translate-x-1/2 w-5 h-[3px] rounded-t-xl transition-opacity duration-300",
|
|
183
|
-
isDefaultWl ? "bg-cyan-300" : "",
|
|
184
|
-
isGpagesActive ? "opacity-100" : "opacity-0",
|
|
185
|
-
)}
|
|
186
|
-
style={!isDefaultWl ? { backgroundColor: primaryColor } : undefined}
|
|
187
|
-
/>
|
|
188
|
-
</div>
|
|
189
|
-
|
|
190
37
|
{extraLeftSlot}
|
|
191
38
|
</div>
|
|
192
39
|
<div className="flex items-center gap-1.5">
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import Image from "next/image";
|
|
5
5
|
import Link from "next/link";
|
|
6
|
+
import { useTranslations } from "next-intl";
|
|
6
7
|
import { IconChevronRight } from "@tabler/icons-react";
|
|
7
8
|
import { Separator } from "../ui/data-display/Separator";
|
|
8
9
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/overlay/Tooltip";
|
|
@@ -35,6 +36,7 @@ function NavBar({
|
|
|
35
36
|
children,
|
|
36
37
|
className,
|
|
37
38
|
}: NavBarProps) {
|
|
39
|
+
const translate = useTranslations();
|
|
38
40
|
const { isExpanded: isDesktopExpanded, toggle: toggleDesktop } =
|
|
39
41
|
useDesktopSidebarStore();
|
|
40
42
|
useDesktopSidebarHydration();
|
|
@@ -128,7 +130,7 @@ function NavBar({
|
|
|
128
130
|
<IconChevronRight size={16} className="text-gray-500" />
|
|
129
131
|
</button>
|
|
130
132
|
</TooltipTrigger>
|
|
131
|
-
<TooltipContent side="right">
|
|
133
|
+
<TooltipContent side="right">{translate('common.layout.navbar.expandMenu')}</TooltipContent>
|
|
132
134
|
</Tooltip>
|
|
133
135
|
)}
|
|
134
136
|
{/* Desktop expand button */}
|
|
@@ -142,7 +144,7 @@ function NavBar({
|
|
|
142
144
|
<IconChevronRight size={16} className="text-gray-500" />
|
|
143
145
|
</button>
|
|
144
146
|
</TooltipTrigger>
|
|
145
|
-
<TooltipContent side="right">
|
|
147
|
+
<TooltipContent side="right">{translate('common.layout.navbar.expandMenu')}</TooltipContent>
|
|
146
148
|
</Tooltip>
|
|
147
149
|
)}
|
|
148
150
|
</div>
|
|
@@ -203,7 +205,7 @@ function NavBar({
|
|
|
203
205
|
</Link>
|
|
204
206
|
</TooltipTrigger>
|
|
205
207
|
<TooltipContent side="right">
|
|
206
|
-
{isDefaultWl ?
|
|
208
|
+
{isDefaultWl ? translate('common.layout.navbar.greatPages') : translate('common.layout.navbar.pages')}
|
|
207
209
|
</TooltipContent>
|
|
208
210
|
</Tooltip>
|
|
209
211
|
<div
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useState } from "react";
|
|
4
|
+
import { useTranslations } from "next-intl";
|
|
4
5
|
import { IconBell } from '@tabler/icons-react';
|
|
5
6
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
6
7
|
import { Popover } from "../ui/overlay/Popover";
|
|
@@ -27,6 +28,7 @@ function NotificationsPopover({
|
|
|
27
28
|
contentClassName,
|
|
28
29
|
badgeClassName,
|
|
29
30
|
}: NotificationsPopoverProps) {
|
|
31
|
+
const translate = useTranslations();
|
|
30
32
|
const isDefaultWl = useIsDefaultWhitelabel();
|
|
31
33
|
const resolvedBadgeClassName = badgeClassName ?? (isDefaultWl ? "bg-cyan-300" : "bg-zinc-300");
|
|
32
34
|
const [open, setOpen] = useState(false);
|
|
@@ -71,7 +73,7 @@ function NotificationsPopover({
|
|
|
71
73
|
sideOffset={8}
|
|
72
74
|
>
|
|
73
75
|
<span className="paragraph-small-semibold text-gray-950 px-4">
|
|
74
|
-
|
|
76
|
+
{translate('common.notifications.popover.title')}
|
|
75
77
|
</span>
|
|
76
78
|
|
|
77
79
|
{messages.length > 0 ? (
|
|
@@ -95,7 +97,7 @@ function NotificationsPopover({
|
|
|
95
97
|
<IconBell size={20} color="var(--color-gray-950)" />
|
|
96
98
|
</div>
|
|
97
99
|
<span className="paragraph-small-medium text-gray-950">
|
|
98
|
-
|
|
100
|
+
{translate('common.notifications.popover.empty')}
|
|
99
101
|
</span>
|
|
100
102
|
</div>
|
|
101
103
|
)}
|
|
@@ -106,7 +108,7 @@ function NotificationsPopover({
|
|
|
106
108
|
className="h-8! mt-2 mb-4 mx-4 paragraph-small-semibold"
|
|
107
109
|
onClick={onViewAll}
|
|
108
110
|
>
|
|
109
|
-
|
|
111
|
+
{translate('common.notifications.popover.viewAll')}
|
|
110
112
|
</Button>
|
|
111
113
|
)}
|
|
112
114
|
</PopoverPrimitive.Content>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useState } from "react";
|
|
4
|
+
import { useTranslations } from "next-intl";
|
|
4
5
|
import { useRouter } from "next/navigation";
|
|
5
6
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
6
7
|
import { Popover } from "../ui/overlay/Popover";
|
|
@@ -36,6 +37,7 @@ function ProfilePopover({
|
|
|
36
37
|
contentClassName = "absolute bottom-2 left-[26px]",
|
|
37
38
|
menuItems = [],
|
|
38
39
|
}: ProfilePopoverProps) {
|
|
40
|
+
const translate = useTranslations();
|
|
39
41
|
const { user, logout } = useAuth();
|
|
40
42
|
const [isLoggingOut, setIsLoggingOut] = useState(false);
|
|
41
43
|
const [popoverOpen, setPopoverOpen] = useState(false);
|
|
@@ -68,7 +70,7 @@ function ProfilePopover({
|
|
|
68
70
|
<>
|
|
69
71
|
<LoadingOverlay
|
|
70
72
|
isLoading={isLoggingOut}
|
|
71
|
-
message=
|
|
73
|
+
message={translate('common.layout.profile.loggingOut')}
|
|
72
74
|
/>
|
|
73
75
|
<Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
|
|
74
76
|
<PopoverPrimitive.Trigger className="cursor-pointer">
|
|
@@ -124,7 +126,7 @@ function ProfilePopover({
|
|
|
124
126
|
}
|
|
125
127
|
}}
|
|
126
128
|
>
|
|
127
|
-
|
|
129
|
+
{translate('common.actions.edit')}
|
|
128
130
|
</Button>
|
|
129
131
|
</div>
|
|
130
132
|
|
|
@@ -146,7 +148,7 @@ function ProfilePopover({
|
|
|
146
148
|
>
|
|
147
149
|
<div className="flex items-center justify-between gap-2">
|
|
148
150
|
<span className="paragraph-xsmall-semibold text-white truncate">
|
|
149
|
-
|
|
151
|
+
{translate('common.layout.profile.usedCredits')}
|
|
150
152
|
</span>
|
|
151
153
|
<span className="paragraph-xsmall-medium text-white/50">
|
|
152
154
|
{summary.usedCredits.toLocaleString("pt-BR")}/
|
|
@@ -173,7 +175,7 @@ function ProfilePopover({
|
|
|
173
175
|
))}
|
|
174
176
|
</div>
|
|
175
177
|
<Separator />
|
|
176
|
-
<NavBarItem label=
|
|
178
|
+
<NavBarItem label={translate('common.layout.profile.logout')} onClick={handleLogout} />
|
|
177
179
|
</div>
|
|
178
180
|
</div>
|
|
179
181
|
</PopoverPrimitive.Content>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
+
import { useTranslations } from "next-intl";
|
|
4
5
|
import { IconPlus, IconUser, IconUsers } from '@tabler/icons-react';
|
|
5
6
|
import { UserAvatar } from "../ui/data-display/UserAvatar";
|
|
6
7
|
import { Popover, PopoverContent, PopoverTrigger } from "../ui/overlay/Popover";
|
|
@@ -46,6 +47,7 @@ export function UsersSelectorPopover({
|
|
|
46
47
|
align,
|
|
47
48
|
contentClassName,
|
|
48
49
|
}: UsersSelectorPopoverProps) {
|
|
50
|
+
const translate = useTranslations();
|
|
49
51
|
const { accountsUrl } = useWhitelabelUrls();
|
|
50
52
|
const [open, setOpen] = useState(false);
|
|
51
53
|
const [hoveredId, setHoveredId] = useState<number | null>(null);
|
|
@@ -108,7 +110,7 @@ export function UsersSelectorPopover({
|
|
|
108
110
|
>
|
|
109
111
|
<div className="flex flex-col p-3 gap-2">
|
|
110
112
|
<div className="flex items-center justify-between">
|
|
111
|
-
<span className="paragraph-small-semibold">
|
|
113
|
+
<span className="paragraph-small-semibold">{translate('common.layout.usersSelector.title')}</span>
|
|
112
114
|
<div className="flex items-center gap-1.5">
|
|
113
115
|
<Button
|
|
114
116
|
variant="secondary"
|
|
@@ -118,14 +120,14 @@ export function UsersSelectorPopover({
|
|
|
118
120
|
}}
|
|
119
121
|
>
|
|
120
122
|
<IconPlus size={16} />
|
|
121
|
-
|
|
123
|
+
{translate('common.layout.usersSelector.add')}
|
|
122
124
|
</Button>
|
|
123
125
|
</div>
|
|
124
126
|
</div>
|
|
125
127
|
|
|
126
128
|
<Command shouldFilter={false} className="gap-2" value="">
|
|
127
129
|
<CommandInput
|
|
128
|
-
placeholder=
|
|
130
|
+
placeholder={translate('common.layout.usersSelector.searchPlaceholder')}
|
|
129
131
|
value={searchInput}
|
|
130
132
|
onValueChange={setSearchInput}
|
|
131
133
|
/>
|
|
@@ -143,12 +145,12 @@ export function UsersSelectorPopover({
|
|
|
143
145
|
<div className="flex flex-col items-center justify-center gap-2 h-full text-gray-400 py-4">
|
|
144
146
|
<IconUsers size={28} className="text-gray-300" />
|
|
145
147
|
<span className="paragraph-small-medium text-center text-gray-500">
|
|
146
|
-
|
|
148
|
+
{translate('common.layout.usersSelector.empty')}
|
|
147
149
|
</span>
|
|
148
150
|
</div>
|
|
149
151
|
) : (
|
|
150
152
|
<>
|
|
151
|
-
<CommandEmpty>
|
|
153
|
+
<CommandEmpty>{translate('common.layout.usersSelector.noResults')}</CommandEmpty>
|
|
152
154
|
{allUsers.map((user) => {
|
|
153
155
|
const inProject = user.in_project ?? false;
|
|
154
156
|
const removable =
|
|
@@ -200,7 +202,7 @@ export function UsersSelectorPopover({
|
|
|
200
202
|
</div>
|
|
201
203
|
</TooltipTrigger>
|
|
202
204
|
<TooltipContent className="z-[1002]">
|
|
203
|
-
{inProject ?
|
|
205
|
+
{inProject ? translate('common.layout.usersSelector.removeFromProject') : translate('common.layout.usersSelector.addToProject')}
|
|
204
206
|
</TooltipContent>
|
|
205
207
|
</Tooltip>
|
|
206
208
|
</div>
|
|
@@ -225,7 +227,7 @@ export function UsersSelectorPopover({
|
|
|
225
227
|
window.location.href = `${accountsUrl}/my-teams`;
|
|
226
228
|
}}
|
|
227
229
|
>
|
|
228
|
-
|
|
230
|
+
{translate('common.layout.usersSelector.manageTeam')}
|
|
229
231
|
</Button>
|
|
230
232
|
</div>
|
|
231
233
|
</PopoverContent>
|
|
@@ -26,6 +26,7 @@ import { useUpdateSubscriptionPlan } from '../../modules/subscriptions/hooks/upd
|
|
|
26
26
|
import { getPriceFromCalculatedData } from '../../modules/subscriptions/utils/periodicity';
|
|
27
27
|
import { useIsDefaultWhitelabel, useExternalContracting } from '../../providers/whitelabel.provider';
|
|
28
28
|
import { IconInfoCircle, IconX, IconLoader2, IconSparkles } from '@tabler/icons-react';
|
|
29
|
+
import { useTranslations } from 'next-intl';
|
|
29
30
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
30
31
|
import { useForm } from 'react-hook-form';
|
|
31
32
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
@@ -42,6 +43,7 @@ const buyCreditSchema = z.object({
|
|
|
42
43
|
type BuyCreditFormData = z.infer<typeof buyCreditSchema>;
|
|
43
44
|
|
|
44
45
|
export default function BuyCreditsModal() {
|
|
46
|
+
const translate = useTranslations();
|
|
45
47
|
const { open, closeModal } = useBuyCreditsModal();
|
|
46
48
|
const { openModal } = useModalManager();
|
|
47
49
|
const isDefaultWl = useIsDefaultWhitelabel();
|
|
@@ -186,12 +188,12 @@ export default function BuyCreditsModal() {
|
|
|
186
188
|
label: (
|
|
187
189
|
<div className="flex items-center justify-between gap-2 w-full">
|
|
188
190
|
<span className="paragraph-small-medium text-zinc-950 flex-1">
|
|
189
|
-
{opt.credits.toLocaleString('pt-BR')}
|
|
191
|
+
{translate('common.credits.buy.creditsOptionLabel', { credits: opt.credits.toLocaleString('pt-BR') })}
|
|
190
192
|
</span>
|
|
191
193
|
<span className="paragraph-small-medium text-zinc-500 opacity-70">{opt.priceLabel}</span>
|
|
192
194
|
</div>
|
|
193
195
|
),
|
|
194
|
-
displayValue:
|
|
196
|
+
displayValue: translate('common.credits.buy.creditsOptionDisplayValue', { credits: opt.credits.toLocaleString('pt-BR') }),
|
|
195
197
|
}));
|
|
196
198
|
}, []);
|
|
197
199
|
|
|
@@ -217,7 +219,7 @@ export default function BuyCreditsModal() {
|
|
|
217
219
|
toast.custom((t) => (
|
|
218
220
|
<Toast
|
|
219
221
|
variant="success"
|
|
220
|
-
message={
|
|
222
|
+
message={translate('common.credits.buy.creditsChangedToast', { credits: data.creditOption.toLocaleString('pt-BR') })}
|
|
221
223
|
toastId={t}
|
|
222
224
|
/>
|
|
223
225
|
));
|
|
@@ -234,7 +236,7 @@ export default function BuyCreditsModal() {
|
|
|
234
236
|
if (totalPrice !== null) {
|
|
235
237
|
return (
|
|
236
238
|
<span className="paragraph-xlarge-semibold text-zinc-950">
|
|
237
|
-
{totalPrice === 0 ? '
|
|
239
|
+
{totalPrice === 0 ? translate('common.credits.buy.defaultPrice') : formatPrice(totalPrice)}
|
|
238
240
|
</span>
|
|
239
241
|
);
|
|
240
242
|
}
|
|
@@ -251,10 +253,10 @@ export default function BuyCreditsModal() {
|
|
|
251
253
|
</div>
|
|
252
254
|
<div className="flex flex-col gap-2">
|
|
253
255
|
<DialogTitle className="paragraph-medium-semibold text-zinc-950">
|
|
254
|
-
|
|
256
|
+
{translate('common.credits.buy.externalTitle')}
|
|
255
257
|
</DialogTitle>
|
|
256
258
|
<span className="paragraph-small-regular text-zinc-600">
|
|
257
|
-
|
|
259
|
+
{translate('common.credits.buy.externalDescription')}
|
|
258
260
|
</span>
|
|
259
261
|
</div>
|
|
260
262
|
</DialogHeader>
|
|
@@ -266,7 +268,7 @@ export default function BuyCreditsModal() {
|
|
|
266
268
|
redirectToExternal('contracting');
|
|
267
269
|
}}
|
|
268
270
|
>
|
|
269
|
-
|
|
271
|
+
{translate('common.credits.buy.externalButton')}
|
|
270
272
|
</Button>
|
|
271
273
|
</div>
|
|
272
274
|
</DialogContent>
|
|
@@ -282,7 +284,7 @@ export default function BuyCreditsModal() {
|
|
|
282
284
|
>
|
|
283
285
|
<DialogHeader className="px-4 py-3 border-b border-zinc-200 shrink-0 relative">
|
|
284
286
|
<DialogTitle className="paragraph-medium-semibold text-zinc-950 text-center">
|
|
285
|
-
|
|
287
|
+
{translate('common.credits.buy.title')}
|
|
286
288
|
</DialogTitle>
|
|
287
289
|
<button
|
|
288
290
|
type="button"
|
|
@@ -319,8 +321,8 @@ export default function BuyCreditsModal() {
|
|
|
319
321
|
<IconInfoCircle className="size-4 text-zinc-950 shrink-0" />
|
|
320
322
|
<span className="paragraph-small-regular text-zinc-950">
|
|
321
323
|
{isIncreasingCredits
|
|
322
|
-
? '
|
|
323
|
-
: '
|
|
324
|
+
? translate('common.credits.buy.paymentOnConfirm')
|
|
325
|
+
: translate('common.credits.buy.nextInvoiceChanges')}
|
|
324
326
|
</span>
|
|
325
327
|
</div>
|
|
326
328
|
)}
|
|
@@ -331,7 +333,7 @@ export default function BuyCreditsModal() {
|
|
|
331
333
|
<div className="hidden lg:flex flex-col gap-2">
|
|
332
334
|
{immediateChargeTotal !== null && immediateChargeTotal > 0 && (
|
|
333
335
|
<div className="flex items-center justify-between">
|
|
334
|
-
<span className="paragraph-xsmall-medium text-zinc-500">
|
|
336
|
+
<span className="paragraph-xsmall-medium text-zinc-500">{translate('common.credits.buy.immediateCharge')}</span>
|
|
335
337
|
{isCalculatePending ? (
|
|
336
338
|
<Skeleton className="h-5 w-20" />
|
|
337
339
|
) : (
|
|
@@ -342,7 +344,7 @@ export default function BuyCreditsModal() {
|
|
|
342
344
|
</div>
|
|
343
345
|
)}
|
|
344
346
|
<div className="flex items-center justify-between">
|
|
345
|
-
<span className="paragraph-small-medium text-zinc-500">
|
|
347
|
+
<span className="paragraph-small-medium text-zinc-500">{translate('common.credits.buy.totalPlanValue')}</span>
|
|
346
348
|
{renderPriceDisplay()}
|
|
347
349
|
</div>
|
|
348
350
|
</div>
|
|
@@ -353,7 +355,7 @@ export default function BuyCreditsModal() {
|
|
|
353
355
|
className="w-full hidden lg:inline-flex"
|
|
354
356
|
>
|
|
355
357
|
{isSubmitting && <IconLoader2 className="size-4 animate-spin" />}
|
|
356
|
-
|
|
358
|
+
{translate('common.credits.buy.confirmAndPay')}
|
|
357
359
|
</Button>
|
|
358
360
|
</div>
|
|
359
361
|
|
|
@@ -361,7 +363,7 @@ export default function BuyCreditsModal() {
|
|
|
361
363
|
<div className="flex flex-col gap-2">
|
|
362
364
|
{immediateChargeTotal !== null && immediateChargeTotal > 0 && (
|
|
363
365
|
<div className="flex items-center justify-between">
|
|
364
|
-
<span className="paragraph-xsmall-medium text-zinc-500">
|
|
366
|
+
<span className="paragraph-xsmall-medium text-zinc-500">{translate('common.credits.buy.immediateCharge')}</span>
|
|
365
367
|
{isCalculatePending ? (
|
|
366
368
|
<Skeleton className="h-5 w-20" />
|
|
367
369
|
) : (
|
|
@@ -372,13 +374,13 @@ export default function BuyCreditsModal() {
|
|
|
372
374
|
</div>
|
|
373
375
|
)}
|
|
374
376
|
<div className="flex items-center justify-between">
|
|
375
|
-
<span className="paragraph-small-medium text-zinc-500">
|
|
377
|
+
<span className="paragraph-small-medium text-zinc-500">{translate('common.credits.buy.totalPlanValue')}</span>
|
|
376
378
|
{renderPriceDisplay()}
|
|
377
379
|
</div>
|
|
378
380
|
</div>
|
|
379
381
|
<Button type="submit" disabled={isConfirmDisabled} className="w-full">
|
|
380
382
|
{isSubmitting && <IconLoader2 className="size-4 animate-spin" />}
|
|
381
|
-
|
|
383
|
+
{translate('common.credits.buy.confirmAndPay')}
|
|
382
384
|
</Button>
|
|
383
385
|
</div>
|
|
384
386
|
</form>
|
|
@@ -10,9 +10,11 @@ import {
|
|
|
10
10
|
import { Button } from '../ui/buttons/Button';
|
|
11
11
|
import { Separator } from '../ui/data-display/Separator';
|
|
12
12
|
import { IconAlertTriangle } from '@tabler/icons-react';
|
|
13
|
+
import { useTranslations } from 'next-intl';
|
|
13
14
|
import { useCreditsDisabledModal } from '../../store/useCreditsDisabledModal';
|
|
14
15
|
|
|
15
16
|
export default function CreditsDisabledModal() {
|
|
17
|
+
const translate = useTranslations();
|
|
16
18
|
const { open, closeModal } = useCreditsDisabledModal();
|
|
17
19
|
|
|
18
20
|
return (
|
|
@@ -32,14 +34,12 @@ export default function CreditsDisabledModal() {
|
|
|
32
34
|
</div>
|
|
33
35
|
<div className="flex flex-col gap-2">
|
|
34
36
|
<DialogTitle className="paragraph-medium-semibold text-zinc-950">
|
|
35
|
-
|
|
37
|
+
{translate('common.credits.disabled.title')}
|
|
36
38
|
</DialogTitle>
|
|
37
39
|
<DialogDescription className="paragraph-small-regular text-zinc-600" asChild>
|
|
38
40
|
<div className="flex flex-col gap-3">
|
|
39
|
-
<p>
|
|
40
|
-
<p>
|
|
41
|
-
Peça a um administrador ou proprietário da conta para adquirir mais créditos.
|
|
42
|
-
</p>
|
|
41
|
+
<p>{translate('common.credits.disabled.descriptionLine1')}</p>
|
|
42
|
+
<p>{translate('common.credits.disabled.descriptionLine2')}</p>
|
|
43
43
|
</div>
|
|
44
44
|
</DialogDescription>
|
|
45
45
|
</div>
|
|
@@ -53,7 +53,7 @@ export default function CreditsDisabledModal() {
|
|
|
53
53
|
className="h-10! transition-colors"
|
|
54
54
|
onClick={() => closeModal()}
|
|
55
55
|
>
|
|
56
|
-
|
|
56
|
+
{translate('common.credits.disabled.understood')}
|
|
57
57
|
</Button>
|
|
58
58
|
</div>
|
|
59
59
|
</DialogContent>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { IconLock } from '@tabler/icons-react';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
4
5
|
import { Button } from '../ui/buttons/Button';
|
|
5
6
|
import {
|
|
6
7
|
Dialog,
|
|
@@ -14,14 +15,15 @@ import { useModalManager } from '../../store/useModalManager';
|
|
|
14
15
|
import type { ModalData } from '../../store/useModalManager';
|
|
15
16
|
|
|
16
17
|
export default function PaidPlanRequiredModal() {
|
|
18
|
+
const translate = useTranslations();
|
|
17
19
|
const { activeModal, modalData, closeModal } = useModalManager();
|
|
18
20
|
const isOpen = activeModal === 'paidPlanRequiredModal';
|
|
19
21
|
const data = modalData as ModalData & { title?: string; description?: string };
|
|
20
22
|
const { accountsUrl } = useWhitelabelUrls();
|
|
21
23
|
const { redirectToExternal } = useExternalContracting();
|
|
22
24
|
|
|
23
|
-
const title = (data.title as string) ??
|
|
24
|
-
const description = (data.description as string) ??
|
|
25
|
+
const title = (data.title as string) ?? translate('common.credits.paidPlanRequired.defaultTitle');
|
|
26
|
+
const description = (data.description as string) ?? translate('common.credits.paidPlanRequired.defaultDescription');
|
|
25
27
|
|
|
26
28
|
const handleKnowPlans = () => {
|
|
27
29
|
if (redirectToExternal('plans')) return;
|
|
@@ -49,7 +51,7 @@ export default function PaidPlanRequiredModal() {
|
|
|
49
51
|
className="w-fit h-10!"
|
|
50
52
|
onClick={handleKnowPlans}
|
|
51
53
|
>
|
|
52
|
-
|
|
54
|
+
{translate('common.credits.paidPlanRequired.knowPlans')}
|
|
53
55
|
</Button>
|
|
54
56
|
</div>
|
|
55
57
|
</DialogContent>
|