@streamlayer/react-ui 0.65.1 → 0.65.3

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,5 +1,5 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { useStore as t } from "@nanostores/react";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useStore as o } from "@nanostores/react";
3
3
  import { LeaderboardList as p } from "../../../gamification/leaderboard/index.js";
4
4
  import { Friends as m } from "./Friends.js";
5
5
  import "react-virtualized-auto-sizer";
@@ -13,17 +13,18 @@ import "../../../icons/index.js";
13
13
  import "react";
14
14
  import "../../../gamification/onboarding/slides/onboarding-invite-card/index.js";
15
15
  import "../../../gamification/onboarding/slides/onboarding-invite-card/styles.js";
16
- const j = ({ gamification: r }) => {
17
- const { data: e } = t(r.leaderboardList.$store);
18
- return e != null && e.length ? /* @__PURE__ */ o(m, { deepLink: r.deepLink }) : /* @__PURE__ */ o(
16
+ const M = ({ gamification: r }) => {
17
+ const { data: e } = o(r.leaderboardList.$store);
18
+ return e != null && e.length ? /* @__PURE__ */ t(
19
19
  p,
20
20
  {
21
21
  fetchMore: r.leaderboardList.fetchMore,
22
22
  items: e,
23
- openItemDetail: r.openUser
23
+ openItemDetail: r.openUser,
24
+ currentUserId: r.currentUserId.get()
24
25
  }
25
- );
26
+ ) : /* @__PURE__ */ t(m, { deepLink: r.deepLink });
26
27
  };
27
28
  export {
28
- j as Leaderboard
29
+ M as Leaderboard
29
30
  };
@@ -2,6 +2,7 @@
2
2
  import { LeaderboardItemProps } from '../../gamification/leaderboard/list-item';
3
3
  type LeaderboardListProps = {
4
4
  items: Omit<LeaderboardItemProps, 'openItemDetail'>[];
5
+ currentUserId?: string;
5
6
  openItemDetail: (id: string) => void;
6
7
  fetchMore: () => void;
7
8
  };
@@ -1,34 +1,40 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import l from "react-virtualized-auto-sizer";
2
+ import u from "react-virtualized-auto-sizer";
3
3
  import { FixedSizeList as h } from "react-window";
4
- import u from "react-window-infinite-loader";
5
- import { LeaderboardItem as I } from "./list-item/index.js";
4
+ import I from "react-window-infinite-loader";
5
+ import { LeaderboardItem as f } from "./list-item/index.js";
6
6
  import "../../../utils/common.js";
7
7
  import "./list-item/styles.js";
8
8
  import "@linaria/react";
9
9
  import "../../icons/index.js";
10
10
  import "react";
11
- const j = ({ items: r, openItemDetail: i, fetchMore: m }) => /* @__PURE__ */ t(l, { children: ({ width: d, height: n }) => /* @__PURE__ */ t(
12
- u,
11
+ const y = ({
12
+ items: r,
13
+ currentUserId: i,
14
+ openItemDetail: m,
15
+ fetchMore: p
16
+ }) => /* @__PURE__ */ t(u, { children: ({ width: d, height: n }) => /* @__PURE__ */ t(
17
+ I,
13
18
  {
14
19
  isItemLoaded: (e) => e < r.length,
15
20
  itemCount: r.length + 1,
16
- loadMoreItems: m,
17
- children: ({ onItemsRendered: e, ref: p }) => /* @__PURE__ */ t(
21
+ loadMoreItems: p,
22
+ children: ({ onItemsRendered: e, ref: a }) => /* @__PURE__ */ t(
18
23
  h,
19
24
  {
20
25
  itemSize: 56,
21
26
  onItemsRendered: e,
22
- ref: p,
27
+ ref: a,
23
28
  itemCount: r.length,
24
29
  width: d,
25
30
  height: n,
26
- children: ({ index: o, style: a }) => /* @__PURE__ */ t(
27
- I,
31
+ children: ({ index: o, style: l }) => /* @__PURE__ */ t(
32
+ f,
28
33
  {
29
- style: { ...a, maxHeight: 48 },
34
+ style: { ...l, maxHeight: 48 },
30
35
  ...r[o],
31
- openItemDetail: () => i(r[o].userId)
36
+ openItemDetail: () => m(r[o].userId),
37
+ isCurrentUser: !!i && i === r[o].userId
32
38
  },
33
39
  r[o].userId
34
40
  )
@@ -37,5 +43,5 @@ const j = ({ items: r, openItemDetail: i, fetchMore: m }) => /* @__PURE__ */ t(l
37
43
  }
38
44
  ) });
39
45
  export {
40
- j as LeaderboardList
46
+ y as LeaderboardList
41
47
  };
@@ -2,7 +2,7 @@
2
2
  import type { LeaderboardItem as ILeaderboardItem } from '@streamlayer/sdk-web-types';
3
3
  export type LeaderboardItemProps = Partial<ILeaderboardItem> & {
4
4
  userId: string;
5
- isCurrentUser: boolean;
5
+ isCurrentUser?: boolean;
6
6
  openItemDetail: () => void;
7
7
  style?: React.CSSProperties;
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.65.1",
3
+ "version": "0.65.3",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -36,12 +36,12 @@
36
36
  "react-window": "^1.8.9",
37
37
  "@lottiefiles/react-lottie-player": "*",
38
38
  "react-window-infinite-loader": "^1.0.9",
39
- "@streamlayer/feature-gamification": "^0.26.0",
40
- "@streamlayer/sdk-web": "^0.28.22",
41
- "@streamlayer/sdk-web-anonymous-auth": "^0.11.17",
39
+ "@streamlayer/feature-gamification": "^0.26.1",
40
+ "@streamlayer/sdk-web": "^0.28.23",
41
+ "@streamlayer/sdk-web-anonymous-auth": "^0.11.18",
42
42
  "@streamlayer/sdk-web-api": "^0.0.1",
43
43
  "@streamlayer/sdk-web-core": "^0.17.8",
44
- "@streamlayer/sdk-web-features": "^0.10.25",
44
+ "@streamlayer/sdk-web-features": "^0.10.26",
45
45
  "@streamlayer/sdk-web-interfaces": "^0.18.15",
46
46
  "@streamlayer/sdk-web-notifications": "^0.13.0",
47
47
  "@streamlayer/sdk-web-storage": "^0.0.4",
@@ -84,6 +84,6 @@
84
84
  "vite-plugin-svgr": "^4.1.0",
85
85
  "vite-svg-loader": "^4.0.0",
86
86
  "vite-tsconfig-paths": "^4.2.1",
87
- "@streamlayer/react": "^0.29.8"
87
+ "@streamlayer/react": "^0.29.10"
88
88
  }
89
89
  }