@vtex/faststore-plugin-buyer-portal 1.1.116-poc-1 → 1.1.116-poc-2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/faststore-plugin-buyer-portal",
3
- "version": "1.1.116-poc-1",
3
+ "version": "1.1.116-poc-2",
4
4
  "description": "A plugin for faststore with buyer portal",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,3 +1,5 @@
1
+ import { Skeleton } from "@faststore/ui";
2
+
1
3
  import { useContractDetails } from "../../../contracts/hooks";
2
4
  import { useOrgUnitBasicData } from "../../../org-units/hooks";
3
5
  import { HeaderInside } from "../../../shared/components";
@@ -88,6 +90,15 @@ export const ProfileLayout = ({
88
90
  <hr data-fs-bp-profile-divider />
89
91
  </div>
90
92
  )}
93
+
94
+ {loading && (
95
+ <Skeleton
96
+ size={{
97
+ width: "100%",
98
+ height: "8rem",
99
+ }}
100
+ />
101
+ )}
91
102
  </section>
92
103
  </ContractTabsLayout>
93
104
  </GlobalLayout>
@@ -2,8 +2,9 @@ import type { ReactNode } from "react";
2
2
 
3
3
  import { DropdownItem } from "@faststore/ui";
4
4
 
5
+ import { useContractDetails } from "../../../contracts/hooks";
6
+ import { useOrgUnitBasicData } from "../../../org-units/hooks";
5
7
  import { Icon } from "../../components";
6
- import { useBuyerPortal } from "../../hooks";
7
8
  import { getContractSettingsLinks } from "../../utils";
8
9
  import { BaseTabsLayout } from "../BaseTabsLayout/BaseTabsLayout";
9
10
 
@@ -32,17 +33,19 @@ export const ContractTabsLayout = ({
32
33
  contractId,
33
34
  person,
34
35
  }: ContractTabsLayoutProps) => {
35
- const { currentOrgUnit, currentContract } = useBuyerPortal();
36
+ const { orgUnit } = useOrgUnitBasicData(orgUnitId);
37
+
38
+ const { contract } = useContractDetails(contractId, orgUnitId);
36
39
 
37
40
  const verticalLinks = getContractSettingsLinks({
38
- contractId: currentContract?.id ?? contractId ?? "",
39
- orgUnitId: currentOrgUnit?.id ?? orgUnitId ?? "",
41
+ contractId: contractId,
42
+ orgUnitId: orgUnitId,
40
43
  });
41
44
 
42
45
  return (
43
46
  <BaseTabsLayout data-fs-bp-contract-tabs-layout>
44
47
  <BaseTabsLayout.Navbar
45
- orgUnit={currentOrgUnit}
48
+ orgUnit={orgUnit}
46
49
  pageName={pageName}
47
50
  person={{
48
51
  name: person.name,
@@ -61,7 +64,7 @@ export const ContractTabsLayout = ({
61
64
  </DropdownItem>
62
65
  }
63
66
  verticalLinks={verticalLinks}
64
- name={currentContract?.name ?? ""}
67
+ name={contract?.name ?? ""}
65
68
  />
66
69
  <BaseTabsLayout.Content>{children}</BaseTabsLayout.Content>
67
70
  </BaseTabsLayout.Container>