@greatapps/common 1.1.218 → 1.1.221
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +6 -6
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +2 -2
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +2 -2
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs +3 -3
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +2 -2
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +2 -2
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/TwoFactorAuthModal.mjs +6 -6
- package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs +6 -6
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs +4 -4
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs +5 -5
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -1
- package/dist/components/account/sections/MyProfileSection.mjs +3 -3
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/account/sections/PreferencesSection.mjs +6 -6
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
- package/dist/components/account/sections/SecuritySection.mjs +3 -3
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
- package/dist/components/layouts/AppMobileNavBar.mjs +0 -1
- package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
- package/dist/components/layouts/MdSideBarNavigation.mjs +2 -2
- package/dist/components/layouts/MdSideBarNavigation.mjs.map +1 -1
- package/dist/components/layouts/NavBar.mjs +2 -2
- package/dist/components/layouts/NavBar.mjs.map +1 -1
- package/dist/components/layouts/NotificationsPopover.mjs +4 -4
- package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
- package/dist/components/layouts/ProfilePopover.mjs +7 -10
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +5 -5
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs +6 -6
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +5 -5
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
- package/dist/components/pages/notifications/Notifications.mjs +4 -4
- package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
- package/dist/components/ui/buttons/CopyButton.mjs +2 -2
- package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
- package/dist/components/ui/data-display/Accordion.mjs +2 -2
- package/dist/components/ui/data-display/Accordion.mjs.map +1 -1
- package/dist/components/ui/data-display/Pagination.mjs +7 -7
- package/dist/components/ui/data-display/Pagination.mjs.map +1 -1
- package/dist/components/ui/feedback/Toast.mjs +7 -7
- package/dist/components/ui/feedback/Toast.mjs.map +1 -1
- package/dist/components/ui/form/Calendar.mjs +7 -7
- package/dist/components/ui/form/Calendar.mjs.map +1 -1
- package/dist/components/ui/form/Checkbox.mjs +2 -2
- package/dist/components/ui/form/Checkbox.mjs.map +1 -1
- package/dist/components/ui/form/ComboboxField.mjs +4 -4
- package/dist/components/ui/form/ComboboxField.mjs.map +1 -1
- package/dist/components/ui/form/DateRangePicker.mjs +2 -2
- package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
- package/dist/components/ui/form/FormField.mjs +3 -3
- package/dist/components/ui/form/FormField.mjs.map +1 -1
- package/dist/components/ui/form/InputOtp.mjs +2 -2
- package/dist/components/ui/form/InputOtp.mjs.map +1 -1
- package/dist/components/ui/form/RadioGroup.mjs +2 -2
- package/dist/components/ui/form/RadioGroup.mjs.map +1 -1
- package/dist/components/ui/form/Select.mjs +5 -5
- package/dist/components/ui/form/Select.mjs.map +1 -1
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +1 -1
- package/dist/components/ui/overlay/Command.mjs +2 -2
- package/dist/components/ui/overlay/Command.mjs.map +1 -1
- package/dist/components/ui/overlay/Dialog.mjs +2 -2
- package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
- package/dist/components/ui/overlay/Sheet.mjs +2 -2
- package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
- package/dist/components/widgets/notifications/NotificationCard.mjs +2 -2
- package/dist/components/widgets/notifications/NotificationCard.mjs.map +1 -1
- package/package.json +1 -2
- package/src/components/account/ConfigurationsMyAccountModal.tsx +150 -150
- package/src/components/account/ConfirmDeleteAccountModal.tsx +2 -2
- package/src/components/account/ConfirmGlobalPreferencesModal.tsx +66 -66
- package/src/components/account/DeleteAccountModal.tsx +3 -3
- package/src/components/account/DisableTwoFactorAuthModal.tsx +86 -86
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +2 -2
- package/src/components/account/TwoFactorAuthModal.tsx +223 -223
- package/src/components/account/sections/ChangeEmailModal.tsx +225 -225
- package/src/components/account/sections/ChangePasswordSection.tsx +64 -64
- package/src/components/account/sections/ChangePhoneModal.tsx +5 -5
- package/src/components/account/sections/MyProfileSection.tsx +327 -327
- package/src/components/account/sections/PreferencesSection.tsx +273 -273
- package/src/components/account/sections/SecuritySection.tsx +160 -160
- package/src/components/layouts/AppMobileNavBar.tsx +0 -1
- package/src/components/layouts/MdSideBarNavigation.tsx +54 -54
- package/src/components/layouts/NavBar.tsx +2 -2
- package/src/components/layouts/NotificationsPopover.tsx +115 -115
- package/src/components/layouts/ProfilePopover.tsx +179 -184
- package/src/components/layouts/UsersSelectorPopover.tsx +5 -5
- package/src/components/navigation/ProjectSelectorPopover.tsx +151 -151
- package/src/components/navigation/subcomponents/ProjectSelector.tsx +149 -149
- package/src/components/pages/notifications/Notifications.tsx +4 -4
- package/src/components/ui/buttons/CopyButton.tsx +2 -2
- package/src/components/ui/data-display/Accordion.tsx +2 -2
- package/src/components/ui/data-display/Pagination.tsx +7 -7
- package/src/components/ui/feedback/Toast.tsx +7 -7
- package/src/components/ui/form/Calendar.tsx +7 -7
- package/src/components/ui/form/Checkbox.tsx +2 -2
- package/src/components/ui/form/ComboboxField.tsx +154 -154
- package/src/components/ui/form/DateRangePicker.tsx +2 -2
- package/src/components/ui/form/FormField.tsx +131 -130
- package/src/components/ui/form/InputOtp.tsx +2 -2
- package/src/components/ui/form/RadioGroup.tsx +2 -2
- package/src/components/ui/form/Select.tsx +5 -5
- package/src/components/ui/form/SwitchOptionFieldWithIcon.tsx +2 -2
- package/src/components/ui/overlay/Command.tsx +2 -2
- package/src/components/ui/overlay/Dialog.tsx +2 -2
- package/src/components/ui/overlay/Sheet.tsx +2 -2
- package/src/components/widgets/notifications/NotificationCard.tsx +68 -68
|
@@ -1,160 +1,160 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useState, useCallback } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { Badge } from '../../ui/data-display/Badge';
|
|
6
|
-
import { Button } from '../../ui/buttons/Button';
|
|
7
|
-
import { useAuth } from '../../../providers/auth.provider';
|
|
8
|
-
import { useQueryClient } from '@tanstack/react-query';
|
|
9
|
-
import { USER_QUERY_KEY } from '../../../modules/auth/hooks/useUserQuery';
|
|
10
|
-
import { AccountSectionType } from '../../../enums/AccountSectionType';
|
|
11
|
-
import TwoFactorAuthModal from '../TwoFactorAuthModal';
|
|
12
|
-
import DisableTwoFactorAuthModal from '../DisableTwoFactorAuthModal';
|
|
13
|
-
|
|
14
|
-
interface SecuritySectionProps {
|
|
15
|
-
setActiveSection: (section: AccountSectionType) => void;
|
|
16
|
-
onClose: () => void;
|
|
17
|
-
hasActiveSubscription?: boolean;
|
|
18
|
-
onDeleteAccount?: () => void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function SecuritySection({
|
|
22
|
-
setActiveSection,
|
|
23
|
-
onClose,
|
|
24
|
-
hasActiveSubscription,
|
|
25
|
-
onDeleteAccount,
|
|
26
|
-
}: SecuritySectionProps) {
|
|
27
|
-
const { user } = useAuth();
|
|
28
|
-
const queryClient = useQueryClient();
|
|
29
|
-
|
|
30
|
-
const twoFactorAuth = user?.two_factor_authentication ?? false;
|
|
31
|
-
const [twoFactorOpen, setTwoFactorOpen] = useState(false);
|
|
32
|
-
const [disableTwoFactorOpen, setDisableTwoFactorOpen] = useState(false);
|
|
33
|
-
|
|
34
|
-
const handleToggleTwoFactor = useCallback(() => {
|
|
35
|
-
if (twoFactorAuth) {
|
|
36
|
-
setDisableTwoFactorOpen(true);
|
|
37
|
-
} else {
|
|
38
|
-
setTwoFactorOpen(true);
|
|
39
|
-
}
|
|
40
|
-
}, [twoFactorAuth]);
|
|
41
|
-
|
|
42
|
-
const handleDisableTwoFactorSuccess = useCallback(() => {
|
|
43
|
-
queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });
|
|
44
|
-
setDisableTwoFactorOpen(false);
|
|
45
|
-
}, [queryClient]);
|
|
46
|
-
|
|
47
|
-
const handleEnableTwoFactorSuccess = useCallback(() => {
|
|
48
|
-
queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });
|
|
49
|
-
setTwoFactorOpen(false);
|
|
50
|
-
}, [queryClient]);
|
|
51
|
-
|
|
52
|
-
const handleDeleteAccount = useCallback(() => {
|
|
53
|
-
onDeleteAccount?.();
|
|
54
|
-
}, [onDeleteAccount]);
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<>
|
|
58
|
-
<div className="h-full overflow-y-auto overscroll-contain px-4 pb-20 lg:p-5 lg:pt-5 flex flex-col gap-5 lg:gap-6 lg:pb-31 lg:overscroll-auto">
|
|
59
|
-
<span className="paragraph-medium-semibold text-gray-950 hidden lg:block">Segurança</span>
|
|
60
|
-
|
|
61
|
-
<div className="border border-gray-200 rounded-lg overflow-hidden">
|
|
62
|
-
<div
|
|
63
|
-
className="flex flex-col lg:flex-row lg:items-center gap-4 lg:gap-5 p-4 lg:p-5 border-b border-gray-200 cursor-pointer hover:bg-gray-25 transition-colors"
|
|
64
|
-
onClick={handleToggleTwoFactor}
|
|
65
|
-
>
|
|
66
|
-
<div className="flex flex-1 items-start lg:items-center gap-4 lg:gap-5">
|
|
67
|
-
<div className="size-10 rounded-lg bg-gray-50 flex items-center justify-center shrink-0">
|
|
68
|
-
<
|
|
69
|
-
</div>
|
|
70
|
-
<div className="flex flex-col gap-1.5 flex-1">
|
|
71
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
72
|
-
<span className="paragraph-small-semibold text-gray-950">
|
|
73
|
-
Autenticação de dois fatores
|
|
74
|
-
</span>
|
|
75
|
-
<Badge
|
|
76
|
-
className={`paragraph-xsmall-semibold rounded-lg ${twoFactorAuth ? 'text-green-600 bg-green-50' : 'text-gray-600 bg-gray-50'}`}
|
|
77
|
-
>
|
|
78
|
-
{twoFactorAuth ? 'Habilitado' : 'Desabilitado'}
|
|
79
|
-
</Badge>
|
|
80
|
-
</div>
|
|
81
|
-
<span className="paragraph-small-regular text-gray-600">
|
|
82
|
-
Envio de código de segurança (e-mail ou sms) para o usuário acessar o sistema
|
|
83
|
-
</span>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
<Button
|
|
87
|
-
variant="secondary"
|
|
88
|
-
className="h-10! shrink-0 w-full lg:w-auto"
|
|
89
|
-
onClick={(e) => {
|
|
90
|
-
e.stopPropagation();
|
|
91
|
-
handleToggleTwoFactor();
|
|
92
|
-
}}
|
|
93
|
-
>
|
|
94
|
-
{twoFactorAuth ? 'Desabilitar' : 'Habilitar'}
|
|
95
|
-
</Button>
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
<div
|
|
99
|
-
className="flex flex-col lg:flex-row lg:items-center gap-4 lg:gap-5 p-4 lg:p-5 cursor-pointer hover:bg-gray-25 transition-colors"
|
|
100
|
-
onClick={() => setActiveSection(AccountSectionType.CHANGE_PASSWORD)}
|
|
101
|
-
>
|
|
102
|
-
<div className="flex flex-1 items-start lg:items-center gap-4 lg:gap-5">
|
|
103
|
-
<div className="size-10 rounded-lg bg-gray-50 flex items-center justify-center shrink-0">
|
|
104
|
-
<
|
|
105
|
-
</div>
|
|
106
|
-
<div className="flex flex-col gap-1.5 flex-1">
|
|
107
|
-
<span className="paragraph-small-semibold text-gray-950">
|
|
108
|
-
Alterar senha de acesso
|
|
109
|
-
</span>
|
|
110
|
-
<span className="paragraph-small-regular text-gray-600">
|
|
111
|
-
Atualize sua senha sempre que necessário para manter sua conta segura.
|
|
112
|
-
</span>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
<Button
|
|
116
|
-
variant="secondary"
|
|
117
|
-
className="h-10! shrink-0 w-full lg:w-auto"
|
|
118
|
-
onClick={(e) => {
|
|
119
|
-
e.stopPropagation();
|
|
120
|
-
setActiveSection(AccountSectionType.CHANGE_PASSWORD);
|
|
121
|
-
}}
|
|
122
|
-
>
|
|
123
|
-
Alterar senha
|
|
124
|
-
</Button>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
|
|
128
|
-
{onDeleteAccount && (
|
|
129
|
-
<button
|
|
130
|
-
type="button"
|
|
131
|
-
className="paragraph-small-semibold text-red-600 bg-red-50 rounded-lg px-3 py-2 cursor-pointer hover:bg-red-100 transition-colors w-fit"
|
|
132
|
-
onClick={handleDeleteAccount}
|
|
133
|
-
>
|
|
134
|
-
Excluir minha conta
|
|
135
|
-
</button>
|
|
136
|
-
)}
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
<div className="fixed bottom-0 left-0 right-0 lg:absolute flex items-center h-20 px-4 lg:px-5 border-t border-gray-200 justify-between bg-white z-10">
|
|
140
|
-
<Button variant="secondary" className="h-10!" type="button" onClick={onClose}>
|
|
141
|
-
Cancelar
|
|
142
|
-
</Button>
|
|
143
|
-
<Button className="h-10!" onClick={onClose}>
|
|
144
|
-
Salvar alterações
|
|
145
|
-
</Button>
|
|
146
|
-
</div>
|
|
147
|
-
|
|
148
|
-
<DisableTwoFactorAuthModal
|
|
149
|
-
open={disableTwoFactorOpen}
|
|
150
|
-
onClose={() => setDisableTwoFactorOpen(false)}
|
|
151
|
-
onSuccess={handleDisableTwoFactorSuccess}
|
|
152
|
-
/>
|
|
153
|
-
<TwoFactorAuthModal
|
|
154
|
-
open={twoFactorOpen}
|
|
155
|
-
onClose={() => setTwoFactorOpen(false)}
|
|
156
|
-
onSuccess={handleEnableTwoFactorSuccess}
|
|
157
|
-
/>
|
|
158
|
-
</>
|
|
159
|
-
);
|
|
160
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState, useCallback } from 'react';
|
|
4
|
+
import { IconLock, IconTool } from '@tabler/icons-react';
|
|
5
|
+
import { Badge } from '../../ui/data-display/Badge';
|
|
6
|
+
import { Button } from '../../ui/buttons/Button';
|
|
7
|
+
import { useAuth } from '../../../providers/auth.provider';
|
|
8
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
9
|
+
import { USER_QUERY_KEY } from '../../../modules/auth/hooks/useUserQuery';
|
|
10
|
+
import { AccountSectionType } from '../../../enums/AccountSectionType';
|
|
11
|
+
import TwoFactorAuthModal from '../TwoFactorAuthModal';
|
|
12
|
+
import DisableTwoFactorAuthModal from '../DisableTwoFactorAuthModal';
|
|
13
|
+
|
|
14
|
+
interface SecuritySectionProps {
|
|
15
|
+
setActiveSection: (section: AccountSectionType) => void;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
hasActiveSubscription?: boolean;
|
|
18
|
+
onDeleteAccount?: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function SecuritySection({
|
|
22
|
+
setActiveSection,
|
|
23
|
+
onClose,
|
|
24
|
+
hasActiveSubscription,
|
|
25
|
+
onDeleteAccount,
|
|
26
|
+
}: SecuritySectionProps) {
|
|
27
|
+
const { user } = useAuth();
|
|
28
|
+
const queryClient = useQueryClient();
|
|
29
|
+
|
|
30
|
+
const twoFactorAuth = user?.two_factor_authentication ?? false;
|
|
31
|
+
const [twoFactorOpen, setTwoFactorOpen] = useState(false);
|
|
32
|
+
const [disableTwoFactorOpen, setDisableTwoFactorOpen] = useState(false);
|
|
33
|
+
|
|
34
|
+
const handleToggleTwoFactor = useCallback(() => {
|
|
35
|
+
if (twoFactorAuth) {
|
|
36
|
+
setDisableTwoFactorOpen(true);
|
|
37
|
+
} else {
|
|
38
|
+
setTwoFactorOpen(true);
|
|
39
|
+
}
|
|
40
|
+
}, [twoFactorAuth]);
|
|
41
|
+
|
|
42
|
+
const handleDisableTwoFactorSuccess = useCallback(() => {
|
|
43
|
+
queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });
|
|
44
|
+
setDisableTwoFactorOpen(false);
|
|
45
|
+
}, [queryClient]);
|
|
46
|
+
|
|
47
|
+
const handleEnableTwoFactorSuccess = useCallback(() => {
|
|
48
|
+
queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });
|
|
49
|
+
setTwoFactorOpen(false);
|
|
50
|
+
}, [queryClient]);
|
|
51
|
+
|
|
52
|
+
const handleDeleteAccount = useCallback(() => {
|
|
53
|
+
onDeleteAccount?.();
|
|
54
|
+
}, [onDeleteAccount]);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<div className="h-full overflow-y-auto overscroll-contain px-4 pb-20 lg:p-5 lg:pt-5 flex flex-col gap-5 lg:gap-6 lg:pb-31 lg:overscroll-auto">
|
|
59
|
+
<span className="paragraph-medium-semibold text-gray-950 hidden lg:block">Segurança</span>
|
|
60
|
+
|
|
61
|
+
<div className="border border-gray-200 rounded-lg overflow-hidden">
|
|
62
|
+
<div
|
|
63
|
+
className="flex flex-col lg:flex-row lg:items-center gap-4 lg:gap-5 p-4 lg:p-5 border-b border-gray-200 cursor-pointer hover:bg-gray-25 transition-colors"
|
|
64
|
+
onClick={handleToggleTwoFactor}
|
|
65
|
+
>
|
|
66
|
+
<div className="flex flex-1 items-start lg:items-center gap-4 lg:gap-5">
|
|
67
|
+
<div className="size-10 rounded-lg bg-gray-50 flex items-center justify-center shrink-0">
|
|
68
|
+
<IconTool size={20} className="text-gray-950" />
|
|
69
|
+
</div>
|
|
70
|
+
<div className="flex flex-col gap-1.5 flex-1">
|
|
71
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
72
|
+
<span className="paragraph-small-semibold text-gray-950">
|
|
73
|
+
Autenticação de dois fatores
|
|
74
|
+
</span>
|
|
75
|
+
<Badge
|
|
76
|
+
className={`paragraph-xsmall-semibold rounded-lg ${twoFactorAuth ? 'text-green-600 bg-green-50' : 'text-gray-600 bg-gray-50'}`}
|
|
77
|
+
>
|
|
78
|
+
{twoFactorAuth ? 'Habilitado' : 'Desabilitado'}
|
|
79
|
+
</Badge>
|
|
80
|
+
</div>
|
|
81
|
+
<span className="paragraph-small-regular text-gray-600">
|
|
82
|
+
Envio de código de segurança (e-mail ou sms) para o usuário acessar o sistema
|
|
83
|
+
</span>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<Button
|
|
87
|
+
variant="secondary"
|
|
88
|
+
className="h-10! shrink-0 w-full lg:w-auto"
|
|
89
|
+
onClick={(e) => {
|
|
90
|
+
e.stopPropagation();
|
|
91
|
+
handleToggleTwoFactor();
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{twoFactorAuth ? 'Desabilitar' : 'Habilitar'}
|
|
95
|
+
</Button>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<div
|
|
99
|
+
className="flex flex-col lg:flex-row lg:items-center gap-4 lg:gap-5 p-4 lg:p-5 cursor-pointer hover:bg-gray-25 transition-colors"
|
|
100
|
+
onClick={() => setActiveSection(AccountSectionType.CHANGE_PASSWORD)}
|
|
101
|
+
>
|
|
102
|
+
<div className="flex flex-1 items-start lg:items-center gap-4 lg:gap-5">
|
|
103
|
+
<div className="size-10 rounded-lg bg-gray-50 flex items-center justify-center shrink-0">
|
|
104
|
+
<IconLock size={20} className="text-gray-950" />
|
|
105
|
+
</div>
|
|
106
|
+
<div className="flex flex-col gap-1.5 flex-1">
|
|
107
|
+
<span className="paragraph-small-semibold text-gray-950">
|
|
108
|
+
Alterar senha de acesso
|
|
109
|
+
</span>
|
|
110
|
+
<span className="paragraph-small-regular text-gray-600">
|
|
111
|
+
Atualize sua senha sempre que necessário para manter sua conta segura.
|
|
112
|
+
</span>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
<Button
|
|
116
|
+
variant="secondary"
|
|
117
|
+
className="h-10! shrink-0 w-full lg:w-auto"
|
|
118
|
+
onClick={(e) => {
|
|
119
|
+
e.stopPropagation();
|
|
120
|
+
setActiveSection(AccountSectionType.CHANGE_PASSWORD);
|
|
121
|
+
}}
|
|
122
|
+
>
|
|
123
|
+
Alterar senha
|
|
124
|
+
</Button>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
{onDeleteAccount && (
|
|
129
|
+
<button
|
|
130
|
+
type="button"
|
|
131
|
+
className="paragraph-small-semibold text-red-600 bg-red-50 rounded-lg px-3 py-2 cursor-pointer hover:bg-red-100 transition-colors w-fit"
|
|
132
|
+
onClick={handleDeleteAccount}
|
|
133
|
+
>
|
|
134
|
+
Excluir minha conta
|
|
135
|
+
</button>
|
|
136
|
+
)}
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<div className="fixed bottom-0 left-0 right-0 lg:absolute flex items-center h-20 px-4 lg:px-5 border-t border-gray-200 justify-between bg-white z-10">
|
|
140
|
+
<Button variant="secondary" className="h-10!" type="button" onClick={onClose}>
|
|
141
|
+
Cancelar
|
|
142
|
+
</Button>
|
|
143
|
+
<Button className="h-10!" onClick={onClose}>
|
|
144
|
+
Salvar alterações
|
|
145
|
+
</Button>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<DisableTwoFactorAuthModal
|
|
149
|
+
open={disableTwoFactorOpen}
|
|
150
|
+
onClose={() => setDisableTwoFactorOpen(false)}
|
|
151
|
+
onSuccess={handleDisableTwoFactorSuccess}
|
|
152
|
+
/>
|
|
153
|
+
<TwoFactorAuthModal
|
|
154
|
+
open={twoFactorOpen}
|
|
155
|
+
onClose={() => setTwoFactorOpen(false)}
|
|
156
|
+
onSuccess={handleEnableTwoFactorSuccess}
|
|
157
|
+
/>
|
|
158
|
+
</>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
"use client"
|
|
4
|
-
|
|
5
|
-
import * as React from "react"
|
|
6
|
-
import {
|
|
7
|
-
import { useMdSidebarStore } from "../../store/useMdSidebarStore"
|
|
8
|
-
import { cn } from "../../infra/utils/clsx"
|
|
9
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/overlay/Tooltip"
|
|
10
|
-
|
|
11
|
-
function MdSideBarNavigation({
|
|
12
|
-
className,
|
|
13
|
-
children,
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<"div">) {
|
|
16
|
-
const { isExpanded, collapse } = useMdSidebarStore()
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<>
|
|
20
|
-
<div
|
|
21
|
-
className={`hidden md:block lg:hidden fixed inset-0 bg-black/50 z-20 transition-opacity duration-300 ${
|
|
22
|
-
isExpanded ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
23
|
-
}`}
|
|
24
|
-
onClick={collapse}
|
|
25
|
-
/>
|
|
26
|
-
<div
|
|
27
|
-
className={`hidden md:flex lg:hidden fixed top-0 bottom-0 left-[73px] z-30 transition-transform duration-300 ease-in-out overflow-visible ${
|
|
28
|
-
isExpanded ? "translate-x-0" : "-translate-x-full"
|
|
29
|
-
}`}
|
|
30
|
-
>
|
|
31
|
-
<div
|
|
32
|
-
data-slot="md-sidebar-navigation"
|
|
33
|
-
className={cn("relative w-[273px] h-full flex flex-col p-4 bg-white border-r border-gray-200", className)}
|
|
34
|
-
{...props}
|
|
35
|
-
>
|
|
36
|
-
{isExpanded && (
|
|
37
|
-
<Tooltip>
|
|
38
|
-
<TooltipTrigger asChild>
|
|
39
|
-
<button
|
|
40
|
-
onClick={collapse}
|
|
41
|
-
className="absolute top-[68px] -right-4 size-8 flex items-center justify-center rounded-full border border-gray-200 bg-white hover:bg-gray-100 cursor-pointer transition-colors z-40"
|
|
42
|
-
>
|
|
43
|
-
<
|
|
44
|
-
</button>
|
|
45
|
-
</TooltipTrigger>
|
|
46
|
-
<TooltipContent side="right">Recolher menu</TooltipContent>
|
|
47
|
-
</Tooltip>
|
|
48
|
-
)}
|
|
49
|
-
{children}
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { MdSideBarNavigation };
|
|
3
|
+
"use client"
|
|
4
|
+
|
|
5
|
+
import * as React from "react"
|
|
6
|
+
import { IconChevronLeft } from '@tabler/icons-react'
|
|
7
|
+
import { useMdSidebarStore } from "../../store/useMdSidebarStore"
|
|
8
|
+
import { cn } from "../../infra/utils/clsx"
|
|
9
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/overlay/Tooltip"
|
|
10
|
+
|
|
11
|
+
function MdSideBarNavigation({
|
|
12
|
+
className,
|
|
13
|
+
children,
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<"div">) {
|
|
16
|
+
const { isExpanded, collapse } = useMdSidebarStore()
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<div
|
|
21
|
+
className={`hidden md:block lg:hidden fixed inset-0 bg-black/50 z-20 transition-opacity duration-300 ${
|
|
22
|
+
isExpanded ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
23
|
+
}`}
|
|
24
|
+
onClick={collapse}
|
|
25
|
+
/>
|
|
26
|
+
<div
|
|
27
|
+
className={`hidden md:flex lg:hidden fixed top-0 bottom-0 left-[73px] z-30 transition-transform duration-300 ease-in-out overflow-visible ${
|
|
28
|
+
isExpanded ? "translate-x-0" : "-translate-x-full"
|
|
29
|
+
}`}
|
|
30
|
+
>
|
|
31
|
+
<div
|
|
32
|
+
data-slot="md-sidebar-navigation"
|
|
33
|
+
className={cn("relative w-[273px] h-full flex flex-col p-4 bg-white border-r border-gray-200", className)}
|
|
34
|
+
{...props}
|
|
35
|
+
>
|
|
36
|
+
{isExpanded && (
|
|
37
|
+
<Tooltip>
|
|
38
|
+
<TooltipTrigger asChild>
|
|
39
|
+
<button
|
|
40
|
+
onClick={collapse}
|
|
41
|
+
className="absolute top-[68px] -right-4 size-8 flex items-center justify-center rounded-full border border-gray-200 bg-white hover:bg-gray-100 cursor-pointer transition-colors z-40"
|
|
42
|
+
>
|
|
43
|
+
<IconChevronLeft size={16} className="text-gray-500" />
|
|
44
|
+
</button>
|
|
45
|
+
</TooltipTrigger>
|
|
46
|
+
<TooltipContent side="right">Recolher menu</TooltipContent>
|
|
47
|
+
</Tooltip>
|
|
48
|
+
)}
|
|
49
|
+
{children}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { MdSideBarNavigation };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import Image from "next/image";
|
|
5
|
-
import {
|
|
5
|
+
import { IconChevronRight } from '@tabler/icons-react';
|
|
6
6
|
import { Separator } from "../ui/data-display/Separator";
|
|
7
7
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/overlay/Tooltip";
|
|
8
8
|
import { cn } from "../../infra/utils/clsx";
|
|
@@ -68,7 +68,7 @@ function NavBar({
|
|
|
68
68
|
onClick={onExpandClick}
|
|
69
69
|
className="lg:hidden absolute top-1/2 -translate-y-1/2 right-0 translate-x-[calc(50%+1rem)] size-8 flex items-center justify-center rounded-full border border-gray-200 bg-white hover:bg-gray-100 cursor-pointer transition-colors z-10"
|
|
70
70
|
>
|
|
71
|
-
<
|
|
71
|
+
<IconChevronRight size={16} className="text-gray-500" />
|
|
72
72
|
</button>
|
|
73
73
|
</TooltipTrigger>
|
|
74
74
|
<TooltipContent side="right">Expandir menu</TooltipContent>
|