@ludo.ninja/components 2.2.10 → 2.2.12

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.
@@ -1,4 +1,4 @@
1
- export declare const useGetOpportunities: () => {
1
+ export declare const useGetOpportunities: (availableProfileId: string) => {
2
2
  opportunities: import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").Maybe<Pick<import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").IOpportunityV2, "views" | "createdAt" | "blockchain" | "name" | "description" | "collection" | "liked" | "opportunityId" | "brandId" | "categoryId" | "opportunityStatus" | "opportunityType" | "notificationType" | "brandName" | "brandDescription" | "brandMedia" | "brandUrl" | "brandIndustry" | "categoryName" | "ludoUrl" | "projectUrl" | "activeFrom" | "activeUntil" | "minXpLevel" | "maxXpLevel" | "minRank" | "maxRank" | "media" | "reportLink" | "clicks" | "minWalletValue" | "maxWalletValue" | "shareLink">>[];
3
3
  isLoadingOpportunities: boolean;
4
4
  };
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useGetOpportunities = void 0;
4
+ const store_1 = require("../../../modules/user/store");
5
+ const ui_1 = require("../../../store/ui");
4
6
  const api_1 = require("@ludo.ninja/api");
5
7
  const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema");
6
8
  const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
7
- const ui_1 = require("../../../store/ui");
8
- const store_1 = require("../../../modules/user/store");
9
9
  const react_1 = require("react");
10
- const useGetOpportunities = () => {
10
+ const useGetOpportunities = (availableProfileId) => {
11
11
  const isSignedIn = (0, store_1.useUserStore)((state) => state.isSignedIn);
12
+ const user = (0, store_1.useUserStore)((state) => state.user);
12
13
  const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
13
14
  const [opportunities, setOpportunities] = (0, react_1.useState)([]);
14
15
  const [getOpportunities, { loading }] = (0, schema_1.useFetchOpportunitiesForProfileLazyQuery)({
@@ -23,7 +24,7 @@ const useGetOpportunities = () => {
23
24
  },
24
25
  });
25
26
  (0, react_1.useEffect)(() => {
26
- if (isSignedIn && !opportunities.length) {
27
+ if (isSignedIn && !opportunities.length && availableProfileId === user?.userId) {
27
28
  getOpportunities().then((res) => {
28
29
  setOpportunities(res.data?.fetchOpportunitiesForProfile || []);
29
30
  });
@@ -11,6 +11,7 @@ const api_svg_1 = __importDefault(require("../../public/sidebar/api"));
11
11
  const explore_svg_1 = __importDefault(require("../../public/sidebar/explore"));
12
12
  const my_invites_svg_1 = __importDefault(require("../../public/sidebar/my-invites"));
13
13
  const rewards_svg_1 = __importDefault(require("../../public/sidebar/rewards"));
14
+ const referralDashboard_svg_1 = __importDefault(require("../../public/sidebar/referralDashboard"));
14
15
  const submitNft_svg_1 = __importDefault(require("../../public/sidebar/submitNft"));
15
16
  const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
16
17
  const env_1 = require("../../store/env");
@@ -44,6 +45,12 @@ const useSidebarData = () => {
44
45
  icon: (0, jsx_runtime_1.jsx)(rewards_svg_1.default, {}),
45
46
  isExternalUrl: false,
46
47
  },
48
+ {
49
+ href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["account"]}/referrals`,
50
+ title: "Referral Dashboard",
51
+ icon: (0, jsx_runtime_1.jsx)(referralDashboard_svg_1.default, {}),
52
+ isExternalUrl: false,
53
+ },
47
54
  {
48
55
  href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/invite-codes`,
49
56
  title: "My invites",
@@ -81,6 +88,12 @@ const useSidebarData = () => {
81
88
  icon: (0, jsx_runtime_1.jsx)(rewards_svg_1.default, {}),
82
89
  isExternalUrl: false,
83
90
  },
91
+ {
92
+ href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["account"]}/referrals`,
93
+ title: "Referral Dashboard",
94
+ icon: (0, jsx_runtime_1.jsx)(referralDashboard_svg_1.default, {}),
95
+ isExternalUrl: false,
96
+ },
84
97
  {
85
98
  href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/invite-codes`,
86
99
  title: "My invites",
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
10
+ var ReferralDashboardIcon = function ReferralDashboardIcon(props) {
11
+ return /*#__PURE__*/_react["default"].createElement("svg", _extends({}, props, {
12
+ width: "20",
13
+ height: "20",
14
+ viewBox: "0 0 20 20",
15
+ fill: "none",
16
+ xmlns: "http://www.w3.org/2000/svg"
17
+ }), /*#__PURE__*/_react["default"].createElement("rect", {
18
+ x: "2.5",
19
+ y: "2.5",
20
+ width: "6.92308",
21
+ height: "9.23077",
22
+ rx: "1",
23
+ fill: "#B0B2C0"
24
+ }), /*#__PURE__*/_react["default"].createElement("rect", {
25
+ x: "10.5769",
26
+ y: "8.26953",
27
+ width: "6.92308",
28
+ height: "9.23077",
29
+ rx: "1",
30
+ fill: "#B0B2C0"
31
+ }), /*#__PURE__*/_react["default"].createElement("rect", {
32
+ x: "10.5769",
33
+ y: "2.5",
34
+ width: "6.92308",
35
+ height: "4.61539",
36
+ rx: "1",
37
+ fill: "#B0B2C0"
38
+ }), /*#__PURE__*/_react["default"].createElement("rect", {
39
+ x: "2.5",
40
+ y: "12.8843",
41
+ width: "6.92308",
42
+ height: "4.61539",
43
+ rx: "1",
44
+ fill: "#B0B2C0"
45
+ }));
46
+ };
47
+ var _default = exports["default"] = ReferralDashboardIcon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.2.10",
3
+ "version": "2.2.12",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",