@100mslive/roomkit-react 0.2.6-alpha.0 → 0.2.6-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  theme,
63
63
  useBorderAudioLevel,
64
64
  useTheme
65
- } from "./chunk-54M5AZBC.js";
65
+ } from "./chunk-6ELWJ7YI.js";
66
66
  export {
67
67
  Accordion,
68
68
  AudioLevel,
@@ -6272,7 +6272,7 @@
6272
6272
  "format": "esm"
6273
6273
  },
6274
6274
  "src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx": {
6275
- "bytes": 7747,
6275
+ "bytes": 8071,
6276
6276
  "imports": [
6277
6277
  {
6278
6278
  "path": "react",
@@ -12775,7 +12775,7 @@
12775
12775
  "imports": [],
12776
12776
  "exports": [],
12777
12777
  "inputs": {},
12778
- "bytes": 3165834
12778
+ "bytes": 3166569
12779
12779
  },
12780
12780
  "dist/index.cjs.js": {
12781
12781
  "imports": [
@@ -15479,7 +15479,7 @@
15479
15479
  "entryPoint": "src/index.ts",
15480
15480
  "inputs": {
15481
15481
  "<define:process.env>": {
15482
- "bytesInOutput": 18089
15482
+ "bytesInOutput": 18122
15483
15483
  },
15484
15484
  "src/Theme/base.config.ts": {
15485
15485
  "bytesInOutput": 6104
@@ -16070,7 +16070,7 @@
16070
16070
  "bytesInOutput": 1165
16071
16071
  },
16072
16072
  "src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx": {
16073
- "bytesInOutput": 9104
16073
+ "bytesInOutput": 9572
16074
16074
  },
16075
16075
  "src/Prebuilt/components/Polls/CreateQuestions/DeleteQuestionModal.tsx": {
16076
16076
  "bytesInOutput": 2786
@@ -16487,7 +16487,7 @@
16487
16487
  "bytesInOutput": 2980
16488
16488
  }
16489
16489
  },
16490
- "bytes": 1487624
16490
+ "bytes": 1488125
16491
16491
  }
16492
16492
  }
16493
16493
  }
@@ -6272,7 +6272,7 @@
6272
6272
  "format": "esm"
6273
6273
  },
