@dxos/react-ui 0.1.31 → 0.1.32-next.77d513e

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.
Files changed (70) hide show
  1. package/dist/lib/browser/index.mjs +1035 -876
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/types/src/components/IdentityList/SpaceMemberListContainer.d.ts.map +1 -1
  5. package/dist/types/src/composites/DevicesDialog/DevicesDialog.d.ts.map +1 -1
  6. package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts.map +1 -1
  7. package/dist/types/src/composites/JoinDialog/JoinDialog.stories.d.ts.map +1 -1
  8. package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts.map +1 -1
  9. package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
  10. package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts +2 -2
  11. package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts.map +1 -1
  12. package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts +1 -1
  13. package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts.map +1 -1
  14. package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +1 -1
  15. package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts.map +1 -1
  16. package/dist/types/src/panels/JoinPanel/joinMachine.d.ts +64 -0
  17. package/dist/types/src/panels/JoinPanel/joinMachine.d.ts.map +1 -0
  18. package/dist/types/src/panels/JoinPanel/view-states/AdditionMethodSelector.d.ts +2 -5
  19. package/dist/types/src/panels/JoinPanel/view-states/AdditionMethodSelector.d.ts.map +1 -1
  20. package/dist/types/src/panels/JoinPanel/view-states/InvitationAccepted.d.ts +1 -1
  21. package/dist/types/src/panels/JoinPanel/view-states/InvitationAccepted.d.ts.map +1 -1
  22. package/dist/types/src/panels/JoinPanel/view-states/InvitationAuthenticator.d.ts +2 -2
  23. package/dist/types/src/panels/JoinPanel/view-states/InvitationAuthenticator.d.ts.map +1 -1
  24. package/dist/types/src/panels/JoinPanel/view-states/InvitationInput.d.ts +2 -2
  25. package/dist/types/src/panels/JoinPanel/view-states/InvitationInput.d.ts.map +1 -1
  26. package/dist/types/src/panels/JoinPanel/view-states/InvitationRescuer.d.ts +2 -2
  27. package/dist/types/src/panels/JoinPanel/view-states/InvitationRescuer.d.ts.map +1 -1
  28. package/dist/types/src/panels/JoinPanel/view-states/ViewState.d.ts +4 -6
  29. package/dist/types/src/panels/JoinPanel/view-states/ViewState.d.ts.map +1 -1
  30. package/dist/types/src/panels/JoinPanel/view-states/index.d.ts +0 -1
  31. package/dist/types/src/panels/JoinPanel/view-states/index.d.ts.map +1 -1
  32. package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -1
  33. package/dist/types/src/translations/locales/en-US.d.ts +3 -1
  34. package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
  35. package/dist/types/src/util/index.d.ts +1 -0
  36. package/dist/types/src/util/index.d.ts.map +1 -1
  37. package/dist/types/src/util/toEmoji.d.ts +2 -0
  38. package/dist/types/src/util/toEmoji.d.ts.map +1 -0
  39. package/package.json +18 -14
  40. package/src/components/IdentityList/SpaceMemberListContainer.tsx +6 -2
  41. package/src/components/InvitationList/InvitationList.stories.tsx +1 -1
  42. package/src/composites/DevicesDialog/DevicesDialog.tsx +3 -2
  43. package/src/composites/JoinDialog/JoinDialog.stories.tsx +4 -2
  44. package/src/composites/JoinDialog/JoinDialog.tsx +4 -2
  45. package/src/composites/Shell/Shell.stories.tsx +1 -1
  46. package/src/composites/Shell/Shell.tsx +1 -1
  47. package/src/composites/SpaceDialog/SpaceDialog.tsx +3 -2
  48. package/src/panels/IdentityPanel/IdentityPanel.tsx +4 -2
  49. package/src/panels/JoinPanel/JoinHeading.tsx +42 -40
  50. package/src/panels/JoinPanel/JoinPanel.tsx +143 -220
  51. package/src/panels/JoinPanel/JoinPanelProps.ts +1 -1
  52. package/src/panels/JoinPanel/joinMachine.ts +418 -0
  53. package/src/panels/JoinPanel/view-states/AdditionMethodSelector.tsx +9 -21
  54. package/src/panels/JoinPanel/view-states/IdentityAdded.tsx +6 -6
  55. package/src/panels/JoinPanel/view-states/IdentityInput.tsx +4 -4
  56. package/src/panels/JoinPanel/view-states/InvitationAccepted.tsx +22 -18
  57. package/src/panels/JoinPanel/view-states/InvitationAuthenticator.tsx +38 -28
  58. package/src/panels/JoinPanel/view-states/InvitationInput.tsx +21 -21
  59. package/src/panels/JoinPanel/view-states/InvitationRescuer.tsx +58 -41
  60. package/src/panels/JoinPanel/view-states/ViewState.tsx +11 -62
  61. package/src/panels/JoinPanel/view-states/index.ts +0 -1
  62. package/src/playwright/invitations-manager.ts +6 -2
  63. package/src/playwright/invitations.spec.ts +14 -5
  64. package/src/stories/Invitations.stories.tsx +2 -2
  65. package/src/translations/locales/en-US.ts +6 -4
  66. package/src/util/index.ts +1 -0
  67. package/src/util/toEmoji.ts +22 -0
  68. package/dist/types/src/panels/JoinPanel/view-states/IdentitySelector.d.ts +0 -7
  69. package/dist/types/src/panels/JoinPanel/view-states/IdentitySelector.d.ts.map +0 -1
  70. package/src/panels/JoinPanel/view-states/IdentitySelector.tsx +0 -100
