@vtex/faststore-plugin-buyer-portal 1.1.116-poc-9 → 1.2.1
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/package.json +42 -42
- package/src/features/addresses/layouts/AddressDetailsLayout/AddressDetailsLayout.tsx +0 -1
- package/src/features/addresses/layouts/AddressesLayout/AddressesLayout.tsx +0 -1
- package/src/features/budgets/layouts/BudgetsDetailsLayout/BudgetsDetailsLayout.tsx +0 -1
- package/src/features/collections/layouts/CollectionsLayout/CollectionsLayout.tsx +0 -1
- package/src/features/contracts/hooks/index.ts +0 -2
- package/src/features/contracts/services/get-contract-details.service.ts +0 -4
- package/src/features/credit-cards/layouts/CreditCardsLayout/CreditCardLayout.tsx +0 -1
- package/src/features/custom-fields/layouts/CustomFieldsLayout/CustomFieldsLayout.tsx +0 -1
- package/src/features/org-units/clients/OrgUnitClient.ts +15 -2
- package/src/features/org-units/components/OrgUnitBreadcrumb/OrgUnitBreadcrumbLink.tsx +0 -1
- package/src/features/org-units/hooks/index.ts +0 -1
- package/src/features/org-units/layouts/OrgUnitDetailsLayout/OrgUnitDetailsLayout.tsx +29 -32
- package/src/features/org-units/services/get-org-unit-basic-data.service.ts +0 -4
- package/src/features/org-units/services/get-org-unit-by-user-id.service.ts +0 -4
- package/src/features/org-units/types/OrgUnitSummaryData.ts +0 -18
- package/src/features/org-units/types/index.ts +0 -2
- package/src/features/payment-methods/layouts/PaymentMethodsLayout/PaymentMethodsLayout.tsx +0 -1
- package/src/features/profile/layouts/ProfileLayout/ProfileLayout.tsx +16 -46
- package/src/features/shared/components/Error/Error.tsx +13 -12
- package/src/features/shared/components/index.ts +0 -1
- package/src/features/shared/components/withErrorBoundary/withErrorBoundary.tsx +1 -0
- package/src/features/shared/hooks/index.ts +0 -2
- package/src/features/shared/layouts/ContractTabsLayout/ContractTabsLayout.tsx +9 -14
- package/src/features/shared/layouts/ErrorTabsLayout/ErrorTabsLayout.tsx +0 -1
- package/src/features/shared/layouts/LoadingTabsLayout/LoadingTabsLayout.tsx +27 -6
- package/src/features/shared/utils/withAuthLoader.ts +1 -1
- package/src/features/shared/utils/withAuthProvider.tsx +0 -1
- package/src/features/shared/utils/withProviders.tsx +2 -1
- package/src/features/users/services/get-user-by-id.service.ts +0 -4
- package/src/pages/org-unit-details.tsx +62 -42
- package/src/pages/profile.tsx +64 -48
- package/src/themes/index.scss +0 -1
- package/src/features/contracts/hooks/useContractDetails.ts +0 -22
- package/src/features/contracts/hooks/useContractsByOrgUnitId.ts +0 -20
- package/src/features/org-units/hooks/useOrgUnitBasicData.ts +0 -20
- package/src/features/shared/components/PageLoader/PageLoader.tsx +0 -47
- package/src/features/shared/components/PageLoader/index.ts +0 -1
- package/src/features/shared/components/PageLoader/page-loader.scss +0 -22
- package/src/features/shared/hooks/useAuth.ts +0 -50
- package/src/features/shared/hooks/useCookieMonitor.ts +0 -73
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
2
|
+
"name": "@vtex/faststore-plugin-buyer-portal",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "A plugin for faststore with buyer portal",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
8
|
+
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
|
9
|
+
"prepare": "husky"
|
|
10
|
+
},
|
|
11
|
+
"lint-staged": {
|
|
12
|
+
"*.{js,jsx,ts,tsx}": [
|
|
13
|
+
"eslint --fix"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/react-dom": "^19.0.3",
|
|
18
|
+
"react-dom": "^19.0.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@eslint/js": "^9.29.0",
|
|
22
|
+
"@faststore/core": "^3.41.5",
|
|
23
|
+
"@faststore/ui": "^3.41.5",
|
|
24
|
+
"@types/react": "^18.2.42",
|
|
25
|
+
"cypress": "13",
|
|
26
|
+
"eslint": "^9.29.0",
|
|
27
|
+
"eslint-config-prettier": "^10.1.5",
|
|
28
|
+
"eslint-plugin-import": "^2.32.0",
|
|
29
|
+
"eslint-plugin-prettier": "^5.5.1",
|
|
30
|
+
"eslint-plugin-react": "^7.37.5",
|
|
31
|
+
"globals": "^16.2.0",
|
|
32
|
+
"husky": "^9.1.7",
|
|
33
|
+
"lint-staged": "^16.1.2",
|
|
34
|
+
"next": "13.5.7",
|
|
35
|
+
"typescript": "4.7.3",
|
|
36
|
+
"typescript-eslint": "^8.35.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": "^18.2.0",
|
|
40
|
+
"react-dom": "^18.2.0"
|
|
41
|
+
},
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
44
44
|
}
|
|
@@ -15,10 +15,6 @@ const getContractDetailsFunction = async ({
|
|
|
15
15
|
cookie,
|
|
16
16
|
unitId,
|
|
17
17
|
}: GetContractDetailsServiceProps) => {
|
|
18
|
-
if (!unitId || !contractId) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
18
|
const { contract } = await contractsClient.getContractDetails(
|
|
23
19
|
unitId,
|
|
24
20
|
contractId,
|
|
@@ -6,7 +6,6 @@ import type {
|
|
|
6
6
|
OrgUnitSummaryData,
|
|
7
7
|
OrgUnitSearchParams,
|
|
8
8
|
OrgUnitSearchResponse,
|
|
9
|
-
OrgUnitUserData,
|
|
10
9
|
} from "../types";
|
|
11
10
|
|
|
12
11
|
export class OrgUnitClient extends Client {
|
|
@@ -31,7 +30,21 @@ export class OrgUnitClient extends Client {
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
getOrgUnitByUserId(userId: string, cookie: string) {
|
|
34
|
-
return this.get<
|
|
33
|
+
return this.get<{
|
|
34
|
+
orgUnit: {
|
|
35
|
+
createdAt: string;
|
|
36
|
+
updatedAt: string;
|
|
37
|
+
name: string;
|
|
38
|
+
path: {
|
|
39
|
+
ids: string;
|
|
40
|
+
names: string;
|
|
41
|
+
};
|
|
42
|
+
id: string;
|
|
43
|
+
customerGroup: {
|
|
44
|
+
customerIds: string[];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}>(`users/${userId}/units`, {
|
|
35
48
|
headers: {
|
|
36
49
|
Cookie: cookie,
|
|
37
50
|
},
|
|
@@ -5,4 +5,3 @@ export { useUpdateOrgUnit } from "./useUpdateOrgUnit";
|
|
|
5
5
|
export { useChildrenOrgUnits } from "./useChildrenOrgUnits";
|
|
6
6
|
export { useOrgUnitByUser } from "./useOrgUnitByUser";
|
|
7
7
|
export { useSearchOrgUnits } from "./useSearchOrgUnits";
|
|
8
|
-
export { useOrgUnitBasicData } from "./useOrgUnitBasicData";
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
Skeleton,
|
|
6
6
|
} from "@faststore/ui";
|
|
7
7
|
|
|
8
|
-
import { useContractsByOrgUnitId } from "../../../contracts/hooks";
|
|
9
8
|
import {
|
|
10
9
|
BasicCard,
|
|
11
10
|
BasicDropdownMenu,
|
|
@@ -22,14 +21,13 @@ import {
|
|
|
22
21
|
getOrganizationSettingsLinks,
|
|
23
22
|
} from "../../../shared/utils";
|
|
24
23
|
import { buyerPortalRoutes } from "../../../shared/utils/buyerPortalRoutes";
|
|
25
|
-
import { useGetUserById } from "../../../users/hooks";
|
|
26
24
|
import {
|
|
27
25
|
AddAllToOrgUnitDropdown,
|
|
28
26
|
OrgUnitBreadcrumb,
|
|
29
27
|
OrgUnitDetailsNavbar,
|
|
30
28
|
OrgUnitsDropdownMenu,
|
|
31
29
|
} from "../../components";
|
|
32
|
-
import {
|
|
30
|
+
import { useOrgUnitByUser } from "../../hooks";
|
|
33
31
|
|
|
34
32
|
import {
|
|
35
33
|
MAX_DESKTOP_BREADCRUMB_ITEMS,
|
|
@@ -37,29 +35,28 @@ import {
|
|
|
37
35
|
QUERY_TABLET,
|
|
38
36
|
} from "./utils";
|
|
39
37
|
|
|
38
|
+
import type { ContractData } from "../../../contracts/types";
|
|
39
|
+
import type { UserData } from "../../../users/types";
|
|
40
|
+
import type { OrgUnitBasicData } from "../../types";
|
|
41
|
+
|
|
40
42
|
export type OrgUnitsDetailsLayoutProps = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
data: {
|
|
44
|
+
orgUnit: OrgUnitBasicData;
|
|
45
|
+
contracts: ContractData[];
|
|
46
|
+
user: UserData | null;
|
|
47
|
+
};
|
|
43
48
|
loading?: boolean;
|
|
44
49
|
};
|
|
45
50
|
|
|
46
51
|
export const OrgUnitsDetailsLayout = ({
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
loading = true,
|
|
52
|
+
data: { orgUnit, contracts, user },
|
|
53
|
+
loading = false,
|
|
50
54
|
}: OrgUnitsDetailsLayoutProps) => {
|
|
51
|
-
const { orgUnit, isOrgUnitLoading } = useOrgUnitBasicData(orgUnitId);
|
|
52
|
-
|
|
53
|
-
const { contracts, isContractsLoading } = useContractsByOrgUnitId(orgUnitId);
|
|
54
|
-
|
|
55
|
-
const { user, isUserLoading } = useGetUserById({ orgUnitId, userId });
|
|
56
|
-
|
|
57
|
-
loading = isOrgUnitLoading || isContractsLoading || isUserLoading;
|
|
58
55
|
const isMobile = useMediaQuery(QUERY_TABLET);
|
|
59
56
|
|
|
60
|
-
const isSingleContract =
|
|
57
|
+
const isSingleContract = contracts.length <= 1;
|
|
61
58
|
|
|
62
|
-
const { orgUnit: userUnit } = useOrgUnitByUser(
|
|
59
|
+
const { orgUnit: userUnit } = useOrgUnitByUser(user?.id ?? "");
|
|
63
60
|
|
|
64
61
|
const orgUnitList = orgUnit?.path.ids.split("/").slice(1) ?? [];
|
|
65
62
|
|
|
@@ -70,7 +67,7 @@ export const OrgUnitsDetailsLayout = ({
|
|
|
70
67
|
const breadcrumbList = orgUnitList.map((orgUnitId, index) => ({
|
|
71
68
|
unitId: orgUnitId,
|
|
72
69
|
item: buyerPortalRoutes.orgUnitDetails({ orgUnitId }),
|
|
73
|
-
name: orgUnit
|
|
70
|
+
name: orgUnit.path.names.split("/")[index],
|
|
74
71
|
position: index + 1,
|
|
75
72
|
enabled: index >= userUnitIndex,
|
|
76
73
|
}));
|
|
@@ -79,7 +76,7 @@ export const OrgUnitsDetailsLayout = ({
|
|
|
79
76
|
<GlobalLayout>
|
|
80
77
|
{/* TODO: Add person here */}
|
|
81
78
|
<OrgUnitDetailsNavbar
|
|
82
|
-
orgName={orgUnit
|
|
79
|
+
orgName={orgUnit.name}
|
|
83
80
|
person={{
|
|
84
81
|
name: user?.name ?? "",
|
|
85
82
|
role: user?.roles?.[0] ?? "",
|
|
@@ -110,8 +107,8 @@ export const OrgUnitsDetailsLayout = ({
|
|
|
110
107
|
<BasicDropdownMenu.Trigger />
|
|
111
108
|
<OrgUnitsDropdownMenu
|
|
112
109
|
isComplete={false}
|
|
113
|
-
id={
|
|
114
|
-
name={orgUnit
|
|
110
|
+
id={orgUnit.id}
|
|
111
|
+
name={orgUnit.name}
|
|
115
112
|
/>
|
|
116
113
|
</Dropdown>
|
|
117
114
|
<Dropdown>
|
|
@@ -121,8 +118,8 @@ export const OrgUnitsDetailsLayout = ({
|
|
|
121
118
|
<AddAllToOrgUnitDropdown
|
|
122
119
|
isSingleContract={isSingleContract}
|
|
123
120
|
contractId={contracts[0]?.id}
|
|
124
|
-
unitId={
|
|
125
|
-
unitName={orgUnit?.name
|
|
121
|
+
unitId={orgUnit?.id}
|
|
122
|
+
unitName={orgUnit?.name}
|
|
126
123
|
/>
|
|
127
124
|
</Dropdown>
|
|
128
125
|
</HeaderInside>
|
|
@@ -132,13 +129,13 @@ export const OrgUnitsDetailsLayout = ({
|
|
|
132
129
|
data-fs-bp-contracts-settings-card
|
|
133
130
|
footerMessage="Manage contract settings"
|
|
134
131
|
footerLink={buyerPortalRoutes.profileDetails({
|
|
135
|
-
orgUnitId:
|
|
132
|
+
orgUnitId: orgUnit.id,
|
|
136
133
|
contractId: contracts[0]?.id ?? "",
|
|
137
134
|
})}
|
|
138
135
|
enableFooter
|
|
139
136
|
>
|
|
140
|
-
<LetterHighlight letter={orgUnit
|
|
141
|
-
<VerticalNav.Menu title={orgUnit
|
|
137
|
+
<LetterHighlight letter={orgUnit.name[0]} />
|
|
138
|
+
<VerticalNav.Menu title={orgUnit.name} loading={loading}>
|
|
142
139
|
{loading
|
|
143
140
|
? Array(8)
|
|
144
141
|
.fill(null)
|
|
@@ -153,7 +150,7 @@ export const OrgUnitsDetailsLayout = ({
|
|
|
153
150
|
</li>
|
|
154
151
|
))
|
|
155
152
|
: getContractSettingsLinks({
|
|
156
|
-
orgUnitId:
|
|
153
|
+
orgUnitId: orgUnit.id,
|
|
157
154
|
contractId: contracts[0]?.id ?? "",
|
|
158
155
|
}).map(({ name, link }) => (
|
|
159
156
|
<VerticalNav.Link key={name} link={link}>
|
|
@@ -180,7 +177,7 @@ export const OrgUnitsDetailsLayout = ({
|
|
|
180
177
|
/>
|
|
181
178
|
}
|
|
182
179
|
href={buyerPortalRoutes.profileDetails({
|
|
183
|
-
orgUnitId:
|
|
180
|
+
orgUnitId: orgUnit.id,
|
|
184
181
|
contractId: contract.id,
|
|
185
182
|
})}
|
|
186
183
|
menu={
|
|
@@ -199,12 +196,12 @@ export const OrgUnitsDetailsLayout = ({
|
|
|
199
196
|
data-fs-bp-organizations-settings-card
|
|
200
197
|
footerMessage="Manage organization settings"
|
|
201
198
|
footerLink={buyerPortalRoutes.users({
|
|
202
|
-
orgUnitId:
|
|
199
|
+
orgUnitId: orgUnit.id,
|
|
203
200
|
})}
|
|
204
201
|
enableFooter
|
|
205
202
|
>
|
|
206
203
|
<VerticalNav.Menu title="Organization">
|
|
207
|
-
{getOrganizationSettingsLinks(
|
|
204
|
+
{getOrganizationSettingsLinks(orgUnit.id).map((option) => (
|
|
208
205
|
<VerticalNav.Link key={option.name} link={option.link}>
|
|
209
206
|
{option.name}
|
|
210
207
|
</VerticalNav.Link>
|
|
@@ -215,14 +212,14 @@ export const OrgUnitsDetailsLayout = ({
|
|
|
215
212
|
data-fs-bp-compliance-settings-card
|
|
216
213
|
footerMessage="Manage finance and compliance settings"
|
|
217
214
|
footerLink={buyerPortalRoutes.buyingPolicies({
|
|
218
|
-
orgUnitId:
|
|
215
|
+
orgUnitId: orgUnit.id,
|
|
219
216
|
contractId: contracts[0]?.id,
|
|
220
217
|
})}
|
|
221
218
|
enableFooter
|
|
222
219
|
>
|
|
223
220
|
<VerticalNav.Menu title="Finance and Compliance">
|
|
224
221
|
{getFinanceSettingsLinks({
|
|
225
|
-
orgUnitId:
|
|
222
|
+
orgUnitId: orgUnit.id,
|
|
226
223
|
contractId: contracts[0]?.id ?? "",
|
|
227
224
|
}).map((option) => (
|
|
228
225
|
<VerticalNav.Link key={option.name} link={option.link}>
|
|
@@ -25,21 +25,3 @@ export type OrgUnitBasicData = Pick<OrgUnitSummaryData, "id" | "name"> & {
|
|
|
25
25
|
ids: string;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
export type UserOrgUnit = {
|
|
30
|
-
createdAt: string;
|
|
31
|
-
updatedAt: string;
|
|
32
|
-
name: string;
|
|
33
|
-
path: {
|
|
34
|
-
ids: string;
|
|
35
|
-
names: string;
|
|
36
|
-
};
|
|
37
|
-
id: string;
|
|
38
|
-
customerGroup: {
|
|
39
|
-
customerIds: string[];
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type OrgUnitUserData = {
|
|
44
|
-
orgUnit: UserOrgUnit;
|
|
45
|
-
};
|
|
@@ -1,37 +1,18 @@
|
|
|
1
|
-
import { Skeleton } from "@faststore/ui";
|
|
2
|
-
|
|
3
|
-
import { useContractDetails } from "../../../contracts/hooks";
|
|
4
|
-
import { useOrgUnitBasicData } from "../../../org-units/hooks";
|
|
5
1
|
import { HeaderInside } from "../../../shared/components";
|
|
2
|
+
import { useBuyerPortal } from "../../../shared/hooks";
|
|
6
3
|
import { GlobalLayout, ContractTabsLayout } from "../../../shared/layouts";
|
|
7
|
-
|
|
4
|
+
|
|
5
|
+
import type { ContractData } from "../../../contracts/types";
|
|
8
6
|
|
|
9
7
|
export type ProfileLayoutProps = {
|
|
10
|
-
|
|
11
|
-
contractId: string;
|
|
12
|
-
userId: string;
|
|
13
|
-
loading?: boolean;
|
|
8
|
+
data: ContractData | null;
|
|
14
9
|
};
|
|
15
10
|
|
|
16
|
-
export const ProfileLayout = ({
|
|
17
|
-
|
|
18
|
-
contractId,
|
|
19
|
-
userId,
|
|
20
|
-
loading = true,
|
|
21
|
-
}: ProfileLayoutProps) => {
|
|
22
|
-
const { orgUnit, isOrgUnitLoading } = useOrgUnitBasicData(orgUnitId);
|
|
23
|
-
|
|
24
|
-
const { contract, isContractLoading } = useContractDetails(
|
|
25
|
-
contractId,
|
|
26
|
-
orgUnitId
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
const { user, isUserLoading } = useGetUserById({ orgUnitId, userId });
|
|
30
|
-
|
|
31
|
-
loading = isContractLoading || isOrgUnitLoading || isUserLoading;
|
|
11
|
+
export const ProfileLayout = ({ data }: ProfileLayoutProps) => {
|
|
12
|
+
const { currentOrgUnit: orgUnit, currentUser: user } = useBuyerPortal();
|
|
32
13
|
|
|
33
|
-
const creationDate =
|
|
34
|
-
? new Date(
|
|
14
|
+
const creationDate = data
|
|
15
|
+
? new Date(data.creationDate).toLocaleDateString("en-US", {
|
|
35
16
|
year: "numeric",
|
|
36
17
|
month: "long",
|
|
37
18
|
day: "numeric",
|
|
@@ -42,41 +23,30 @@ export const ProfileLayout = ({
|
|
|
42
23
|
<GlobalLayout>
|
|
43
24
|
<ContractTabsLayout
|
|
44
25
|
orgUnitName={orgUnit?.name ?? ""}
|
|
45
|
-
orgUnitId={
|
|
46
|
-
contractName={
|
|
47
|
-
contractId={
|
|
26
|
+
orgUnitId={orgUnit?.id ?? ""}
|
|
27
|
+
contractName={data?.name ?? ""}
|
|
28
|
+
contractId={data?.id ?? ""}
|
|
48
29
|
pageName="Contract"
|
|
49
30
|
person={{
|
|
50
31
|
image: undefined,
|
|
51
32
|
name: user?.name ?? "",
|
|
52
|
-
role: user?.
|
|
53
|
-
id: userId,
|
|
33
|
+
role: user?.role ?? "",
|
|
54
34
|
}}
|
|
55
|
-
loading={loading}
|
|
56
35
|
>
|
|
57
36
|
<section data-fs-bp-profile>
|
|
58
37
|
<HeaderInside title="Profile" />
|
|
59
38
|
|
|
60
|
-
{
|
|
61
|
-
<Skeleton
|
|
62
|
-
size={{
|
|
63
|
-
width: "100%",
|
|
64
|
-
height: "8rem",
|
|
65
|
-
}}
|
|
66
|
-
/>
|
|
67
|
-
)}
|
|
68
|
-
|
|
69
|
-
{contract && (
|
|
39
|
+
{data && (
|
|
70
40
|
<div data-fs-bp-profile-details>
|
|
71
41
|
<span data-fs-bp-profile-details-title>Details</span>
|
|
72
42
|
|
|
73
|
-
{!!
|
|
43
|
+
{!!data.name && (
|
|
74
44
|
<>
|
|
75
45
|
<hr data-fs-bp-profile-divider />
|
|
76
46
|
<div data-fs-bp-profile-details-row>
|
|
77
47
|
<span data-fs-bp-profile-details-row-label>Name</span>
|
|
78
48
|
<span data-fs-bp-profile-details-row-value>
|
|
79
|
-
{
|
|
49
|
+
{data.name}
|
|
80
50
|
</span>
|
|
81
51
|
</div>
|
|
82
52
|
</>
|
|
@@ -87,7 +57,7 @@ export const ProfileLayout = ({
|
|
|
87
57
|
<div data-fs-bp-profile-details-row>
|
|
88
58
|
<span data-fs-bp-profile-details-row-label>Email</span>
|
|
89
59
|
<span data-fs-bp-profile-details-row-value>
|
|
90
|
-
<a href={`mailto:${
|
|
60
|
+
<a href={`mailto:${data.email}`}>{data.email}</a>
|
|
91
61
|
</span>
|
|
92
62
|
</div>
|
|
93
63
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isDevelopment } from "../../utils/environment";
|
|
1
|
+
// import { isDevelopment } from "../../utils/environment";
|
|
2
2
|
import { Icon } from "../Icon";
|
|
3
3
|
|
|
4
4
|
export type ErrorProps = {
|
|
@@ -20,17 +20,18 @@ export default function Error({ error }: ErrorProps) {
|
|
|
20
20
|
<button data-fs-bp-error-button onClick={() => window.location.reload()}>
|
|
21
21
|
Try again
|
|
22
22
|
</button>
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
<div data-fs-bp-error-details>
|
|
24
|
+
<span data-fs-bp-error-details-type>{error?.tags?.errorType}</span>
|
|
25
|
+
<h2 data-fs-bp-error-details-title>Error Details</h2>
|
|
26
|
+
<p data-fs-bp-error-details-message>{error?.error.message}</p>
|
|
27
|
+
<p data-fs-bp-error-details-stack>Stack: {error?.error.stack}</p>
|
|
28
|
+
<p data-fs-bp-error-details-component>
|
|
29
|
+
Component: {error?.tags?.component}
|
|
30
|
+
</p>
|
|
31
|
+
<p data-fs-bp-error-details-query>
|
|
32
|
+
Query: {JSON.stringify(error?.query)}
|
|
33
|
+
</p>
|
|
34
|
+
</div>
|
|
34
35
|
</div>
|
|
35
36
|
);
|
|
36
37
|
}
|
|
@@ -76,4 +76,3 @@ export { ErrorBoundary } from "./ErrorBoundary/ErrorBoundary";
|
|
|
76
76
|
export { withErrorBoundary } from "./withErrorBoundary/withErrorBoundary";
|
|
77
77
|
export { default as Error } from "./Error/Error";
|
|
78
78
|
export { IconBookmarked } from "./IconBookmarked/IconBookmarked";
|
|
79
|
-
export { PageLoader } from "./PageLoader";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { useBuyerPortal } from "./useBuyerPortal";
|
|
2
|
-
export { useCookieMonitor } from "./useCookieMonitor";
|
|
3
2
|
export { useDrawerProps, type DrawerProps } from "./useDrawerProps";
|
|
4
3
|
export {
|
|
5
4
|
useMutation,
|
|
@@ -13,4 +12,3 @@ export { useAddToScope } from "./useAddToScope";
|
|
|
13
12
|
export { useRemoveFromScope } from "./useRemoveFromScope";
|
|
14
13
|
export { usePageItems, type UsePageItemsProps } from "./usePageItems";
|
|
15
14
|
export { useRouterLoading } from "./useRouterLoading";
|
|
16
|
-
export { useAuth, type UseAuthResult } from "./useAuth";
|