@greatapps/common 1.1.376 → 1.1.378
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/ProfilePopover.mjs +4 -8
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/pages/NotFoundPage.mjs +9 -1
- package/dist/components/pages/NotFoundPage.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/layouts/ProfilePopover.tsx +4 -8
- package/src/components/pages/NotFoundPage.tsx +9 -1
|
@@ -29,13 +29,9 @@ function ProfilePopover({
|
|
|
29
29
|
const { accountsUrl } = useWhitelabelUrls();
|
|
30
30
|
const router = useRouter();
|
|
31
31
|
const handleLogout = async () => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
await logout();
|
|
36
|
-
} finally {
|
|
37
|
-
setIsLoggingOut(false);
|
|
38
|
-
}
|
|
32
|
+
setPopoverOpen(false);
|
|
33
|
+
setIsLoggingOut(true);
|
|
34
|
+
await logout();
|
|
39
35
|
};
|
|
40
36
|
const hasSubscription = !isSubscriptionLoading && subscription !== null;
|
|
41
37
|
const shouldShowCredits = hasSubscription && subscription.id_wl === 1;
|
|
@@ -92,7 +88,7 @@ function ProfilePopover({
|
|
|
92
88
|
const isSameOrigin = accountsUrl.startsWith(window.location.origin);
|
|
93
89
|
if (isSameOrigin) {
|
|
94
90
|
setPopoverOpen(false);
|
|
95
|
-
router.push(`${
|
|
91
|
+
router.push(`${window.location.pathname}?openProfile=true`);
|
|
96
92
|
} else {
|
|
97
93
|
window.location.href = `${accountsUrl}?openProfile=true`;
|
|
98
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/layouts/ProfilePopover.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { useRouter } from \"next/navigation\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { Popover } from \"../ui/overlay/Popover\";\nimport { Button } from \"../ui/buttons/Button\";\nimport { Progress } from \"../ui/feedback/Progress\";\nimport { Separator } from \"../ui/data-display/Separator\";\nimport { NavBarItem } from \"./NavBarItem\";\nimport { UserAvatar } from \"../ui/data-display/UserAvatar\";\nimport { LoadingOverlay } from \"../ui/feedback/LoadingOverlay\";\nimport { useAuth } from \"../../providers/auth.provider\";\nimport { useWhitelabelUrls } from \"../../providers/whitelabel.provider\";\nimport { cn } from \"../../infra/utils/clsx\";\nimport { useIaCredits } from \"../../modules/ia-credits/hooks/ia-credits.hook\";\nimport { useBuyCreditsModal } from \"../../store/useBuyCreditsModal\";\n\nexport interface ProfileMenuItem {\n icon?: React.ReactNode;\n label: string;\n onClick: () => void;\n}\n\nexport interface ProfilePopoverProps {\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\n align?: \"start\" | \"center\" | \"end\";\n contentClassName?: string;\n menuItems?: ProfileMenuItem[];\n}\n\nfunction ProfilePopover({\n side = \"top\",\n align = \"start\",\n contentClassName = \"absolute bottom-2 left-[26px]\",\n menuItems = [],\n}: ProfilePopoverProps) {\n const { user, logout } = useAuth();\n const [isLoggingOut, setIsLoggingOut] = useState(false);\n const [popoverOpen, setPopoverOpen] = useState(false);\n\n const { summary, subscription, isSubscriptionLoading, isCreditsLoading } =\n useIaCredits();\n const { openModal: openBuyCreditsModal } = useBuyCreditsModal();\n const { accountsUrl } = useWhitelabelUrls();\n const router = useRouter();\n\n const handleLogout = async () => {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/layouts/ProfilePopover.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { useRouter } from \"next/navigation\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { Popover } from \"../ui/overlay/Popover\";\nimport { Button } from \"../ui/buttons/Button\";\nimport { Progress } from \"../ui/feedback/Progress\";\nimport { Separator } from \"../ui/data-display/Separator\";\nimport { NavBarItem } from \"./NavBarItem\";\nimport { UserAvatar } from \"../ui/data-display/UserAvatar\";\nimport { LoadingOverlay } from \"../ui/feedback/LoadingOverlay\";\nimport { useAuth } from \"../../providers/auth.provider\";\nimport { useWhitelabelUrls } from \"../../providers/whitelabel.provider\";\nimport { cn } from \"../../infra/utils/clsx\";\nimport { useIaCredits } from \"../../modules/ia-credits/hooks/ia-credits.hook\";\nimport { useBuyCreditsModal } from \"../../store/useBuyCreditsModal\";\n\nexport interface ProfileMenuItem {\n icon?: React.ReactNode;\n label: string;\n onClick: () => void;\n}\n\nexport interface ProfilePopoverProps {\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\n align?: \"start\" | \"center\" | \"end\";\n contentClassName?: string;\n menuItems?: ProfileMenuItem[];\n}\n\nfunction ProfilePopover({\n side = \"top\",\n align = \"start\",\n contentClassName = \"absolute bottom-2 left-[26px]\",\n menuItems = [],\n}: ProfilePopoverProps) {\n const { user, logout } = useAuth();\n const [isLoggingOut, setIsLoggingOut] = useState(false);\n const [popoverOpen, setPopoverOpen] = useState(false);\n\n const { summary, subscription, isSubscriptionLoading, isCreditsLoading } =\n useIaCredits();\n const { openModal: openBuyCreditsModal } = useBuyCreditsModal();\n const { accountsUrl } = useWhitelabelUrls();\n const router = useRouter();\n\n const handleLogout = async () => {\n setPopoverOpen(false);\n setIsLoggingOut(true);\n await logout();\n };\n\n const hasSubscription = !isSubscriptionLoading && subscription !== null;\n\n const shouldShowCredits = hasSubscription && subscription.id_wl === 1;\n const creditsPercentage =\n shouldShowCredits && summary.totalCredits > 0\n ? (summary.usedCredits / summary.totalCredits) * 100\n : 0;\n\n return (\n <>\n <LoadingOverlay\n isLoading={isLoggingOut}\n message=\"Saindo da sua conta...\"\n />\n <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>\n <PopoverPrimitive.Trigger className=\"cursor-pointer\">\n {user && (\n <UserAvatar\n key={user.id}\n photo={user.photo}\n name={user.name}\n size={40}\n />\n )}\n </PopoverPrimitive.Trigger>\n\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n className={cn(\n \"w-64.75 p-0 bg-white rounded-2xl shadow-md border border-gray-200 z-99\",\n contentClassName,\n )}\n side={side}\n align={align}\n sideOffset={8}\n >\n <div className=\"grid grid-cols-[32px_1fr_auto] items-center gap-3 p-3 w-full\">\n {user && (\n <UserAvatar\n key={user.id}\n photo={user.photo}\n name={user.name}\n size={32}\n />\n )}\n\n <div className=\"flex flex-col gap-0.5 min-w-0\">\n <span className=\"paragraph-small-semibold text-gray-950 truncate\">\n {user?.name || \"\"}\n </span>\n <span className=\"paragraph-xsmall-medium text-gray-500 truncate\">\n {user?.email || \"\"}\n </span>\n </div>\n\n <Button\n variant=\"secondary\"\n className=\"h-8! px-3! paragraph-xsmall-semibold\"\n onClick={() => {\n const isSameOrigin = accountsUrl.startsWith(window.location.origin);\n if (isSameOrigin) {\n setPopoverOpen(false);\n router.push(`${window.location.pathname}?openProfile=true`);\n } else {\n window.location.href = `${accountsUrl}?openProfile=true`;\n }\n }}\n >\n Editar\n </Button>\n </div>\n\n <div className=\"flex flex-col gap-2 border-t border-gray-200 rounded-2xl p-1.5\">\n {shouldShowCredits && (\n <div\n className={cn(\n \"flex flex-col bg-gray-950 rounded-lg gap-4 w-full p-4 transition-colors\",\n \"cursor-pointer hover:bg-gray-950/90\",\n )}\n onClick={() => openBuyCreditsModal()}\n >\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"paragraph-xsmall-semibold text-white truncate\">\n Créditos usados\n </span>\n <span className=\"paragraph-xsmall-medium text-white/50\">\n {summary.usedCredits.toLocaleString(\"pt-BR\")}/\n {summary.totalCredits.toLocaleString(\"pt-BR\")}\n </span>\n </div>\n <Progress\n className=\"bg-white/10\"\n indicatorColor=\"bg-white\"\n value={creditsPercentage}\n />\n </div>\n )}\n\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex flex-col\">\n {menuItems.map((item, index) => (\n <NavBarItem\n key={index}\n icon={item.icon}\n label={item.label}\n onClick={item.onClick}\n />\n ))}\n </div>\n <Separator />\n <NavBarItem label=\"Sair\" onClick={handleLogout} />\n </div>\n </div>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </Popover>\n </>\n );\n}\n\nexport { ProfilePopover };\n"],"mappings":";AA8DI,mBACE,KAoCQ,YArCV;AA5DJ,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,YAAY,sBAAsB;AAClC,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,eAAe;AACxB,SAAS,yBAAyB;AAClC,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AAenC,SAAS,eAAe;AAAA,EACtB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,mBAAmB;AAAA,EACnB,YAAY,CAAC;AACf,GAAwB;AACtB,QAAM,EAAE,MAAM,OAAO,IAAI,QAAQ;AACjC,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AACtD,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AAEpD,QAAM,EAAE,SAAS,cAAc,uBAAuB,iBAAiB,IACrE,aAAa;AACf,QAAM,EAAE,WAAW,oBAAoB,IAAI,mBAAmB;AAC9D,QAAM,EAAE,YAAY,IAAI,kBAAkB;AAC1C,QAAM,SAAS,UAAU;AAEzB,QAAM,eAAe,YAAY;AAC/B,mBAAe,KAAK;AACpB,oBAAgB,IAAI;AACpB,UAAM,OAAO;AAAA,EACf;AAEA,QAAM,kBAAkB,CAAC,yBAAyB,iBAAiB;AAEnE,QAAM,oBAAoB,mBAAmB,aAAa,UAAU;AACpE,QAAM,oBACJ,qBAAqB,QAAQ,eAAe,IACvC,QAAQ,cAAc,QAAQ,eAAgB,MAC/C;AAEN,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,QACX,SAAQ;AAAA;AAAA,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AAS,MAAM,oBAAoB;AAAA,kBAEnC;AAAA,yCAAC,SAAI,WAAU,2CACb;AAAA,0CAAC,UAAK,WAAU,iDAAgD,gCAEhE;AAAA,sBACA,qBAAC,UAAK,WAAU,yCACb;AAAA,gCAAQ,YAAY,eAAe,OAAO;AAAA,wBAAE;AAAA,wBAC5C,QAAQ,aAAa,eAAe,OAAO;AAAA,yBAC9C;AAAA,uBACF;AAAA,oBACA;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV,gBAAe;AAAA,wBACf,OAAO;AAAA;AAAA,oBACT;AAAA;AAAA;AAAA,cACF;AAAA,cAGF,qBAAC,SAAI,WAAU,uBACb;AAAA,oCAAC,SAAI,WAAU,iBACZ,oBAAU,IAAI,CAAC,MAAM,UACpB;AAAA,kBAAC;AAAA;AAAA,oBAEC,MAAM,KAAK;AAAA,oBACX,OAAO,KAAK;AAAA,oBACZ,SAAS,KAAK;AAAA;AAAA,kBAHT;AAAA,gBAIP,CACD,GACH;AAAA,gBACA,oBAAC,aAAU;AAAA,gBACX,oBAAC,cAAW,OAAM,QAAO,SAAS,cAAc;AAAA,iBAClD;AAAA,eACF;AAAA;AAAA;AAAA,MACF,GACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Image from "next/image";
|
|
4
|
+
import { useRouter } from "next/navigation";
|
|
4
5
|
import { useWhitelabel } from "../../providers/whitelabel.provider";
|
|
5
6
|
import { Button } from "../ui/buttons/Button";
|
|
6
7
|
function GreatAppsLogo() {
|
|
@@ -11,6 +12,7 @@ function GreatAppsLogo() {
|
|
|
11
12
|
] });
|
|
12
13
|
}
|
|
13
14
|
function NotFoundPage() {
|
|
15
|
+
const router = useRouter();
|
|
14
16
|
const { whitelabel } = useWhitelabel();
|
|
15
17
|
const isGreatApps = !whitelabel || whitelabel.id === 1;
|
|
16
18
|
const whitelabelLogo = whitelabel?.logo ? `${process.env.NEXT_PUBLIC_STORAGE_URL}/${whitelabel.logo}` : null;
|
|
@@ -27,7 +29,13 @@ function NotFoundPage() {
|
|
|
27
29
|
{
|
|
28
30
|
variant: "secondary",
|
|
29
31
|
className: "h-10!",
|
|
30
|
-
onClick: () =>
|
|
32
|
+
onClick: () => {
|
|
33
|
+
if (window.history.length > 1) {
|
|
34
|
+
router.back();
|
|
35
|
+
} else {
|
|
36
|
+
router.push("/");
|
|
37
|
+
}
|
|
38
|
+
},
|
|
31
39
|
children: "Voltar para o in\xEDcio"
|
|
32
40
|
}
|
|
33
41
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/pages/NotFoundPage.tsx"],"sourcesContent":["'use client';\n\nimport Image from \"next/image\";\nimport { useWhitelabel } from \"../../providers/whitelabel.provider\";\nimport { Button } from \"../ui/buttons/Button\";\n\nfunction GreatAppsLogo() {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"50\" viewBox=\"0 0 68 68\" fill=\"none\">\n <rect x=\"4.5\" y=\"4.5\" width=\"58.4463\" height=\"58.4463\" rx=\"14.2271\" fill=\"#09090B\" />\n <rect x=\"4.5\" y=\"4.5\" width=\"58.4463\" height=\"58.4463\" rx=\"14.2271\" stroke=\"white\" strokeWidth=\"9\" />\n <path d=\"M38.0883 19.5377C38.6909 19.5377 39.1795 20.0264 39.1795 20.6289V25.5892C39.1795 25.9865 39.106 26.3827 38.9364 26.7421C38.4857 27.6992 37.5451 28.2674 36.5452 28.2674H29.9031C28.9993 28.2674 28.2663 29.0004 28.2663 29.9042V37.5427C28.2663 38.4465 28.9993 39.1795 29.9031 39.1795H37.5415C38.4453 39.1795 39.1783 38.4465 39.1783 37.5427V30.9693C39.1783 30.4522 39.3053 29.9374 39.5804 29.5009C40.0596 28.7406 40.8768 28.2899 41.7462 28.2686H46.8168C47.4193 28.2686 47.908 28.7561 47.908 29.3586V37.8238C47.908 38.692 47.5629 39.5246 46.9497 40.139L40.1379 46.9508C39.5235 47.5652 38.6909 47.9091 37.8226 47.9091H29.3587C28.7561 47.9091 28.2674 47.4205 28.2674 46.8179L28.2674 41.8126C28.2674 41.114 27.9899 40.4439 27.4965 39.9504C27.0031 39.457 26.3329 39.1795 25.6343 39.1795H20.629C20.0265 39.1795 19.5378 38.6908 19.5378 38.0883L19.5378 29.6231C19.5378 28.7549 19.8829 27.9222 20.4961 27.3078L27.468 20.3371C27.9792 19.8259 28.6731 19.5377 29.3966 19.5377H38.0871H38.0883Z\" fill=\"white\" />\n </svg>\n );\n}\n\nexport function NotFoundPage() {\n const { whitelabel } = useWhitelabel();\n const isGreatApps = !whitelabel || whitelabel.id === 1;\n const whitelabelLogo = whitelabel?.logo\n ? `${process.env.NEXT_PUBLIC_STORAGE_URL}/${whitelabel.logo}`\n : null;\n\n return (\n <div className=\"relative flex min-h-screen w-full flex-col items-center justify-center overflow-hidden bg-white\">\n <div className=\"flex flex-col items-center gap-[22px] text-center\">\n <div className=\"relative flex flex-col items-center\">\n <Image src=\"/images/404.svg\" alt=\"404\" width={440} height={173} priority unoptimized />\n\n <div className=\"-mt-1 w-full border-t border-zinc-100\" />\n\n <div className=\"-mt-[25px]\">\n {isGreatApps ? (\n <GreatAppsLogo />\n ) : whitelabelLogo ? (\n <Image src={whitelabelLogo} alt={whitelabel?.name || ''} width={50} height={50} className=\"rounded-xl object-contain\" />\n ) : null}\n </div>\n </div>\n\n <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]\">\n Página não foi encontrada!\n </h1>\n\n <p className=\"max-w-[496px] px-6 paragraph-medium-medium text-zinc-950 sm:px-0\">\n A página que você está procurando não existe. Verifique se digitou corretamente o link que está procurando.\n </p>\n\n <Button\n variant=\"secondary\"\n className=\"h-10!\"\n onClick={() => (window.
|
|
1
|
+
{"version":3,"sources":["../../../src/components/pages/NotFoundPage.tsx"],"sourcesContent":["'use client';\n\nimport Image from \"next/image\";\nimport { useRouter } from \"next/navigation\";\nimport { useWhitelabel } from \"../../providers/whitelabel.provider\";\nimport { Button } from \"../ui/buttons/Button\";\n\nfunction GreatAppsLogo() {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"50\" viewBox=\"0 0 68 68\" fill=\"none\">\n <rect x=\"4.5\" y=\"4.5\" width=\"58.4463\" height=\"58.4463\" rx=\"14.2271\" fill=\"#09090B\" />\n <rect x=\"4.5\" y=\"4.5\" width=\"58.4463\" height=\"58.4463\" rx=\"14.2271\" stroke=\"white\" strokeWidth=\"9\" />\n <path d=\"M38.0883 19.5377C38.6909 19.5377 39.1795 20.0264 39.1795 20.6289V25.5892C39.1795 25.9865 39.106 26.3827 38.9364 26.7421C38.4857 27.6992 37.5451 28.2674 36.5452 28.2674H29.9031C28.9993 28.2674 28.2663 29.0004 28.2663 29.9042V37.5427C28.2663 38.4465 28.9993 39.1795 29.9031 39.1795H37.5415C38.4453 39.1795 39.1783 38.4465 39.1783 37.5427V30.9693C39.1783 30.4522 39.3053 29.9374 39.5804 29.5009C40.0596 28.7406 40.8768 28.2899 41.7462 28.2686H46.8168C47.4193 28.2686 47.908 28.7561 47.908 29.3586V37.8238C47.908 38.692 47.5629 39.5246 46.9497 40.139L40.1379 46.9508C39.5235 47.5652 38.6909 47.9091 37.8226 47.9091H29.3587C28.7561 47.9091 28.2674 47.4205 28.2674 46.8179L28.2674 41.8126C28.2674 41.114 27.9899 40.4439 27.4965 39.9504C27.0031 39.457 26.3329 39.1795 25.6343 39.1795H20.629C20.0265 39.1795 19.5378 38.6908 19.5378 38.0883L19.5378 29.6231C19.5378 28.7549 19.8829 27.9222 20.4961 27.3078L27.468 20.3371C27.9792 19.8259 28.6731 19.5377 29.3966 19.5377H38.0871H38.0883Z\" fill=\"white\" />\n </svg>\n );\n}\n\nexport function NotFoundPage() {\n const router = useRouter();\n const { whitelabel } = useWhitelabel();\n const isGreatApps = !whitelabel || whitelabel.id === 1;\n const whitelabelLogo = whitelabel?.logo\n ? `${process.env.NEXT_PUBLIC_STORAGE_URL}/${whitelabel.logo}`\n : null;\n\n return (\n <div className=\"relative flex min-h-screen w-full flex-col items-center justify-center overflow-hidden bg-white\">\n <div className=\"flex flex-col items-center gap-[22px] text-center\">\n <div className=\"relative flex flex-col items-center\">\n <Image src=\"/images/404.svg\" alt=\"404\" width={440} height={173} priority unoptimized />\n\n <div className=\"-mt-1 w-full border-t border-zinc-100\" />\n\n <div className=\"-mt-[25px]\">\n {isGreatApps ? (\n <GreatAppsLogo />\n ) : whitelabelLogo ? (\n <Image src={whitelabelLogo} alt={whitelabel?.name || ''} width={50} height={50} className=\"rounded-xl object-contain\" />\n ) : null}\n </div>\n </div>\n\n <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]\">\n Página não foi encontrada!\n </h1>\n\n <p className=\"max-w-[496px] px-6 paragraph-medium-medium text-zinc-950 sm:px-0\">\n A página que você está procurando não existe. Verifique se digitou corretamente o link que está procurando.\n </p>\n\n <Button\n variant=\"secondary\"\n className=\"h-10!\"\n onClick={() => {\n if (window.history.length > 1) {\n router.back();\n } else {\n router.push('/');\n }\n }}\n >\n Voltar para o início\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";AASI,SACE,KADF;AAPJ,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,cAAc;AAEvB,SAAS,gBAAgB;AACvB,SACE,qBAAC,SAAI,OAAM,8BAA6B,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QACtF;AAAA,wBAAC,UAAK,GAAE,OAAM,GAAE,OAAM,OAAM,WAAU,QAAO,WAAU,IAAG,WAAU,MAAK,WAAU;AAAA,IACnF,oBAAC,UAAK,GAAE,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48
48
|
const handleLogout = async () => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
await logout();
|
|
53
|
-
} finally {
|
|
54
|
-
setIsLoggingOut(false);
|
|
55
|
-
}
|
|
49
|
+
setPopoverOpen(false);
|
|
50
|
+
setIsLoggingOut(true);
|
|
51
|
+
await logout();
|
|
56
52
|
};
|
|
57
53
|
|
|
58
54
|
const hasSubscription = !isSubscriptionLoading && subscription !== null;
|
|
@@ -117,7 +113,7 @@ function ProfilePopover({
|
|
|
117
113
|
const isSameOrigin = accountsUrl.startsWith(window.location.origin);
|
|
118
114
|
if (isSameOrigin) {
|
|
119
115
|
setPopoverOpen(false);
|
|
120
|
-
router.push(`${
|
|
116
|
+
router.push(`${window.location.pathname}?openProfile=true`);
|
|
121
117
|
} else {
|
|
122
118
|
window.location.href = `${accountsUrl}?openProfile=true`;
|
|
123
119
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import Image from "next/image";
|
|
4
|
+
import { useRouter } from "next/navigation";
|
|
4
5
|
import { useWhitelabel } from "../../providers/whitelabel.provider";
|
|
5
6
|
import { Button } from "../ui/buttons/Button";
|
|
6
7
|
|
|
@@ -15,6 +16,7 @@ function GreatAppsLogo() {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export function NotFoundPage() {
|
|
19
|
+
const router = useRouter();
|
|
18
20
|
const { whitelabel } = useWhitelabel();
|
|
19
21
|
const isGreatApps = !whitelabel || whitelabel.id === 1;
|
|
20
22
|
const whitelabelLogo = whitelabel?.logo
|
|
@@ -49,7 +51,13 @@ export function NotFoundPage() {
|
|
|
49
51
|
<Button
|
|
50
52
|
variant="secondary"
|
|
51
53
|
className="h-10!"
|
|
52
|
-
onClick={() =>
|
|
54
|
+
onClick={() => {
|
|
55
|
+
if (window.history.length > 1) {
|
|
56
|
+
router.back();
|
|
57
|
+
} else {
|
|
58
|
+
router.push('/');
|
|
59
|
+
}
|
|
60
|
+
}}
|
|
53
61
|
>
|
|
54
62
|
Voltar para o início
|
|
55
63
|
</Button>
|