@@ -1,18 +1,17 @@
1
1
  //
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
- import React, { useEffect, useReducer, useState } from 'react';
4
+ import React, { useEffect } from 'react';
5
5
 
6
- import { InvitationEncoder } from '@dxos/client';
7
6
  import { log } from '@dxos/log';
8
7
  import { useClient, useIdentity } from '@dxos/react-client';
9
- import { DensityProvider, useId } from '@dxos/react-components';
8
+ import { DensityProvider, useId, useThemeContext } from '@dxos/react-components';
10
9
 
11
10
  import { JoinHeading } from './JoinHeading';
12
- import { JoinAction, JoinPanelProps, JoinState } from './JoinPanelProps';
11
+ import { JoinPanelProps } from './JoinPanelProps';
12
+ import { useJoinMachine } from './joinMachine';
13
13
  import {
14
14
  AdditionMethodSelector,
15
- IdentitySelector,
16
15
  IdentityInput,
17
16
  IdentityAdded,
18
17
  InvitationAuthenticator,
@@ -22,9 +21,8 @@ import {
22
21
  } from './view-states';
23
22
 
24
23
  export const JoinPanel = ({
25
- mode,
24
+ mode = 'default',
26
25
  initialInvitationCode,
27
- titleId: propsTitleId,
28
26
  exitActionParent,
29
27
  onExit,
30
28
  doneActionParent,
@@ -32,287 +30,212 @@ export const JoinPanel = ({
32
30
  preventExit
33
31
  }: JoinPanelProps) => {
34
32
  const client = useClient();
35
- const internalTitleId = useId('joinPanel__title');
36
- const titleId = propsTitleId ?? internalTitleId;
37
33
  const identity = useIdentity();
38
- const [prevIdentity, setPrevIdentity] = useState(identity);
39
- const availableIdentities = identity ? [identity] : [];
34
+ const titleId = useId('joinPanel__title');
35
+ const { hasIosKeyboard } = useThemeContext();
40
36
 
41
- const reducer = (state: JoinState, action: JoinAction) => {
42
- const nextState = { ...state };
43
- switch (action.type) {
44
- case 'added identity':
45
- nextState.activeView = 'identity added';
46
- nextState.selectedIdentity = action.identity;
47
- break;
48
- case 'add identity':
49
- nextState.activeView = 'addition method selector';
50
- break;
51
- case 'select addition method':
52
- if (action.method === 'accept device invitation') {
53
- nextState.activeView = 'halo invitation acceptor';
54
- if (state.unredeemedHaloInvitationCode) {
55
- nextState.haloInvitation = client.halo.acceptInvitation(
56
- InvitationEncoder.decode(state.unredeemedHaloInvitationCode)
57
- );
58
- nextState.unredeemedHaloInvitationCode = undefined;
59
- nextState.haloViewState = 'invitation authenticator';
60
- } else {
61
- nextState.haloViewState = 'invitation input';
62
- }
63
- } else {
64
- nextState.activeView = 'identity input';
65
- nextState.additionMethod = action.method;
66
- }
67
- break;
68
- case 'select identity':
69
- nextState.selectedIdentity = action.identity;
70
- nextState.activeView = 'space invitation acceptor';
71
- if (state.unredeemedSpaceInvitationCode) {
72
- nextState.spaceInvitation = client.echo.acceptInvitation(
73
- InvitationEncoder.decode(state.unredeemedSpaceInvitationCode)
74
- );
75
- nextState.unredeemedSpaceInvitationCode = undefined;
76
- nextState.spaceViewState = 'invitation authenticator';
77
- } else {
78
- nextState.spaceViewState = 'invitation input';
79
- }
80
- break;
81
- case 'deselect identity':
82
- nextState.selectedIdentity = undefined;
83
- nextState.activeView = 'identity selector';
84
- break;
85
- case 'cancel invitation':
86
- if (action.from === 'space' && state.spaceInvitation?.invitation) {
87
- void state.spaceInvitation?.cancel();
88
- }
89
- if (action.from === 'halo' && state.haloInvitation?.invitation) {
90
- void state.haloInvitation?.cancel();
91
- }
92
- break;
93
- case 'authenticating invitation':
94
- nextState[action.from === 'halo' ? 'haloInvitationAnnotation' : 'spaceInvitationAnnotation'] = 'authenticating';
95
- break;
96
- case 'connecting invitation':
97
- nextState[action.from === 'halo' ? 'haloInvitation' : 'spaceInvitation'] = action.invitation;
98
- // eslint-disable-next-line no-fallthrough
99
- case 'cancelled invitation':
100
- case 'fail invitation':
101
- case 'timeout invitation':
102
- nextState[action.from === 'halo' ? 'haloViewState' : 'spaceViewState'] = 'invitation rescuer';
103
- break;
104
- case 'connect invitation':
105
- case 'authenticate invitation':
106
- if (action.from === 'halo' && state.haloInvitationAnnotation === 'authenticating') {
107
- nextState.haloInvitationAnnotation = 'authentication failed';
108
- }
109
- if (action.from === 'space' && state.spaceInvitationAnnotation === 'authenticating') {
110
- nextState.spaceInvitationAnnotation = 'authentication failed';
111
- }
112
- nextState[action.from === 'halo' ? 'haloViewState' : 'spaceViewState'] = 'invitation authenticator';
113
- break;
114
- case 'accepted invitation':
115
- nextState[action.from === 'halo' ? 'haloViewState' : 'spaceViewState'] = 'invitation accepted';
116
- break;
117
- case 'reset invitation':
118
- nextState[action.from === 'halo' ? 'haloInvitation' : 'spaceInvitation'] = undefined;
119
- nextState[action.from === 'halo' ? 'haloInvitationAnnotation' : 'spaceInvitationAnnotation'] = undefined;
120
- nextState[action.from === 'halo' ? 'unredeemedHaloInvitationCode' : 'unredeemedSpaceInvitationCode'] =
121
- undefined;
122
- nextState[action.from === 'halo' ? 'haloViewState' : 'spaceViewState'] = 'invitation input';
123
- break;
37
+ const [joinState, joinSend, joinService] = useJoinMachine(client, {
38
+ context: {
39
+ mode,
40
+ identity,
41
+ ...(initialInvitationCode && {
42
+ [mode === 'halo-only' ? 'halo' : 'space']: { unredeemedCode: initialInvitationCode }
43
+ })
124
44
  }
125
- log('[join panel reducer]', { action, nextState });
126
- return nextState;
127
- };
128
-
129
- const unredeemedHaloInvitationCode = mode === 'halo-only' ? initialInvitationCode : undefined;
130
- const [joinState, dispatch] = useReducer(reducer, {
131
- unredeemedHaloInvitationCode,
132
- unredeemedSpaceInvitationCode: mode === 'halo-only' ? undefined : initialInvitationCode,
133
- spaceInvitation: undefined,
134
- haloInvitation: undefined,
135
- activeView: availableIdentities.length > 0 ? 'identity selector' : 'addition method selector',
136
- selectedIdentity: undefined,
137
- additionMethod: undefined,
138
- spaceViewState: 'invitation input',
139
- haloViewState: 'invitation input'
140
45
  });
141
46
 
142
- if (identity !== prevIdentity) {
143
- setPrevIdentity(identity);
144
- identity && !prevIdentity && dispatch({ type: 'added identity', identity });
145
- }
146
-
147
47
  useEffect(() => {
148
- if (unredeemedHaloInvitationCode) {
149
- dispatch({ type: 'select addition method', method: 'accept device invitation' });
150
- }
151
- }, [unredeemedHaloInvitationCode]);
48
+ const subscription = joinService.subscribe((state) => {
49
+ log('[state]', state);
50
+ });
51
+
52
+ return subscription.unsubscribe;
53
+ }, [joinService]);
152
54
 
153
55
  useEffect(() => {
154
56
  // TODO(thure): Validate if this is sufficiently synchronous for iOS to move focus. It might not be!
155
- const attrValue =
156
- joinState.activeView === 'identity input'
157
- ? `${joinState.activeView}; ${joinState.additionMethod}`
158
- : joinState.activeView === 'space invitation acceptor'
159
- ? `${joinState.activeView}; ${joinState.spaceViewState}`
160
- : joinState.activeView === 'halo invitation acceptor'
161
- ? `${joinState.activeView}; ${joinState.haloViewState}`
162
- : joinState.activeView;
163
- log('[autofocus value]', { attrValue });
164
- const $nextAutofocus: HTMLElement | null = document.querySelector(`[data-autofocus="${attrValue}"]`);
165
- if ($nextAutofocus) {
57
+ const stateStack = joinState.configuration[0].id.split('.');
58
+ const innermostState = stateStack[stateStack.length - 1];
59
+ const autoFocusValue = innermostState === 'finishingJoining' ? 'successSpaceInvitation' : innermostState;
60
+ const $nextAutofocus: HTMLElement | null = document.querySelector(`[data-autofocus~="${autoFocusValue}"]`);
61
+ if ($nextAutofocus && !(hasIosKeyboard && $nextAutofocus.hasAttribute('data-prevent-ios-autofocus'))) {
166
62
  $nextAutofocus.focus();
167
63
  }
168
- }, [joinState.activeView, joinState.spaceViewState, joinState.haloViewState]);
169
-
170
- useEffect(() => {
171
- return joinState.spaceInvitation?.subscribe({
172
- onAuthenticating: () => dispatch({ type: 'authenticate invitation', from: 'space' }),
173
- onCancelled: () => dispatch({ type: 'cancelled invitation', from: 'space' }),
174
- onConnected: () => dispatch({ type: 'connect invitation', from: 'space' }),
175
- onError: () => dispatch({ type: 'fail invitation', from: 'space' }),
176
- onSuccess: () => dispatch({ type: 'accepted invitation', from: 'space' }),
177
- onTimeout: () => dispatch({ type: 'timeout invitation', from: 'space' })
178
- });
179
- }, [joinState.spaceInvitation]);
180
-
181
- useEffect(() => {
182
- return joinState.haloInvitation?.subscribe({
183
- onAuthenticating: () => dispatch({ type: 'authenticate invitation', from: 'halo' }),
184
- onCancelled: () => dispatch({ type: 'cancelled invitation', from: 'halo' }),
185
- onConnected: () => dispatch({ type: 'connect invitation', from: 'halo' }),
186
- onError: () => dispatch({ type: 'fail invitation', from: 'halo' }),
187
- onSuccess: () => dispatch({ type: 'accepted invitation', from: 'halo' }),
188
- onTimeout: () => dispatch({ type: 'timeout invitation', from: 'halo' })
189
- });
190
- }, [joinState.haloInvitation]);
64
+ }, [joinState.value, hasIosKeyboard]);
191
65
 
192
66
  return (
193
67
  <DensityProvider density='fine'>
194
- <JoinHeading
195
- {...{ mode, titleId, invitation: joinState.spaceInvitation, onExit, exitActionParent, preventExit }}
196
- />
68
+ <JoinHeading {...{ mode, titleId, joinState, onExit, exitActionParent, preventExit }} />
197
69
  <div role='none' className='is-full overflow-hidden'>
198
- <div role='none' className='flex is-[1300%]' aria-live='polite'>
199
- <IdentitySelector
200
- {...{ dispatch, availableIdentities, active: joinState.activeView === 'identity selector' }}
201
- />
70
+ <div role='none' className='flex is-[1200%]' aria-live='polite'>
202
71
  <AdditionMethodSelector
203
72
  {...{
204
- dispatch,
205
- availableIdentities,
206
- active: joinState.activeView === 'addition method selector'
73
+ joinState,
74
+ joinSend,
75
+ active: joinState.matches({ choosingIdentity: 'choosingAuthMethod' })
207
76
  }}
208
77
  />
209
78
  <IdentityInput
210
79
  {...{
211
- dispatch,
212
- active: joinState.activeView === 'identity input' && joinState.additionMethod === 'create identity',
80
+ joinState,
81
+ joinSend,
82
+ active: joinState.matches({ choosingIdentity: 'creatingIdentity' }),
213
83
  method: 'create identity'
214
84
  }}
215
85
  />
216
86
  <IdentityInput
217
87
  {...{
218
- dispatch,
219
- active: joinState.activeView === 'identity input' && joinState.additionMethod === 'recover identity',
88
+ joinState,
89
+ joinSend,
90
+ active: joinState.matches({ choosingIdentity: 'recoveringIdentity' }),
220
91
  method: 'recover identity'
221
92
  }}
222
93
  />
223
94
  <InvitationInput
224
95
  {...{
225
- dispatch,
226
- activeInvitation: joinState.haloInvitation || true,
227
- active:
228
- joinState.activeView === 'halo invitation acceptor' && joinState.haloViewState === 'invitation input',
229
- invitationType: 'halo'
96
+ joinState,
97
+ joinSend,
98
+ active: joinState.matches({
99
+ choosingIdentity: { acceptingHaloInvitation: 'inputtingHaloInvitationCode' }
100
+ }),
101
+ Domain: 'Halo'
230
102
  }}
231
103
  />
232
104
  <InvitationRescuer
233
105
  {...{
234
- dispatch,
235
- activeInvitation: joinState.haloInvitation || true,
236
- active:
237
- joinState.activeView === 'halo invitation acceptor' && joinState.haloViewState === 'invitation rescuer',
238
- invitationType: 'halo'
106
+ joinState,
107
+ joinSend,
108
+ active: [
109
+ {
110
+ choosingIdentity: {
111
+ acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'connectingHaloInvitation' }
112
+ }
113
+ },
114
+ {
115
+ choosingIdentity: {
116
+ acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'failingHaloInvitation' }
117
+ }
118
+ }
119
+ ].some(joinState.matches),
120
+ Domain: 'Halo'
239
121
  }}
240
122
  />
241
123
  <InvitationAuthenticator
242
124
  {...{
243
- dispatch,
244
- activeInvitation: joinState.haloInvitation || true,
245
- active:
246
- joinState.activeView === 'halo invitation acceptor' &&
247
- joinState.haloViewState === 'invitation authenticator',
248
- invitationType: 'halo',
249
- ...(joinState.spaceInvitationAnnotation === 'authentication failed' && { failed: true })
125
+ joinState,
126
+ joinSend,
127
+ active: [
128
+ {
129
+ choosingIdentity: {
130
+ acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'inputtingHaloVerificationCode' }
131
+ }
132
+ },
133
+ {
134
+ choosingIdentity: {
135
+ acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'authenticatingHaloVerificationCode' }
136
+ }
137
+ },
138
+ {
139
+ choosingIdentity: {
140
+ acceptingHaloInvitation: {
141
+ acceptingRedeemedHaloInvitation: 'authenticationFailingHaloVerificationCode'
142
+ }
143
+ }
144
+ }
145
+ ].some(joinState.matches),
146
+ Domain: 'Halo',
147
+ ...(joinState.matches({
148
+ acceptingHaloInvitation: {
149
+ acceptingRedeemedHaloInvitation: 'authenticationFailingHaloVerificationCode'
150
+ }
151
+ }) && { failed: true })
250
152
  }}
251
153
  />
252
154
  <InvitationAccepted
253
155
  {...{
254
- dispatch,
255
- activeInvitation: joinState.haloInvitation || true,
256
- active:
257
- joinState.activeView === 'halo invitation acceptor' &&
258
- joinState.haloViewState === 'invitation accepted',
259
- invitationType: 'halo',
156
+ joinState,
157
+ joinSend,
158
+ active: [
159
+ {
160
+ choosingIdentity: {
161
+ acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'successHaloInvitation' }
162
+ }
163
+ },
164
+ 'finishingJoiningHalo'
165
+ ].some(joinState.matches),
166
+ Domain: 'Halo',
260
167
  doneActionParent,
261
168
  onDone
262
169
  }}
