@@ -1,7 +1,7 @@
1−import { useCallback, useEffect, useMemo, useRef } from 'react';
1+import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
22import { Just } from 'folktale/maybe';
33import * as azimuth from 'azimuth-js';
4−import { Grid, H4, P, CheckboxInput } from 'indigo-react';
4+import { Grid, CheckboxInput } from 'indigo-react';
55import { FORM_ERROR } from 'final-form';
66
77import View from 'components/View';
@@ -44,6 +44,7 @@ import useRoller from 'lib/useRoller';
4444import { Ship } from '@urbit/roller-api';
4545import { Box, Text } from '@tlon/indigo-react';
4646import ActivateHeader from './ActivateHeader';
47+import { MasterKey } from './MasterKey';
4748
4849export default function ActivateCode() {
4950 const history = useHistory();
@@ -57,6 +58,7 @@ export default function ActivateCode() {
5758 const [hasDisclaimed] = useHasDisclaimed();
5859 const didWarn = useRef(false);
5960 const { api, getPoints } = useRoller();
61+ const [isGenerating, setIsGenerating] = useState<boolean>(false);
6062
6163 const {
6264 setDerivedPoint,
@@ -128,6 +130,7 @@ export default function ActivateCode() {
128130 // derive and set our state on submission
129131 const onSubmit = useCallback(
130132 async values => {
133+ setIsGenerating(true);
131134 await timeout(16); // allow the ui changes to flush before we lag it out
132135
133136 // Derive wallet
@@ -152,6 +155,7 @@ export default function ActivateCode() {
152155 if (incoming.length > 0) {
153156 if (incoming.length > 1 && !didWarn.current) {
154157 didWarn.current = true;
158+ setIsGenerating(false);
155159
156160 return {
157161 [WARNING]:
@@ -162,11 +166,12 @@ export default function ActivateCode() {
162166 }
163167
164168 const point = convertToInt(incoming[0], 10);
165− console.log('submitting point', point);
166169
167170 setDerivedPoint(Just(point));
168171 setDerivedWallet(Just(await generateWallet(point, true)));
169172 } else {
173+ setIsGenerating(false);
174+
170175 return {
171176 [FORM_ERROR]:
172177 'Invite code has no claimable point.\n' +
@@ -209,6 +214,7 @@ export default function ActivateCode() {
209214 display="flex"
210215 flexDirection="column"
211216 flexWrap="nowrap"
217+ height={'100%'}
212218 justifyContent="flex-end">
213219 <Grid>
214220 <BridgeForm
@@ -279,8 +285,12 @@ export default function ActivateCode() {
279285 return (
280286 <View inset>
281287 <ActivateView
282− header={<ActivateHeader copy={'Welcome. This is your Urbit.'} />}
283− footer={footer}>
288+ header={
289+ !isGenerating && (
290+ <ActivateHeader copy={'Welcome. This is your Urbit.'} />
291+ )
292+ }
293+ footer={!isGenerating && footer}>
284294 <Box
285295 alignItems={'center'}
286296 display={'flex'}
@@ -291,7 +301,20 @@ export default function ActivateCode() {
291301 {!impliedTicket && (
292302 <Text className="mb2">Enter your activation code to continue.</Text>
293303 )}
294− {impliedPatp && <PointPresenter patp={impliedPatp} />}
304+ {!isGenerating && impliedPatp && (
305+ <PointPresenter patp={impliedPatp} />
306+ )}
307+ {isGenerating && (
308+ <Box
309+ display={'flex'}
310+ flexDirection={'row'}
311+ flexWrap={'nowrap'}
312+ width={'80%'}
313+ height={'min-content'}
314+ justifyContent={'center'}>
315+ <MasterKey />
316+ </Box>
317+ )}
295318 </Box>
296319 </ActivateView>
297320