@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.
Files changed (234) hide show
  1. package/dist/components/account/ConfigurationsMyAccountModal.mjs +6 -8
  2. package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
  3. package/dist/components/account/ConfirmDeleteAccountModal.mjs +19 -20
  4. package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
  5. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +11 -10
  6. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -1
  7. package/dist/components/account/DeleteAccountModal.mjs +28 -34
  8. package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
  9. package/dist/components/account/DisableTwoFactorAuthModal.mjs +5 -7
  10. package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -1
  11. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +9 -8
  12. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
  13. package/dist/components/account/TwoFactorAuthModal.mjs +23 -22
  14. package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
  15. package/dist/components/account/constants.mjs +4 -4
  16. package/dist/components/account/constants.mjs.map +1 -1
  17. package/dist/components/account/hooks/useChangeEmailForm.mjs +3 -5
  18. package/dist/components/account/hooks/useChangeEmailForm.mjs.map +1 -1
  19. package/dist/components/account/hooks/useChangePasswordForm.mjs +3 -26
  20. package/dist/components/account/hooks/useChangePasswordForm.mjs.map +1 -1
  21. package/dist/components/account/hooks/useChangePhoneForm.mjs +9 -18
  22. package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -1
  23. package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +3 -26
  24. package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +1 -1
  25. package/dist/components/account/hooks/useOtpVerification.mjs +3 -19
  26. package/dist/components/account/hooks/useOtpVerification.mjs.map +1 -1
  27. package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +4 -27
  28. package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -1
  29. package/dist/components/account/sections/ChangeEmailModal.mjs +28 -25
  30. package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -1
  31. package/dist/components/account/sections/ChangePasswordSection.mjs +6 -8
  32. package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
  33. package/dist/components/account/sections/ChangePhoneModal.mjs +27 -24
  34. package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -1
  35. package/dist/components/account/sections/MyProfileSection.mjs +22 -37
  36. package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
  37. package/dist/components/account/sections/PreferencesSection.mjs +24 -48
  38. package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
  39. package/dist/components/account/sections/SecuritySection.mjs +9 -11
  40. package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
  41. package/dist/components/account/sections/TokenSection.mjs +8 -24
  42. package/dist/components/account/sections/TokenSection.mjs.map +1 -1
  43. package/dist/components/layouts/AppMobileNavBar.mjs +148 -2
  44. package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
  45. package/dist/components/layouts/NavBar.mjs +3 -5
  46. package/dist/components/layouts/NavBar.mjs.map +1 -1
  47. package/dist/components/layouts/NotificationsPopover.mjs +3 -5
  48. package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
  49. package/dist/components/layouts/ProfilePopover.mjs +4 -6
  50. package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
  51. package/dist/components/layouts/UsersSelectorPopover.mjs +7 -9
  52. package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
  53. package/dist/components/modals/BuyCreditsModal.mjs +18 -17
  54. package/dist/components/modals/BuyCreditsModal.mjs.map +1 -1
  55. package/dist/components/modals/CreditsDisabledModal.mjs +4 -6
  56. package/dist/components/modals/CreditsDisabledModal.mjs.map +1 -1
  57. package/dist/components/modals/PaidPlanRequiredModal.mjs +3 -5
  58. package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
  59. package/dist/components/modals/cards/AddCardModal.mjs +24 -27
  60. package/dist/components/modals/cards/AddCardModal.mjs.map +1 -1
  61. package/dist/components/modals/cards/CannotDeleteCardModal.mjs +7 -9
  62. package/dist/components/modals/cards/CannotDeleteCardModal.mjs.map +1 -1
  63. package/dist/components/modals/cards/CardFormFields.mjs +22 -25
  64. package/dist/components/modals/cards/CardFormFields.mjs.map +1 -1
  65. package/dist/components/modals/cards/DeleteCardModal.mjs +8 -10
  66. package/dist/components/modals/cards/DeleteCardModal.mjs.map +1 -1
  67. package/dist/components/navigation/CancelledSubscriptionBanner.mjs +2 -4
  68. package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +1 -1
  69. package/dist/components/navigation/OverdueInvoiceBanner.mjs +2 -4
  70. package/dist/components/navigation/OverdueInvoiceBanner.mjs.map +1 -1
  71. package/dist/components/navigation/PendingCancellationBanner.mjs +6 -4
  72. package/dist/components/navigation/PendingCancellationBanner.mjs.map +1 -1
  73. package/dist/components/navigation/ProjectSelectorPopover.mjs +6 -8
  74. package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -1
  75. package/dist/components/navigation/UpcomingInvoiceBanner.mjs +6 -4
  76. package/dist/components/navigation/UpcomingInvoiceBanner.mjs.map +1 -1
  77. package/dist/components/navigation/subcomponents/BottomLinks.mjs +3 -5
  78. package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -1
  79. package/dist/components/navigation/subcomponents/CreditsCard.mjs +1 -3
  80. package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +1 -1
  81. package/dist/components/navigation/subcomponents/PlanCard.mjs +1 -3
  82. package/dist/components/navigation/subcomponents/PlanCard.mjs.map +1 -1
  83. package/dist/components/navigation/subcomponents/ProjectSelector.mjs +3 -5
  84. package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
  85. package/dist/components/pages/NotFoundPage.mjs +3 -5
  86. package/dist/components/pages/NotFoundPage.mjs.map +1 -1
  87. package/dist/components/pages/notifications/Notifications.mjs +10 -13
  88. package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
  89. package/dist/components/ui/buttons/CopyButton.mjs +5 -9
  90. package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
  91. package/dist/components/ui/data-display/CardItem.mjs +5 -7
  92. package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
  93. package/dist/components/ui/data-display/PaymentInfoCard.mjs +8 -10
  94. package/dist/components/ui/data-display/PaymentInfoCard.mjs.map +1 -1
  95. package/dist/components/ui/feedback/CircularProgress.mjs.map +1 -1
  96. package/dist/components/ui/feedback/DefaultCircularProgress.mjs +1 -3
  97. package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -1
  98. package/dist/components/ui/form/ComboboxField.mjs +6 -11
  99. package/dist/components/ui/form/ComboboxField.mjs.map +1 -1
  100. package/dist/components/ui/form/DatePicker.mjs +2 -5
  101. package/dist/components/ui/form/DatePicker.mjs.map +1 -1
  102. package/dist/components/ui/form/DateRangePicker.mjs +2 -5
  103. package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
  104. package/dist/components/ui/form/PhoneInput.mjs +3 -5
  105. package/dist/components/ui/form/PhoneInput.mjs.map +1 -1
  106. package/dist/components/ui/form/SelectField.mjs +3 -6
  107. package/dist/components/ui/form/SelectField.mjs.map +1 -1
  108. package/dist/components/widgets/ImageUpload/ImageCropModal.mjs +18 -11
  109. package/dist/components/widgets/ImageUpload/ImageCropModal.mjs.map +1 -1
  110. package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs +15 -6
  111. package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs.map +1 -1
  112. package/dist/index.mjs +2 -16
  113. package/dist/index.mjs.map +1 -1
  114. package/dist/modules/cards/hooks/handle-delete-card.hook.mjs +1 -2
  115. package/dist/modules/cards/hooks/handle-delete-card.hook.mjs.map +1 -1
  116. package/dist/modules/images/utils/validate-image.mjs +8 -8
  117. package/dist/modules/images/utils/validate-image.mjs.map +1 -1
  118. package/dist/modules/plans/types/plan.type.mjs +0 -3
  119. package/dist/modules/plans/types/plan.type.mjs.map +1 -1
  120. package/dist/modules/plans/utils/map-api-plan-to-ui.mjs +34 -56
  121. package/dist/modules/plans/utils/map-api-plan-to-ui.mjs.map +1 -1
  122. package/dist/modules/subscriptions/utils/periodicity.mjs +14 -20
  123. package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
  124. package/dist/providers/auth.provider.mjs +1 -9
  125. package/dist/providers/auth.provider.mjs.map +1 -1
  126. package/dist/server.mjs +0 -2
  127. package/dist/server.mjs.map +1 -1
  128. package/dist/utils/format/currency.mjs +4 -32
  129. package/dist/utils/format/currency.mjs.map +1 -1
  130. package/dist/utils/intl/locales.mjs +2 -3
  131. package/dist/utils/intl/locales.mjs.map +1 -1
  132. package/package.json +1 -7
  133. package/src/components/account/ConfigurationsMyAccountModal.tsx +6 -10
  134. package/src/components/account/ConfirmDeleteAccountModal.tsx +13 -22
  135. package/src/components/account/ConfirmGlobalPreferencesModal.tsx +10 -12
  136. package/src/components/account/DeleteAccountModal.tsx +24 -34
  137. package/src/components/account/DisableTwoFactorAuthModal.tsx +6 -11
  138. package/src/components/account/IsntPossibleDeleteAccountModal.tsx +6 -8
  139. package/src/components/account/TwoFactorAuthModal.tsx +29 -33
  140. package/src/components/account/constants.ts +5 -8
  141. package/src/components/account/hooks/useChangeEmailForm.tsx +3 -5
  142. package/src/components/account/hooks/useChangePasswordForm.tsx +6 -20
  143. package/src/components/account/hooks/useChangePhoneForm.tsx +10 -16
  144. package/src/components/account/hooks/useDisableTwoFactorAuthForm.tsx +6 -20
  145. package/src/components/account/hooks/useOtpVerification.tsx +4 -16
  146. package/src/components/account/hooks/useTwoFactorAuthForm.tsx +7 -21
  147. package/src/components/account/sections/ChangeEmailModal.tsx +21 -35
  148. package/src/components/account/sections/ChangePasswordSection.tsx +6 -10
  149. package/src/components/account/sections/ChangePhoneModal.tsx +22 -50
  150. package/src/components/account/sections/MyProfileSection.tsx +23 -37
  151. package/src/components/account/sections/PreferencesSection.tsx +25 -52
  152. package/src/components/account/sections/SecuritySection.tsx +10 -19
  153. package/src/components/account/sections/TokenSection.tsx +10 -22
  154. package/src/components/layouts/AppMobileNavBar.tsx +154 -1
  155. package/src/components/layouts/NavBar.tsx +3 -5
  156. package/src/components/layouts/NotificationsPopover.tsx +3 -5
  157. package/src/components/layouts/ProfilePopover.tsx +4 -6
  158. package/src/components/layouts/UsersSelectorPopover.tsx +7 -9
  159. package/src/components/modals/BuyCreditsModal.tsx +16 -18
  160. package/src/components/modals/CreditsDisabledModal.tsx +6 -6
  161. package/src/components/modals/PaidPlanRequiredModal.tsx +3 -5
  162. package/src/components/modals/cards/AddCardModal.tsx +27 -29
  163. package/src/components/modals/cards/CannotDeleteCardModal.tsx +8 -9
  164. package/src/components/modals/cards/CardFormFields.tsx +22 -25
  165. package/src/components/modals/cards/DeleteCardModal.tsx +8 -10
  166. package/src/components/navigation/CancelledSubscriptionBanner.tsx +2 -4
  167. package/src/components/navigation/OverdueInvoiceBanner.tsx +2 -4
  168. package/src/components/navigation/PendingCancellationBanner.tsx +2 -4
  169. package/src/components/navigation/ProjectSelectorPopover.tsx +6 -8
  170. package/src/components/navigation/UpcomingInvoiceBanner.tsx +2 -4
  171. package/src/components/navigation/subcomponents/BottomLinks.tsx +3 -5
  172. package/src/components/navigation/subcomponents/CreditsCard.tsx +1 -3
  173. package/src/components/navigation/subcomponents/PlanCard.tsx +1 -3
  174. package/src/components/navigation/subcomponents/ProjectSelector.tsx +3 -5
  175. package/src/components/pages/NotFoundPage.tsx +3 -5
  176. package/src/components/pages/notifications/Notifications.tsx +10 -13
  177. package/src/components/ui/buttons/CopyButton.tsx +5 -10
  178. package/src/components/ui/data-display/CardItem.tsx +5 -7
  179. package/src/components/ui/data-display/PaymentInfoCard.tsx +8 -10
  180. package/src/components/ui/feedback/CircularProgress.tsx +0 -4
  181. package/src/components/ui/feedback/DefaultCircularProgress.tsx +1 -3
  182. package/src/components/ui/form/ComboboxField.tsx +6 -11
  183. package/src/components/ui/form/DatePicker.tsx +2 -5
  184. package/src/components/ui/form/DateRangePicker.tsx +2 -5
  185. package/src/components/ui/form/PhoneInput.tsx +3 -5
  186. package/src/components/ui/form/SelectField.tsx +3 -6
  187. package/src/components/widgets/ImageUpload/ImageCropModal.tsx +11 -19
  188. package/src/components/widgets/ImageUpload/ImageTooSmallModal.tsx +5 -6
  189. package/src/index.ts +2 -12
  190. package/src/modules/cards/hooks/handle-delete-card.hook.ts +3 -8
  191. package/src/modules/images/utils/validate-image.ts +8 -23
  192. package/src/modules/plans/types/plan.type.ts +0 -3
  193. package/src/modules/plans/utils/map-api-plan-to-ui.ts +46 -103
  194. package/src/modules/subscriptions/utils/periodicity.ts +12 -29
  195. package/src/providers/auth.provider.tsx +1 -13
  196. package/src/server.ts +0 -2
  197. package/src/utils/format/currency.ts +7 -62
  198. package/src/utils/intl/locales.ts +2 -3
  199. package/dist/i18n/config.mjs +0 -13
  200. package/dist/i18n/config.mjs.map +0 -1
  201. package/dist/i18n/country-language.mjs +0 -74
  202. package/dist/i18n/country-language.mjs.map +0 -1
  203. package/dist/i18n/messages/en-us.mjs +0 -492
  204. package/dist/i18n/messages/en-us.mjs.map +0 -1
  205. package/dist/i18n/messages/es-es.mjs +0 -492
  206. package/dist/i18n/messages/es-es.mjs.map +0 -1
  207. package/dist/i18n/messages/index.mjs +0 -16
  208. package/dist/i18n/messages/index.mjs.map +0 -1
  209. package/dist/i18n/messages/pt-br.mjs +0 -505
  210. package/dist/i18n/messages/pt-br.mjs.map +0 -1
  211. package/dist/i18n/normalize.mjs +0 -12
  212. package/dist/i18n/normalize.mjs.map +0 -1
  213. package/dist/i18n/resolve-locale.mjs +0 -42
  214. package/dist/i18n/resolve-locale.mjs.map +0 -1
  215. package/dist/i18n.mjs +0 -14
  216. package/dist/i18n.mjs.map +0 -1
  217. package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs +0 -20
  218. package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs.map +0 -1
  219. package/dist/utils/intl/cookie-domain.mjs +0 -17
  220. package/dist/utils/intl/cookie-domain.mjs.map +0 -1
  221. package/dist/utils/intl/locale-cookie.mjs +0 -13
  222. package/dist/utils/intl/locale-cookie.mjs.map +0 -1
  223. package/src/i18n/config.ts +0 -17
  224. package/src/i18n/country-language.ts +0 -60
  225. package/src/i18n/messages/en-us.ts +0 -512
  226. package/src/i18n/messages/es-es.ts +0 -513
  227. package/src/i18n/messages/index.ts +0 -24
  228. package/src/i18n/messages/pt-br.ts +0 -536
  229. package/src/i18n/normalize.ts +0 -15
  230. package/src/i18n/resolve-locale.ts +0 -77
  231. package/src/i18n.ts +0 -10
  232. package/src/modules/accounts/hooks/use-currency-formatter.hook.tsx +0 -32
  233. package/src/utils/intl/cookie-domain.ts +0 -29
  234. package/src/utils/intl/locale-cookie.ts +0 -18