263
170
  />
264
171
  <IdentityAdded
265
172
  {...{
173
+ joinState,
174
+ joinSend,
266
175
  mode,
267
- dispatch,
268
- addedIdentity: joinState.selectedIdentity,
269
- active: joinState.activeView === 'identity added',
176
+ active: joinState.matches({
177
+ choosingIdentity: 'confirmingAddedIdentity'
178
+ }),
270
179
  doneActionParent,
271
180
  onDone
272
181
  }}
273
182
  />
274
183
  <InvitationInput
275
184
  {...{
276
- dispatch,
277
- activeInvitation: joinState.spaceInvitation || true,
278
- selectedIdentity: joinState.selectedIdentity,
279
- active:
280
- joinState.activeView === 'space invitation acceptor' && joinState.spaceViewState === 'invitation input',
281
- invitationType: 'space'
185
+ joinState,
186
+ joinSend,
187
+ active: joinState.matches({
188
+ acceptingSpaceInvitation: 'inputtingSpaceInvitationCode'
189
+ }),
190
+ Domain: 'Space'
282
191
  }}
283
192
  />
284
193
  <InvitationRescuer
285
194
  {...{
286
- dispatch,
287
- activeInvitation: joinState.spaceInvitation || true,
288
- selectedIdentity: joinState.selectedIdentity,
289
- active:
290
- joinState.activeView === 'space invitation acceptor' &&
291
- joinState.spaceViewState === 'invitation rescuer',
292
- invitationType: 'space'
195
+ joinState,
196
+ joinSend,
197
+ active: [
198
+ {
199
+ acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'connectingSpaceInvitation' }
200
+ },
201
+ {
202
+ acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'failingSpaceInvitation' }
203
+ }
204
+ ].some(joinState.matches),
205
+ Domain: 'Space'
293
206
  }}
