@100mslive/roomkit-react 0.3.15-alpha.1 → 0.3.15-alpha.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.
@@ -10943,7 +10943,7 @@
10943
10943
  ],
10944
10944
  "format": "esm"
10945
10945
  },
10946
- "../../../../../../../tmp/tmp-2781-YBKA2awaceXN/1906db139552/tldraw.css": {
10946
+ "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686d5b2/tldraw.css": {
10947
10947
  "bytes": 80111,
10948
10948
  "imports": [
10949
10949
  {
@@ -10993,7 +10993,7 @@
10993
10993
  }
10994
10994
  ]
10995
10995
  },
10996
- "../../../../../../../tmp/tmp-2781-YBKA2awaceXN/1906db138f00/index.css": {
10996
+ "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686ce80/index.css": {
10997
10997
  "bytes": 597,
10998
10998
  "imports": [
10999
10999
  {
@@ -11002,7 +11002,7 @@
11002
11002
  "external": true
11003
11003
  },
11004
11004
  {
11005
- "path": "../../../../../../../tmp/tmp-2781-YBKA2awaceXN/1906db139552/tldraw.css",
11005
+ "path": "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686d5b2/tldraw.css",
11006
11006
  "kind": "import-rule",
11007
11007
  "original": "@tldraw/tldraw/tldraw.css"
11008
11008
  }
@@ -11077,7 +11077,7 @@
11077
11077
  "original": "../../common/constants"
11078
11078
  },
11079
11079
  {
11080
- "path": "../../../../../../../tmp/tmp-2781-YBKA2awaceXN/1906db138f00/index.css",
11080
+ "path": "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686ce80/index.css",
11081
11081
  "kind": "import-statement",
11082
11082
  "original": "@100mslive/hms-whiteboard/index.css"
11083
11083
  },
@@ -14099,8 +14099,8 @@
14099
14099
  ],
14100
14100
  "format": "esm"
14101
14101
  },
14102
- "src/Diagnostics/components.tsx": {
14103
- "bytes": 2773,
14102
+ "src/Diagnostics/DiagnosticsContext.ts": {
14103
+ "bytes": 1230,
14104
14104
  "imports": [
14105
14105
  {
14106
14106
  "path": "react",
@@ -14112,6 +14112,27 @@
14112
14112
  "kind": "import-statement",
14113
14113
  "external": true
14114
14114
  },
14115
+ {
14116
+ "path": "<define:process.env>",
14117
+ "kind": "import-statement",
14118
+ "external": true
14119
+ },
14120
+ {
14121
+ "path": "<runtime>",
14122
+ "kind": "import-statement",
14123
+ "external": true
14124
+ }
14125
+ ],
14126
+ "format": "esm"
14127
+ },
14128
+ "src/Diagnostics/components.tsx": {
14129
+ "bytes": 2075,
14130
+ "imports": [
14131
+ {
14132
+ "path": "react",
14133
+ "kind": "import-statement",
14134
+ "external": true
14135
+ },
14115
14136
  {
14116
14137
  "path": "src/Button/index.tsx",
14117
14138
  "kind": "import-statement",
@@ -14132,6 +14153,11 @@
14132
14153
  "kind": "import-statement",
14133
14154
  "external": true
14134
14155
  },
14156
+ {
14157
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14158
+ "kind": "import-statement",
14159
+ "original": "./DiagnosticsContext"
14160
+ },
14135
14161
  {
14136
14162
  "path": "<define:process.env>",
14137
14163
  "kind": "import-statement",
@@ -14362,7 +14388,7 @@
14362
14388
  "format": "esm"
14363
14389
  },
14364
14390
  "src/Diagnostics/AudioTest.tsx": {
14365
- "bytes": 5958,
14391
+ "bytes": 6167,
14366
14392
  "imports": [
14367
14393
  {
14368
14394
  "path": "react",
@@ -14414,6 +14440,11 @@
14414
14440
  "kind": "import-statement",
14415
14441
  "original": "./DeviceSelector"
14416
14442
  },
14443
+ {
14444
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14445
+ "kind": "import-statement",
14446
+ "original": "./DiagnosticsContext"
14447
+ },
14417
14448
  {
14418
14449
  "path": "src/Prebuilt/components/hooks/useAudioOutputTest.tsx",
14419
14450
  "kind": "import-statement",
@@ -14433,7 +14464,7 @@
14433
14464
  "format": "esm"
14434
14465
  },
14435
14466
  "src/Diagnostics/BrowserTest.tsx": {
14436
- "bytes": 4252,
14467
+ "bytes": 4366,
14437
14468
  "imports": [
14438
14469
  {
14439
14470
  "path": "react",
@@ -14460,6 +14491,11 @@
14460
14491
  "kind": "import-statement",
14461
14492
  "original": "../Text"
14462
14493
  },
14494
+ {
14495
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14496
+ "kind": "import-statement",
14497
+ "original": "./DiagnosticsContext"
14498
+ },
14463
14499
  {
14464
14500
  "path": "<define:process.env>",
14465
14501
  "kind": "import-statement",
@@ -14469,7 +14505,7 @@
14469
14505
  "format": "esm"
14470
14506
  },
14471
14507
  "src/Diagnostics/ConnectivityTest.tsx": {
14472
- "bytes": 11342,
14508
+ "bytes": 12150,
14473
14509
  "imports": [
14474
14510
  {
14475
14511
  "path": "react",
@@ -14516,6 +14552,11 @@
14516
14552
  "kind": "import-statement",
14517
14553
  "original": "../Text"
14518
14554
  },
14555
+ {
14556
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14557
+ "kind": "import-statement",
14558
+ "original": "./DiagnosticsContext"
14559
+ },
14519
14560
  {
14520
14561
  "path": "<define:process.env>",
14521
14562
  "kind": "import-statement",
@@ -14525,7 +14566,7 @@
14525
14566
  "format": "esm"
14526
14567
  },
14527
14568
  "src/Diagnostics/VideoTest.tsx": {
14528
- "bytes": 2591,
14569
+ "bytes": 2718,
14529
14570
  "imports": [
14530
14571
  {
14531
14572
  "path": "react",
@@ -14577,6 +14618,11 @@
14577
14618
  "kind": "import-statement",
14578
14619
  "original": "./DeviceSelector"
14579
14620
  },
14621
+ {
14622
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14623
+ "kind": "import-statement",
14624
+ "original": "./DiagnosticsContext"
14625
+ },
14580
14626
  {
14581
14627
  "path": "<define:process.env>",
14582
14628
  "kind": "import-statement",
@@ -14591,7 +14637,7 @@
14591
14637
  "format": "esm"
14592
14638
  },
14593
14639
  "src/Diagnostics/Diagnostics.tsx": {
14594
- "bytes": 4759,
14640
+ "bytes": 5845,
14595
14641
  "imports": [
14596
14642
  {
14597
14643
  "path": "react",
@@ -14608,11 +14654,6 @@
14608
14654
  "kind": "import-statement",
14609
14655
  "external": true
14610
14656
  },
14611
- {
14612
- "path": "src/Diagnostics/components.tsx",
14613
- "kind": "import-statement",
14614
- "original": "./components"
14615
- },
14616
14657
  {
14617
14658
  "path": "src/Layout/index.tsx",
14618
14659
  "kind": "import-statement",
@@ -14643,6 +14684,11 @@
14643
14684
  "kind": "import-statement",
14644
14685
  "original": "./ConnectivityTest"
14645
14686
  },
14687
+ {
14688
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14689
+ "kind": "import-statement",
14690
+ "original": "./DiagnosticsContext"
14691
+ },
14646
14692
  {
14647
14693
  "path": "src/Diagnostics/VideoTest.tsx",
14648
14694
  "kind": "import-statement",
@@ -14652,6 +14698,11 @@
14652
14698
  "path": "<define:process.env>",
14653
14699
  "kind": "import-statement",
14654
14700
  "external": true
14701
+ },
14702
+ {
14703
+ "path": "<runtime>",
14704
+ "kind": "import-statement",
14705
+ "external": true
14655
14706
  }
14656
14707
  ],
14657
14708
  "format": "esm"
@@ -14899,7 +14950,7 @@
14899
14950
  "dist/index.js": {
14900
14951
  "imports": [
14901
14952
  {
14902
- "path": "dist/chunk-MTS2LMGT.js",
14953
+ "path": "dist/chunk-BVSFQTDX.js",
14903
14954
  "kind": "import-statement"
14904
14955
  }
14905
14956
  ],
@@ -14975,16 +15026,16 @@
14975
15026
  "inputs": {},
14976
15027
  "bytes": 1882
14977
15028
  },
14978
- "dist/HLSView-33JUAQ33.js.map": {
15029
+ "dist/HLSView-B4LXRW3N.js.map": {
14979
15030
  "imports": [],
14980
15031
  "exports": [],
14981
15032
  "inputs": {},
14982
15033
  "bytes": 100275
14983
15034
  },
14984
- "dist/HLSView-33JUAQ33.js": {
15035
+ "dist/HLSView-B4LXRW3N.js": {
14985
15036
  "imports": [
14986
15037
  {
14987
- "path": "dist/chunk-MTS2LMGT.js",
15038
+ "path": "dist/chunk-BVSFQTDX.js",
14988
15039
  "kind": "import-statement"
14989
15040
  },
14990
15041
  {
@@ -15162,7 +15213,7 @@
15162
15213
  "default"
15163
15214
  ],
15164
15215
  "entryPoint": "src/Prebuilt/layouts/HLSView.jsx",
15165
- "cssBundle": "dist/HLSView-KKS3ZEYM.css",
15216
+ "cssBundle": "dist/HLSView-7HFHBF6S.css",
15166
15217
  "inputs": {
15167
15218
  "src/Prebuilt/layouts/HLSView.jsx": {
15168
15219
  "bytesInOutput": 27671
@@ -15221,13 +15272,13 @@
15221
15272
  },
15222
15273
  "bytes": 61702
15223
15274
  },
15224
- "dist/chunk-MTS2LMGT.js.map": {
15275
+ "dist/chunk-BVSFQTDX.js.map": {
15225
15276
  "imports": [],
15226
15277
  "exports": [],
15227
15278
  "inputs": {},
15228
- "bytes": 3438128
15279
+ "bytes": 3442830
15229
15280
  },
15230
- "dist/chunk-MTS2LMGT.js": {
15281
+ "dist/chunk-BVSFQTDX.js": {
15231
15282
  "imports": [
15232
15283
  {
15233
15284
  "path": "react",
@@ -17700,7 +17751,7 @@
17700
17751
  "external": true
17701
17752
  },
17702
17753
  {
17703
- "path": "dist/HLSView-33JUAQ33.js",
17754
+ "path": "dist/HLSView-B4LXRW3N.js",
17704
17755
  "kind": "dynamic-import"
17705
17756
  },
17706
17757
  {
@@ -18129,17 +18180,22 @@
18129
18180
  "external": true
18130
18181
  },
18131
18182
  {
18132
- "path": "react",
18183
+ "path": "@100mslive/react-sdk",
18133
18184
  "kind": "import-statement",
18134
18185
  "external": true
18135
18186
  },
18136
18187
  {
18137
- "path": "@100mslive/react-sdk",
18188
+ "path": "@100mslive/react-icons",
18138
18189
  "kind": "import-statement",
18139
18190
  "external": true
18140
18191
  },
18141
18192
  {
18142
- "path": "@100mslive/react-icons",
18193
+ "path": "react",
18194
+ "kind": "import-statement",
18195
+ "external": true
18196
+ },
18197
+ {
18198
+ "path": "react",
18143
18199
  "kind": "import-statement",
18144
18200
  "external": true
18145
18201
  },
@@ -18284,7 +18340,7 @@
18284
18340
  ],
18285
18341
  "inputs": {
18286
18342
  "<define:process.env>": {
18287
- "bytesInOutput": 17911
18343
+ "bytesInOutput": 17931
18288
18344
  },
18289
18345
  "../../node_modules/lodash/lodash.js": {
18290
18346
  "bytesInOutput": 224289
@@ -19153,7 +19209,7 @@
19153
19209
  "src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx": {
19154
19210
  "bytesInOutput": 2830
19155
19211
  },
19156
- "../../../../../../../tmp/tmp-2781-YBKA2awaceXN/1906db138f00/index.css": {
19212
+ "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686ce80/index.css": {
19157
19213
  "bytesInOutput": 0
19158
19214
  },
19159
19215
  "src/Prebuilt/common/PeersSorter.ts": {
@@ -19298,28 +19354,31 @@
19298
19354
  "bytesInOutput": 27
19299
19355
  },
19300
19356
  "src/Diagnostics/Diagnostics.tsx": {
19301
- "bytesInOutput": 5206
19357
+ "bytesInOutput": 6183
19358
+ },
19359
+ "src/Diagnostics/AudioTest.tsx": {
19360
+ "bytesInOutput": 6444
19302
19361
  },
19303
19362
  "src/Diagnostics/components.tsx": {
19304
- "bytesInOutput": 2493
19363
+ "bytesInOutput": 2027
19305
19364
  },
19306
- "src/Diagnostics/AudioTest.tsx": {
19307
- "bytesInOutput": 6270
19365
+ "src/Diagnostics/DiagnosticsContext.ts": {
19366
+ "bytesInOutput": 1076
19308
19367
  },
19309
19368
  "src/Diagnostics/DeviceSelector.jsx": {
19310
19369
  "bytesInOutput": 2155
19311
19370
  },
19312
19371
  "src/Diagnostics/BrowserTest.tsx": {
19313
- "bytesInOutput": 4380
19372
+ "bytesInOutput": 4418
19314
19373
  },
19315
19374
  "src/Diagnostics/ConnectivityTest.tsx": {
19316
- "bytesInOutput": 12703
19375
+ "bytesInOutput": 13570
19317
19376
  },
19318
19377
  "src/Diagnostics/VideoTest.tsx": {
19319
- "bytesInOutput": 2577
19378
+ "bytesInOutput": 2628
19320
19379
  }
19321
19380
  },
19322
- "bytes": 1422949
19381
+ "bytes": 1425763
19323
19382
  },
19324
19383
  "dist/index.css.map": {
19325
19384
  "imports": [],
@@ -19381,22 +19440,22 @@
19381
19440
  }
19382
19441
  ],
19383
19442
  "inputs": {
19384
- "../../../../../../../tmp/tmp-2781-YBKA2awaceXN/1906db139552/tldraw.css": {
19443
+ "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686d5b2/tldraw.css": {
19385
19444
  "bytesInOutput": 75223
19386
19445
  },
19387
- "../../../../../../../tmp/tmp-2781-YBKA2awaceXN/1906db138f00/index.css": {
19446
+ "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686ce80/index.css": {
19388
19447
  "bytesInOutput": 401
19389
19448
  }
19390
19449
  },
19391
19450
  "bytes": 75901
19392
19451
  },
19393
- "dist/HLSView-KKS3ZEYM.css.map": {
19452
+ "dist/HLSView-7HFHBF6S.css.map": {
19394
19453
  "imports": [],
19395
19454
  "exports": [],
19396
19455
  "inputs": {},
19397
19456
  "bytes": 122402
19398
19457
  },
19399
- "dist/HLSView-KKS3ZEYM.css": {
19458
+ "dist/HLSView-7HFHBF6S.css": {
19400
19459
  "imports": [
19401
19460
  {
19402
19461
  "path": "https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap",
@@ -19450,10 +19509,10 @@
19450
19509
  }
19451
19510
  ],
19452
19511
  "inputs": {
19453
- "../../../../../../../tmp/tmp-2781-YBKA2awaceXN/1906db139552/tldraw.css": {
19512
+ "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686d5b2/tldraw.css": {
19454
19513
  "bytesInOutput": 75223
19455
19514
  },
19456
- "../../../../../../../tmp/tmp-2781-YBKA2awaceXN/1906db138f00/index.css": {
19515
+ "../../../../../../../tmp/tmp-2795-Q1b2Apl72oYu/19073686ce80/index.css": {
19457
19516
  "bytesInOutput": 401
19458
19517
  }
19459
19518
  },
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.3.15-alpha.1",
13
+ "version": "0.3.15-alpha.3",
14
14
  "author": "100ms",
15
15
  "license": "MIT",
16
16
  "repository": {
@@ -75,12 +75,12 @@
75
75
  "react": ">=17.0.2 <19.0.0"
76
76
  },
77
77
  "dependencies": {
78
- "@100mslive/hls-player": "0.3.15-alpha.1",
78
+ "@100mslive/hls-player": "0.3.15-alpha.3",
79
79
  "@100mslive/hms-noise-cancellation": "0.0.1",
80
- "@100mslive/hms-virtual-background": "1.13.15-alpha.1",
81
- "@100mslive/hms-whiteboard": "0.0.5-alpha.1",
82
- "@100mslive/react-icons": "0.10.15-alpha.1",
83
- "@100mslive/react-sdk": "0.10.15-alpha.1",
80
+ "@100mslive/hms-virtual-background": "1.13.15-alpha.3",
81
+ "@100mslive/hms-whiteboard": "0.0.5-alpha.3",
82
+ "@100mslive/react-icons": "0.10.15-alpha.3",
83
+ "@100mslive/react-sdk": "0.10.15-alpha.3",
84
84
  "@100mslive/types-prebuilt": "0.12.9",
85
85
  "@emoji-mart/data": "^1.0.6",
86
86
  "@emoji-mart/react": "^1.0.1",
@@ -116,5 +116,5 @@
116
116
  "uuid": "^8.3.2",
117
117
  "worker-timers": "^7.0.40"
118
118
  },
119
- "gitHead": "d841ae70e97bfd176bcfc86b44f6ad939832fe13"
119
+ "gitHead": "810df7bc6d978b45e2c3052343692e982bad600a"
120
120
  }
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable react/prop-types */
2
- import React, { useContext, useEffect, useState } from 'react';
2
+ import React, { useCallback, useEffect, useState } from 'react';
3
3
  import {
4
4
  HMSException,
5
5
  selectDevices,
@@ -11,13 +11,14 @@ import {
11
11
  } from '@100mslive/react-sdk';
12
12
  import { MicOnIcon, SpeakerIcon, StopIcon } from '@100mslive/react-icons';
13
13
  import { PermissionErrorModal } from '../Prebuilt/components/Notifications/PermissionErrorModal';
14
- import { DiagnosticsContext, TestContainer, TestFooter } from './components';
14
+ import { TestContainer, TestFooter } from './components';
15
15
  import { Button } from '../Button';
16
16
  import { Box, Flex } from '../Layout';
17
17
  import { Progress } from '../Progress';
18
18
  import { Text } from '../Text';
19
19
  // @ts-ignore: No implicit any
20
20
  import { DeviceSelector } from './DeviceSelector';
21
+ import { DiagnosticsStep, useDiagnostics } from './DiagnosticsContext';
21
22
  import { useAudioOutputTest } from '../Prebuilt/components/hooks/useAudioOutputTest';
22
23
  import { TEST_AUDIO_URL } from '../Prebuilt/common/constants';
23
24
 
@@ -25,8 +26,8 @@ const SelectContainer = ({ children }: { children: React.ReactNode }) => (
25
26
  <Box css={{ w: 'calc(50% - 0.75rem)', '@lg': { w: '100%' } }}>{children}</Box>
26
27
  );
27
28
 
28
- const MicTest = ({ setError }: { setError: React.Dispatch<React.SetStateAction<Error | undefined>> }) => {
29
- const { hmsDiagnostics } = useContext(DiagnosticsContext);
29
+ const MicTest = ({ setError }: { setError: (err?: Error) => void }) => {
30
+ const { hmsDiagnostics } = useDiagnostics();
30
31
  const devices = useHMSStore(selectDevices);
31
32
  const [isRecording, setIsRecording] = useState(false);
32
33
  const [selectedMic, setSelectedMic] = useState(devices.audioInput[0]?.deviceId || 'default');
@@ -142,11 +143,20 @@ const SpeakerTest = () => {
142
143
  };
143
144
 
144
145
  export const AudioTest = () => {
145
- const { hmsDiagnostics } = useContext(DiagnosticsContext);
146
- const [error, setError] = useState<Error | undefined>();
146
+ const { hmsDiagnostics, updateStep } = useDiagnostics();
147
+ const [error, setErrorAlone] = useState<Error | undefined>();
148
+
149
+ const setError = useCallback(
150
+ (err?: Error) => {
151
+ updateStep(DiagnosticsStep.AUDIO, { hasFailed: !!err });
152
+ setErrorAlone(err);
153
+ },
154
+ [updateStep, setErrorAlone],
155
+ );
156
+
147
157
  useEffect(() => {
148
158
  hmsDiagnostics?.requestPermission({ audio: true }).catch(error => setError(error));
149
- }, [hmsDiagnostics]);
159
+ }, [hmsDiagnostics, setError]);
150
160
 
151
161
  return (
152
162
  <>
@@ -1,8 +1,9 @@
1
- import React, { useContext, useEffect, useState } from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
  import { parsedUserAgent } from '@100mslive/react-sdk';
3
- import { DiagnosticsContext, TestContainer, TestFooter } from './components';
3
+ import { TestContainer, TestFooter } from './components';
4
4
  import { Box, Flex } from '../Layout';
5
5
  import { Text } from '../Text';
6
+ import { DiagnosticsStep, useDiagnostics } from './DiagnosticsContext';
6
7
 
7
8
  const CMS_MEDIA_SERVER = 'https://storage.googleapis.com/100ms-cms-prod/';
8
9
 
@@ -102,15 +103,16 @@ const CheckDetails = ({ title, value, iconURL }: { title: string; value: string;
102
103
  );
103
104
 
104
105
  export const BrowserTest = () => {
105
- const { hmsDiagnostics } = useContext(DiagnosticsContext);
106
+ const { hmsDiagnostics, updateStep } = useDiagnostics();
106
107
  const [error, setError] = useState<Error | undefined>();
107
108
  useEffect(() => {
108
109
  try {
109
110
  hmsDiagnostics?.checkBrowserSupport();
110
111
  } catch (err) {
112
+ updateStep(DiagnosticsStep.BROWSER, { hasFailed: true });
111
113
  setError(err as Error);
112
114
  }
113
- }, [hmsDiagnostics]);
115
+ }, [hmsDiagnostics, updateStep]);
114
116
  return (
115
117
  <>
116
118
  <TestContainer css={{ display: 'flex', gap: '$8', '@lg': { display: 'block' } }}>
@@ -1,12 +1,13 @@
1
- import React, { useContext, useState } from 'react';
1
+ import React, { useState } from 'react';
2
2
  import { ConnectivityCheckResult, ConnectivityState, DiagnosticsRTCStats } from '@100mslive/react-sdk';
3
- import { CheckCircleIcon, CrossCircleIcon, LinkIcon } from '@100mslive/react-icons';
4
- import { DiagnosticsContext, TestContainer, TestFooter } from './components';
3
+ import { CheckCircleIcon, CrossCircleIcon, EyeCloseIcon, EyeOpenIcon, LinkIcon } from '@100mslive/react-icons';
4
+ import { TestContainer, TestFooter } from './components';
5
5
  import { Button } from '../Button';
6
6
  import { Box, Flex } from '../Layout';
7
7
  import { Loading } from '../Loading';
8
8
  import { formatBytes } from '../Stats';
9
9
  import { Text } from '../Text';
10
+ import { DiagnosticsStep, useDiagnostics } from './DiagnosticsContext';
10
11
 
11
12
  const Regions = {
12
13
  in: 'India',
@@ -26,13 +27,17 @@ const ConnectivityStateMessage = {
26
27
 
27
28
  export const ConnectivityTestStepResult = ({
28
29
  title,
30
+ status = 'Connected',
29
31
  success,
30
32
  children,
31
33
  }: {
32
34
  title: string;
35
+ status?: string;
33
36
  success?: boolean;
34
37
  children: React.ReactNode;
35
38
  }) => {
39
+ const [hideDetails, setHideDetails] = useState(true);
40
+
36
41
  return (
37
42
  <Box css={{ my: '$10', p: '$10', r: '$1', bg: '$surface_bright' }}>
38
43
  <Text css={{ c: '$on_primary_medium', mb: '$6' }}>{title}</Text>
@@ -42,7 +47,7 @@ export const ConnectivityTestStepResult = ({
42
47
  <CheckCircleIcon width="1.5rem" height="1.5rem" />
43
48
  </Text>
44
49
  <Text variant="lg" css={{ ml: '$4' }}>
45
- Connected
50
+ {status}
46
51
  </Text>
47
52
  </Flex>
48
53
  ) : (
@@ -55,7 +60,25 @@ export const ConnectivityTestStepResult = ({
55
60
  </Text>
56
61
  </Flex>
57
62
  )}
58
- <Box>{children}</Box>
63
+ <Flex
64
+ onClick={() => setHideDetails(!hideDetails)}
65
+ align="center"
66
+ gap="2"
67
+ css={{
68
+ color: '$primary_bright',
69
+ }}
70
+ >
71
+ {hideDetails ? <EyeOpenIcon /> : <EyeCloseIcon />}
72
+ <Text
73
+ variant="caption"
74
+ css={{
75
+ color: '$primary_bright',
76
+ }}
77
+ >
78
+ {hideDetails ? 'View' : 'Hide'} detailed information
79
+ </Text>
80
+ </Flex>
81
+ {!hideDetails ? <Box>{children}</Box> : null}
59
82
  </Box>
60
83
  );
61
84
  };
@@ -131,7 +154,7 @@ const SignallingResult = ({ result }: { result?: ConnectivityCheckResult['signal
131
154
 
132
155
  const AudioStats = ({ stats }: { stats: DiagnosticsRTCStats | undefined }) => {
133
156
  return (
134
- <ConnectivityTestStepResult title="Audio" success={!!stats?.bytesSent}>
157
+ <ConnectivityTestStepResult title="Audio" status="Received" success={!!stats?.bytesSent}>
135
158
  {stats && (
136
159
  <Flex css={{ flexWrap: 'wrap' }}>
137
160
  <DetailedInfo title="Bytes Sent" value={formatBytes(stats.bytesSent)} />
@@ -149,7 +172,7 @@ const AudioStats = ({ stats }: { stats: DiagnosticsRTCStats | undefined }) => {
149
172
 
150
173
  const VideoStats = ({ stats }: { stats: DiagnosticsRTCStats | undefined }) => {
151
174
  return (
152
- <ConnectivityTestStepResult title="Video" success={!!stats?.bytesSent}>
175
+ <ConnectivityTestStepResult title="Video" status="Received" success={!!stats?.bytesSent}>
153
176
  {stats && (
154
177
  <Flex css={{ flexWrap: 'wrap' }}>
155
178
  <DetailedInfo title="Bytes Sent" value={formatBytes(stats.bytesSent)} />
@@ -309,14 +332,14 @@ const RegionSelector = ({
309
332
  };
310
333
 
311
334
  export const ConnectivityTest = () => {
312
- const { hmsDiagnostics, setConnectivityTested } = useContext(DiagnosticsContext);
335
+ const { hmsDiagnostics, updateStep } = useDiagnostics();
313
336
  const [region, setRegion] = useState<string | undefined>(Object.keys(Regions)[0]);
314
337
  const [error, setError] = useState<Error | undefined>();
315
338
  const [progress, setProgress] = useState<ConnectivityState>();
316
339
  const [result, setResult] = useState<ConnectivityCheckResult | undefined>();
317
340
 
318
341
  const startTest = () => {
319
- setConnectivityTested(false);
342
+ updateStep(DiagnosticsStep.CONNECTIVITY, { hasFailed: false, isCompleted: false });
320
343
  setError(undefined);
321
344
  setResult(undefined);
322
345
  hmsDiagnostics
@@ -325,12 +348,13 @@ export const ConnectivityTest = () => {
325
348
  setProgress(state);
326
349
  },
327
350
  result => {
328
- setConnectivityTested(true);
351
+ updateStep(DiagnosticsStep.CONNECTIVITY, { isCompleted: true });
329
352
  setResult(result);
330
353
  },
331
354
  region,
332
355
  )
333
356
  .catch(error => {
357
+ updateStep(DiagnosticsStep.CONNECTIVITY, { hasFailed: true });
334
358
  setError(error);
335
359
  });
336
360
  };