@@ -4,13 +4,20 @@ 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";
7
8
  import { useMobileNavbarSheet } from "../../store/useMobileNavbarSheet";
8
- import { useIsDefaultWhitelabel } from "../../providers/whitelabel.provider";
9
+ import {
10
+ useWhitelabel,
11
+ useIsDefaultWhitelabel,
12
+ } from "../../providers/whitelabel.provider";
13
+ import { cn } from "../../infra/utils/clsx";
9
14
  import type { ProfileMenuItem } from "./ProfilePopover";
10
15
 
11
16
  export interface AppMobileNavBarProps {
12
17
  /** Which app is currently active — controls which icon gets the indicator */
13
18
  activeApp?: "gapps" | "gpages";
19
+ /** Called when the GreatApps logo is clicked */
20
+ onLogoClick?: () => void;
14
21
  /** Called when the app icon (e.g. GreatPages) is clicked */
15
22
  onAppIconClick?: () => void;
16
23
  /** Extra slot rendered after the app icon (e.g. project selector) */
@@ -21,19 +28,165 @@ export interface AppMobileNavBarProps {
21
28
 
22
29
  export function AppMobileNavBar({
23
30
  activeApp,
31
+ onLogoClick,
24
32
  onAppIconClick,
25
33
  extraLeftSlot,
26
34
  menuItems = [],
27
35
  showMenuToggle = true,
28
36
  }: AppMobileNavBarProps) {
29
37
  const { isOpen, toggle } = useMobileNavbarSheet();
38
+ const { whitelabel } = useWhitelabel();
30
39
  const isDefaultWl = useIsDefaultWhitelabel();
40
+ const primaryColor = whitelabel?.general?.primary_color;
41
+ const wlName = whitelabel?.name || "Great";
31
42
 
43
+ const isGappsActive = activeApp === "gapps";
32
44
  const isGpagesActive = activeApp === "gpages";
33
45
 
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
+
34
81
  return (
35
82
  <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">
36
83
  <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
+
37
190
  {extraLeftSlot}
38
191
  </div>
39
192
  <div className="flex items-center gap-1.5">
@@ -3,7 +3,6 @@
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";
7
6
  import { IconChevronRight } from "@tabler/icons-react";
8
7
  import { Separator } from "../ui/data-display/Separator";
9
8
  import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/overlay/Tooltip";
@@ -36,7 +35,6 @@ function NavBar({
36
35
  children,
37
36
  className,
38
37
  }: NavBarProps) {
39
- const translate = useTranslations();
40
38
  const { isExpanded: isDesktopExpanded, toggle: toggleDesktop } =
41
39
  useDesktopSidebarStore();
42
40
  useDesktopSidebarHydration();
@@ -130,7 +128,7 @@ function NavBar({
130
128
  <IconChevronRight size={16} className="text-gray-500" />
131
129
  </button>
132
130
  </TooltipTrigger>
133
- <TooltipContent side="right">{translate('common.layout.navbar.expandMenu')}</TooltipContent>
131
+ <TooltipContent side="right">Expandir menu</TooltipContent>
134
132
  </Tooltip>
135
133
  )}
136
134
  {/* Desktop expand button */}
@@ -144,7 +142,7 @@ function NavBar({
144
142
  <IconChevronRight size={16} className="text-gray-500" />
145
143
  </button>
146
144
  </TooltipTrigger>
147
- <TooltipContent side="right">{translate('common.layout.navbar.expandMenu')}</TooltipContent>
145
+ <TooltipContent side="right">Expandir menu</TooltipContent>
148
146
  </Tooltip>
149
147
  )}
150
148
  </div>
@@ -205,7 +203,7 @@ function NavBar({
205
203
  </Link>
206
204
  </TooltipTrigger>
207
205
  <TooltipContent side="right">
208
- {isDefaultWl ? translate('common.layout.navbar.greatPages') : translate('common.layout.navbar.pages')}
206
+ {isDefaultWl ? "GreatPages" : "Páginas"}
209
207
  </TooltipContent>
210
208
  </Tooltip>
211
209
  <div
@@ -1,7 +1,6 @@
1
1
  "use client";
2
2
 
3
3
  import { useState } from "react";
4
- import { useTranslations } from "next-intl";
5
4
  import { IconBell } from '@tabler/icons-react';
6
5
  import * as PopoverPrimitive from "@radix-ui/react-popover";
7
6
  import { Popover } from "../ui/overlay/Popover";
@@ -28,7 +27,6 @@ function NotificationsPopover({
28
27
  contentClassName,
29
28
  badgeClassName,
30
29
  }: NotificationsPopoverProps) {
31
- const translate = useTranslations();
32
30
  const isDefaultWl = useIsDefaultWhitelabel();
33
31
  const resolvedBadgeClassName = badgeClassName ?? (isDefaultWl ? "bg-cyan-300" : "bg-zinc-300");
34
32
  const [open, setOpen] = useState(false);
@@ -73,7 +71,7 @@ function NotificationsPopover({
73
71
  sideOffset={8}
74
72
  >
75
73
  <span className="paragraph-small-semibold text-gray-950 px-4">
76
- {translate('common.notifications.popover.title')}
74
+ Últimas notificações
77
75
  </span>
78
76
 
79
77
  {messages.length > 0 ? (
@@ -97,7 +95,7 @@ function NotificationsPopover({
97
95
  <IconBell size={20} color="var(--color-gray-950)" />
98
96
  </div>
99
97
  <span className="paragraph-small-medium text-gray-950">
100
- {translate('common.notifications.popover.empty')}
98
+ Sem notificações por enquanto
101
99
  </span>
102
100
  </div>
103
101
  )}
@@ -108,7 +106,7 @@ function NotificationsPopover({
108
106
  className="h-8! mt-2 mb-4 mx-4 paragraph-small-semibold"
109
107
  onClick={onViewAll}
110
108
  >
111
- {translate('common.notifications.popover.viewAll')}
109
+ Todas as notificações
112
110
  </Button>
113
111
  )}
114
112
  </PopoverPrimitive.Content>
@@ -1,7 +1,6 @@
1
1
  "use client";
2
2
 
3
3
  import { useState } from "react";
4
- import { useTranslations } from "next-intl";
5
4
  import { useRouter } from "next/navigation";
6
5
  import * as PopoverPrimitive from "@radix-ui/react-popover";
7
6
  import { Popover } from "../ui/overlay/Popover";
@@ -37,7 +36,6 @@ function ProfilePopover({
37
36
  contentClassName = "absolute bottom-2 left-[26px]",
38
37
  menuItems = [],
39
38
  }: ProfilePopoverProps) {
40
- const translate = useTranslations();
41
39
  const { user, logout } = useAuth();
42
40
  const [isLoggingOut, setIsLoggingOut] = useState(false);
43
41
  const [popoverOpen, setPopoverOpen] = useState(false);
@@ -70,7 +68,7 @@ function ProfilePopover({
70
68
  <>
71
69
  <LoadingOverlay
72
70
  isLoading={isLoggingOut}
73
- message={translate('common.layout.profile.loggingOut')}
71
+ message="Saindo da sua conta..."
74
72
  />
75
73
  <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
76
74
  <PopoverPrimitive.Trigger className="cursor-pointer">
@@ -126,7 +124,7 @@ function ProfilePopover({
126
124
  }
127
125
  }}
128
126
  >
129
- {translate('common.actions.edit')}
127
+ Editar
130
128
  </Button>
131
129
  </div>
132
130
 
@@ -148,7 +146,7 @@ function ProfilePopover({
148
146
  >
149
147
  <div className="flex items-center justify-between gap-2">
150
148
  <span className="paragraph-xsmall-semibold text-white truncate">
151
- {translate('common.layout.profile.usedCredits')}
149
+ Créditos usados
152
150
  </span>
153
151
  <span className="paragraph-xsmall-medium text-white/50">
154
152
  {summary.usedCredits.toLocaleString("pt-BR")}/
@@ -175,7 +173,7 @@ function ProfilePopover({
175
173
  ))}
176
174
  </div>
177
175
  <Separator />
178
- <NavBarItem label={translate('common.layout.profile.logout')} onClick={handleLogout} />
176
+ <NavBarItem label="Sair" onClick={handleLogout} />
179
177
  </div>
180
178
  </div>
181
179
  </PopoverPrimitive.Content>
@@ -1,7 +1,6 @@
1
1
  "use client";
2
2
 
3
3
  import { useEffect, useState } from "react";
4
- import { useTranslations } from "next-intl";
5
4
  import { IconPlus, IconUser, IconUsers } from '@tabler/icons-react';
6
5
  import { UserAvatar } from "../ui/data-display/UserAvatar";
7
6
  import { Popover, PopoverContent, PopoverTrigger } from "../ui/overlay/Popover";
@@ -47,7 +46,6 @@ export function UsersSelectorPopover({
47
46
  align,
48
47
  contentClassName,
49
48
  }: UsersSelectorPopoverProps) {
50
- const translate = useTranslations();
51
49
  const { accountsUrl } = useWhitelabelUrls();
52
50
  const [open, setOpen] = useState(false);
53
51
  const [hoveredId, setHoveredId] = useState<number | null>(null);
@@ -110,7 +108,7 @@ export function UsersSelectorPopover({
110
108
  >
111
109
  <div className="flex flex-col p-3 gap-2">
112
110
  <div className="flex items-center justify-between">
113
- <span className="paragraph-small-semibold">{translate('common.layout.usersSelector.title')}</span>
111
+ <span className="paragraph-small-semibold">Usuários</span>
114
112
  <div className="flex items-center gap-1.5">
115
113
  <Button
116
114
  variant="secondary"
@@ -120,14 +118,14 @@ export function UsersSelectorPopover({
120
118
  }}
121
119
  >
122
120
  <IconPlus size={16} />
123
- {translate('common.layout.usersSelector.add')}
121
+ Adicionar
124
122
  </Button>
125
123
  </div>
126
124
  </div>
127
125
 
128
126
  <Command shouldFilter={false} className="gap-2" value="">
129
127
  <CommandInput
130
- placeholder={translate('common.layout.usersSelector.searchPlaceholder')}
128
+ placeholder="Busque aqui"
131
129
  value={searchInput}
132
130
  onValueChange={setSearchInput}
133
131
  />
@@ -145,12 +143,12 @@ export function UsersSelectorPopover({
145
143
  <div className="flex flex-col items-center justify-center gap-2 h-full text-gray-400 py-4">
146
144
  <IconUsers size={28} className="text-gray-300" />
147
145
  <span className="paragraph-small-medium text-center text-gray-500">
148
- {translate('common.layout.usersSelector.empty')}
146
+ Nenhum usuário encontrado.
149
147
  </span>
150
148
  </div>
151
149
  ) : (
152
150
  <>
153
- <CommandEmpty>{translate('common.layout.usersSelector.noResults')}</CommandEmpty>
151
+ <CommandEmpty>Nenhum resultado encontrado.</CommandEmpty>
154
152
  {allUsers.map((user) => {
155
153
  const inProject = user.in_project ?? false;
156
154
  const removable =
@@ -202,7 +200,7 @@ export function UsersSelectorPopover({
202
200
  </div>
203
201
  </TooltipTrigger>
204
202
  <TooltipContent className="z-[1002]">
205
- {inProject ? translate('common.layout.usersSelector.removeFromProject') : translate('common.layout.usersSelector.addToProject')}
203
+ {inProject ? "Remover do projeto" : "Adicionar ao projeto"}
206
204
  </TooltipContent>
207
205
  </Tooltip>
208
206
  </div>
@@ -227,7 +225,7 @@ export function UsersSelectorPopover({
227
225
  window.location.href = `${accountsUrl}/my-teams`;
228
226
  }}
229
227
  >
230
- {translate('common.layout.usersSelector.manageTeam')}
228
+ Gerenciar equipe
231
229
  </Button>
232
230
  </div>
233
231
  </PopoverContent>
@@ -26,7 +26,6 @@ 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';
30
29
  import { useCallback, useEffect, useMemo, useRef } from 'react';
31
30
  import { useForm } from 'react-hook-form';
32
31
  import { zodResolver } from '@hookform/resolvers/zod';
@@ -43,7 +42,6 @@ const buyCreditSchema = z.object({
43
42
  type BuyCreditFormData = z.infer<typeof buyCreditSchema>;
44
43
 
45
44
  export default function BuyCreditsModal() {
46
- const translate = useTranslations();
47
45
  const { open, closeModal } = useBuyCreditsModal();
48
46
  const { openModal } = useModalManager();
49
47
  const isDefaultWl = useIsDefaultWhitelabel();
@@ -188,12 +186,12 @@ export default function BuyCreditsModal() {
188
186
  label: (
189
187
  <div className="flex items-center justify-between gap-2 w-full">
190
188
  <span className="paragraph-small-medium text-zinc-950 flex-1">
191
- {translate('common.credits.buy.creditsOptionLabel', { credits: opt.credits.toLocaleString('pt-BR') })}
189
+ {opt.credits.toLocaleString('pt-BR')} créditos de IA
192
190
  </span>
193
191
  <span className="paragraph-small-medium text-zinc-500 opacity-70">{opt.priceLabel}</span>
194
192
  </div>
195
193
  ),
196
- displayValue: translate('common.credits.buy.creditsOptionDisplayValue', { credits: opt.credits.toLocaleString('pt-BR') }),
194
+ displayValue: `${opt.credits.toLocaleString('pt-BR')} créditos de IA`,
197
195
  }));
198
196
  }, []);
199
197
 
@@ -219,7 +217,7 @@ export default function BuyCreditsModal() {
219
217
  toast.custom((t) => (
220
218
  <Toast
221
219
  variant="success"
222
- message={translate('common.credits.buy.creditsChangedToast', { credits: data.creditOption.toLocaleString('pt-BR') })}
220
+ message={`Créditos de IA alterados para ${data.creditOption.toLocaleString('pt-BR')}`}
223
221
  toastId={t}
224
222
  />
225
223
  ));
@@ -236,7 +234,7 @@ export default function BuyCreditsModal() {
236
234
  if (totalPrice !== null) {
237
235
  return (
238
236
  <span className="paragraph-xlarge-semibold text-zinc-950">
239
- {totalPrice === 0 ? translate('common.credits.buy.defaultPrice') : formatPrice(totalPrice)}
237
+ {totalPrice === 0 ? 'Padrão' : formatPrice(totalPrice)}
240
238
  </span>
241
239
  );
242
240
  }
@@ -253,10 +251,10 @@ export default function BuyCreditsModal() {
253
251
  </div>
254
252
  <div className="flex flex-col gap-2">
255
253
  <DialogTitle className="paragraph-medium-semibold text-zinc-950">
256
- {translate('common.credits.buy.externalTitle')}
254
+ Créditos de IA
257
255
  </DialogTitle>
258
256
  <span className="paragraph-small-regular text-zinc-600">
259
- {translate('common.credits.buy.externalDescription')}
257
+ Para adquirir créditos de IA, acesse sua área de assinatura.
260
258
  </span>
261
259
  </div>
262
260
  </DialogHeader>
@@ -268,7 +266,7 @@ export default function BuyCreditsModal() {
268
266
  redirectToExternal('contracting');
269
267
  }}
270
268
  >
271
- {translate('common.credits.buy.externalButton')}
269
+ Acessar área de assinatura
272
270
  </Button>
273
271
  </div>
274
272
  </DialogContent>
@@ -284,7 +282,7 @@ export default function BuyCreditsModal() {
284
282
  >
285
283
  <DialogHeader className="px-4 py-3 border-b border-zinc-200 shrink-0 relative">
286
284
  <DialogTitle className="paragraph-medium-semibold text-zinc-950 text-center">
287
- {translate('common.credits.buy.title')}
285
+ Comprar créditos de IA
288
286
  </DialogTitle>
289
287
  <button
290
288
  type="button"
@@ -321,8 +319,8 @@ export default function BuyCreditsModal() {
321
319
  <IconInfoCircle className="size-4 text-zinc-950 shrink-0" />
322
320
  <span className="paragraph-small-regular text-zinc-950">
323
321
  {isIncreasingCredits
324
- ? translate('common.credits.buy.paymentOnConfirm')
325
- : translate('common.credits.buy.nextInvoiceChanges')}
322
+ ? 'O pagamento será processado no momento da confirmação.'
323
+ : 'As alterações entrarão em vigor a partir da sua próxima fatura.'}
326
324
  </span>
327
325
  </div>
328
326
  )}
@@ -333,7 +331,7 @@ export default function BuyCreditsModal() {
333
331
  <div className="hidden lg:flex flex-col gap-2">
334
332
  {immediateChargeTotal !== null && immediateChargeTotal > 0 && (
335
333
  <div className="flex items-center justify-between">
336
- <span className="paragraph-xsmall-medium text-zinc-500">{translate('common.credits.buy.immediateCharge')}</span>
334
+ <span className="paragraph-xsmall-medium text-zinc-500">Cobrança imediata</span>
337
335
  {isCalculatePending ? (
338
336
  <Skeleton className="h-5 w-20" />
339
337
  ) : (
@@ -344,7 +342,7 @@ export default function BuyCreditsModal() {
344
342
  </div>
345
343
  )}
346
344
  <div className="flex items-center justify-between">
347
- <span className="paragraph-small-medium text-zinc-500">{translate('common.credits.buy.totalPlanValue')}</span>
345
+ <span className="paragraph-small-medium text-zinc-500">Valor total do plano</span>
348
346
  {renderPriceDisplay()}
349
347
  </div>
350
348
  </div>
@@ -355,7 +353,7 @@ export default function BuyCreditsModal() {
355
353
  className="w-full hidden lg:inline-flex"
356
354
  >
357
355
  {isSubmitting && <IconLoader2 className="size-4 animate-spin" />}
358
- {translate('common.credits.buy.confirmAndPay')}
356
+ Confirmar e pagar
359
357
  </Button>
360
358
  </div>
361
359
 
@@ -363,7 +361,7 @@ export default function BuyCreditsModal() {
363
361
  <div className="flex flex-col gap-2">
364
362
  {immediateChargeTotal !== null && immediateChargeTotal > 0 && (
365
363
  <div className="flex items-center justify-between">
366
- <span className="paragraph-xsmall-medium text-zinc-500">{translate('common.credits.buy.immediateCharge')}</span>
364
+ <span className="paragraph-xsmall-medium text-zinc-500">Cobrança imediata</span>
367
365
  {isCalculatePending ? (
368
366
  <Skeleton className="h-5 w-20" />
369
367
  ) : (
@@ -374,13 +372,13 @@ export default function BuyCreditsModal() {
374
372
  </div>
375
373
  )}
376
374
  <div className="flex items-center justify-between">
377
- <span className="paragraph-small-medium text-zinc-500">{translate('common.credits.buy.totalPlanValue')}</span>
375
+ <span className="paragraph-small-medium text-zinc-500">Valor total do plano</span>
378
376
  {renderPriceDisplay()}
379
377
  </div>
380
378
  </div>
381
379
  <Button type="submit" disabled={isConfirmDisabled} className="w-full">
382
380
  {isSubmitting && <IconLoader2 className="size-4 animate-spin" />}
383
- {translate('common.credits.buy.confirmAndPay')}
381
+ Confirmar e pagar
384
382
  </Button>
385
383
  </div>
386
384
  </form>
@@ -10,11 +10,9 @@ 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';
14
13
  import { useCreditsDisabledModal } from '../../store/useCreditsDisabledModal';
15
14
 
16
15
  export default function CreditsDisabledModal() {
17
- const translate = useTranslations();
18
16
  const { open, closeModal } = useCreditsDisabledModal();
19
17
 
20
18
  return (
@@ -34,12 +32,14 @@ export default function CreditsDisabledModal() {
34
32
  </div>
35
33
  <div className="flex flex-col gap-2">
36
34
  <DialogTitle className="paragraph-medium-semibold text-zinc-950">
37
- {translate('common.credits.disabled.title')}
35
+ Compra de créditos indisponível
38
36
  </DialogTitle>
39
37
  <DialogDescription className="paragraph-small-regular text-zinc-600" asChild>
40
38
  <div className="flex flex-col gap-3">
41
- <p>{translate('common.credits.disabled.descriptionLine1')}</p>
42
- <p>{translate('common.credits.disabled.descriptionLine2')}</p>
39
+ <p>Apenas administradores e proprietários podem comprar créditos de IA.</p>
40
+ <p>
41
+ Peça a um administrador ou proprietário da conta para adquirir mais créditos.
42
+ </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
- {translate('common.credits.disabled.understood')}
56
+ Entendi
57
57
  </Button>
58
58
  </div>
59
59
  </DialogContent>
@@ -1,7 +1,6 @@
1
1
  "use client";
2
2
 
3
3
  import { IconLock } from '@tabler/icons-react';
4
- import { useTranslations } from 'next-intl';
5
4
  import { Button } from '../ui/buttons/Button';
6
5
  import {
7
6
  Dialog,
@@ -15,15 +14,14 @@ import { useModalManager } from '../../store/useModalManager';
15
14
  import type { ModalData } from '../../store/useModalManager';
16
15
 
17
16
  export default function PaidPlanRequiredModal() {
18
- const translate = useTranslations();
19
17
  const { activeModal, modalData, closeModal } = useModalManager();
20
18
  const isOpen = activeModal === 'paidPlanRequiredModal';
21
19
  const data = modalData as ModalData & { title?: string; description?: string };
22
20
  const { accountsUrl } = useWhitelabelUrls();
23
21
  const { redirectToExternal } = useExternalContracting();
24
22
 
25
- const title = (data.title as string) ?? translate('common.credits.paidPlanRequired.defaultTitle');
26
- const description = (data.description as string) ?? translate('common.credits.paidPlanRequired.defaultDescription');
23
+ const title = (data.title as string) ?? "Recurso disponível em planos pagos";
24
+ const description = (data.description as string) ?? "Para acessar este recurso, faça upgrade para um plano pago";
27
25
 
28
26
  const handleKnowPlans = () => {
29
27
  if (redirectToExternal('plans')) return;
@@ -51,7 +49,7 @@ export default function PaidPlanRequiredModal() {
51
49
  className="w-fit h-10!"
52
50
  onClick={handleKnowPlans}
53
51
  >
54
- {translate('common.credits.paidPlanRequired.knowPlans')}
52
+ Conhecer planos
55
53
  </Button>
56
54
  </div>
57
55
  </DialogContent>