294
207
  />
295
208
  <InvitationAuthenticator
296
209
  {...{
297
- dispatch,
298
- activeInvitation: joinState.spaceInvitation || true,
299
- selectedIdentity: joinState.selectedIdentity,
300
- active:
301
- joinState.activeView === 'space invitation acceptor' &&
302
- joinState.spaceViewState === 'invitation authenticator',
303
- invitationType: 'space',
304
- ...(joinState.spaceInvitationAnnotation === 'authentication failed' && { failed: true })
210
+ joinState,
211
+ joinSend,
212
+ active: [
213
+ {
214
+ acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'inputtingSpaceVerificationCode' }
215
+ },
216
+ {
217
+ acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'authenticatingSpaceVerificationCode' }
218
+ },
219
+ {
220
+ acceptingSpaceInvitation: {
221
+ acceptingRedeemedSpaceInvitation: 'authenticationFailingSpaceVerificationCode'
222
+ }
223
+ }
224
+ ].some(joinState.matches),
225
+ Domain: 'Space',
226
+ ...(joinState.matches({
227
+ acceptingSpaceInvitation: {
228
+ acceptingRedeemedSpaceInvitation: 'authenticationFailingSpaceVerificationCode'
229
+ }
230
+ }) && { failed: true })
305
231
  }}
306
232
  />
307
233
  <InvitationAccepted
308
234
  {...{
309
- dispatch,
310
- activeInvitation: joinState.spaceInvitation || true,
311
- selectedIdentity: joinState.selectedIdentity,
312
- active:
313
- joinState.activeView === 'space invitation acceptor' &&
314
- joinState.spaceViewState === 'invitation accepted',
315
- invitationType: 'space',
235
+ joinState,
236
+ joinSend,
237
+ active: joinState.matches('finishingJoiningSpace'),
238
+ Domain: 'Space',
316
239
  doneActionParent,
317
240
  onDone
318
241
  }}
@@ -59,7 +59,7 @@ export interface AdditionMethodAction {
59
59
 
60
60
  export type JoinAction = IdentityAction | EmptyJoinAction | AdditionMethodAction | InvitationAction;
61
61
 
62
- export type JoinDispatch = Dispatch<JoinAction>;
62
+ export type JoinSend = Dispatch<JoinAction>;
63
63
 
64
64
  export type InvitationView =
65
65
  | 'invitation input'