6274
6274
  "src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx": {
6275
- "bytes": 7747,
6275
+ "bytes": 8071,
6276
6276
  "imports": [
6277
6277
  {
6278
6278
  "path": "react",
@@ -12780,7 +12780,7 @@
12780
12780
  "dist/index.js": {
12781
12781
  "imports": [
12782
12782
  {
12783
- "path": "dist/chunk-54M5AZBC.js",
12783
+ "path": "dist/chunk-6ELWJ7YI.js",
12784
12784
  "kind": "import-statement"
12785
12785
  }
12786
12786
  ],
@@ -12853,16 +12853,16 @@
12853
12853
  "inputs": {},
12854
12854
  "bytes": 1822
12855
12855
  },
12856
- "dist/HLSView-3P77BW5S.js.map": {
12856
+ "dist/HLSView-Z7XVENMR.js.map": {
12857
12857
  "imports": [],
12858
12858
  "exports": [],
12859
12859
  "inputs": {},
12860
12860
  "bytes": 59786
12861
12861
  },
12862
- "dist/HLSView-3P77BW5S.js": {
12862
+ "dist/HLSView-Z7XVENMR.js": {
12863
12863
  "imports": [
12864
12864
  {
12865
- "path": "dist/chunk-54M5AZBC.js",
12865
+ "path": "dist/chunk-6ELWJ7YI.js",
12866
12866
  "kind": "import-statement"
12867
12867
  },
12868
12868
  {
@@ -13026,13 +13026,13 @@
13026
13026
  },
13027
13027
  "bytes": 37440
13028
13028
  },
13029
- "dist/chunk-54M5AZBC.js.map": {
13029
+ "dist/chunk-6ELWJ7YI.js.map": {
13030
13030
  "imports": [],
13031
13031
  "exports": [],
13032
13032
  "inputs": {},
13033
- "bytes": 3101864
13033
+ "bytes": 3102547
13034
13034
  },
13035
- "dist/chunk-54M5AZBC.js": {
13035
+ "dist/chunk-6ELWJ7YI.js": {
13036
13036
  "imports": [
13037
13037
  {
13038
13038
  "path": "react",
@@ -15280,7 +15280,7 @@
15280
15280
  "external": true
15281
15281
  },
15282
15282
  {
15283
- "path": "dist/HLSView-3P77BW5S.js",
15283
+ "path": "dist/HLSView-Z7XVENMR.js",
15284
15284
  "kind": "dynamic-import"
15285
15285
  },
15286
15286
  {
@@ -15702,7 +15702,7 @@
15702
15702
  ],
15703
15703
  "inputs": {
15704
15704
  "<define:process.env>": {
15705
- "bytesInOutput": 18089
15705
+ "bytesInOutput": 18122
15706
15706
  },
15707
15707
  "../../node_modules/lodash/lodash.js": {
15708
15708
  "bytesInOutput": 224267
@@ -16272,7 +16272,7 @@
16272
16272
  "bytesInOutput": 735
16273
16273
  },
16274
16274
  "src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx": {
16275
- "bytesInOutput": 7536
16275
+ "bytesInOutput": 7983
16276
16276
  },
16277
16277
  "src/Prebuilt/components/Streaming/Common.jsx": {
16278
16278
  "bytesInOutput": 2247
@@ -16629,7 +16629,7 @@
16629
16629
  "bytesInOutput": 651
16630
16630
  }
16631
16631
  },
16632
- "bytes": 1265247
16632
+ "bytes": 1265727
16633
16633
  }
16634
16634
  }
16635
16635
  }
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.2.6-alpha.0",
13
+ "version": "0.2.6-alpha.1",
14
14
  "author": "100ms",
15
15
  "license": "MIT",
16
16
  "repository": {
@@ -82,10 +82,10 @@
82
82
  "react": ">=17.0.2 <19.0.0"
83
83
  },
84
84
  "dependencies": {
85
- "@100mslive/hls-player": "0.2.6-alpha.0",
86
- "@100mslive/hms-virtual-background": "1.12.6-alpha.0",
87
- "@100mslive/react-icons": "0.9.6-alpha.0",
88
- "@100mslive/react-sdk": "0.9.6-alpha.0",
85
+ "@100mslive/hls-player": "0.2.6-alpha.1",
86
+ "@100mslive/hms-virtual-background": "1.12.6-alpha.1",
87
+ "@100mslive/react-icons": "0.9.6-alpha.1",
88
+ "@100mslive/react-sdk": "0.9.6-alpha.1",
89
89
  "@100mslive/types-prebuilt": "0.12.6",
90
90
  "@emoji-mart/data": "^1.0.6",
91
91
  "@emoji-mart/react": "^1.0.1",
@@ -120,5 +120,5 @@
120
120
  "uuid": "^8.3.2",
121
121
  "worker-timers": "^7.0.40"
122
122
  },
123
- "gitHead": "ad5e1f4190299572b1b91c1951bb5d14788efac8"
123
+ "gitHead": "d85daadafe177c535fb1203a0e377042b5502a3e"
124
124
  }
@@ -1,9 +1,9 @@
1
1
  import React, { useEffect, useMemo, useRef, useState } from 'react';
2
2
  import {
3
+ HMSPoll,
3
4
  HMSPollState,
4
5
  selectLocalPeerRoleName,
5
6
  selectPermissions,
6
- selectPolls,
7
7
  useHMSActions,
8
8
  useHMSStore,
9
9
  } from '@100mslive/react-sdk';
@@ -133,7 +133,7 @@ const AddMenu = () => {
133
133
  active={interactionType === INTERACTION_TYPE.QUIZ}
134
134
  />
135
135
  </Flex>
136
- <Flex direction="column" css={{ mb: '$10' }}>
136
+ <Flex direction="column">
137
137
  <Text variant="body2" css={{ mb: '$4' }}>{`Name this ${interactionType.toLowerCase()}`}</Text>
138
138
  <Input
139
139
  ref={inputRef}
@@ -194,12 +194,20 @@ const AddMenu = () => {
194
194
 
195
195
  const PrevMenu = () => {
196
196
  const hmsActions = useHMSActions();
197
- const polls = useHMSStore(selectPolls);
198
- const permissions = useHMSStore(selectPermissions);
197
+ const [polls, setPolls] = useState<HMSPoll[]>([]);
199
198
 
200
199
  useEffect(() => {
200
+ const listPolls = async () => {
201
+ const polls = await hmsActions.interactivityCenter.getPolls();
202
+ const sortedPolls = await polls
203
+ ?.sort((a, b) => (b.createdAt?.getTime() || 0) - (a.createdAt?.getTime() || 0))
204
+ ?.sort((a, b) => (b.state === 'started' ? 1 : 0) - (a.state === 'started' ? 1 : 0));
205
+ return sortedPolls;
206
+ };
207
+
201
208
  const updatePolls = async () => {
202
- await hmsActions.interactivityCenter.getPolls();
209
+ const sortedPolls = await listPolls();
210
+ setPolls(sortedPolls);
203
211
  };
204
212
 
205
213
  updatePolls();
@@ -207,19 +215,21 @@ const PrevMenu = () => {
207
215
 
208
216
  return polls?.length ? (
209
217
  <Flex
210
- direction="column"
211
218
  css={{
212
- width: '100%',
213
- ...(permissions?.pollWrite ? { borderTop: '$space$px solid $border_bright', paddingTop: '$10' } : {}),
219
+ borderTop: '$space$px solid $border_bright',
220
+ mt: '$10',
221
+ pt: '$10',
214
222
  }}
215
223
  >
216
- <Text variant="h6" css={{ c: '$on_surface_high' }}>
217
- Previous Polls and Quizzes
218
- </Text>
219
- <Flex direction="column" css={{ gap: '$10', mt: '$8' }}>
220
- {polls?.map(poll => (
221
- <InteractionCard key={poll.id} id={poll.id} title={poll.title} status={poll.state} />
222
- ))}
224
+ <Flex direction="column" css={{ w: '100%' }}>
225
+ <Text variant="h6" css={{ c: '$on_surface_high' }}>
226
+ Previous Polls and Quizzes
227
+ </Text>
228
+ <Flex direction="column" css={{ gap: '$10', mt: '$8' }}>
229
+ {polls?.map(poll => (
230
+ <InteractionCard key={poll.id} id={poll.id} title={poll.title} status={poll.state} />
231
+ ))}
232
+ </Flex>
223
233
  </Flex>
224
234
  </Flex>
225
235
  ) : null;