@@ -2,10 +2,12 @@ import { useCallback, useMemo } from 'react';
22
33import View from 'components/View';
44import ActivateView from './ActivateView';
5+import CodeExpired from './CodeExpired';
56
67import { useLocalRouter } from 'lib/LocalRouter';
78import useImpliedTicket from 'lib/useImpliedTicket';
89import useHasDisclaimed from 'lib/useHasDisclaimed';
10+import useIsExpiredInvite from 'lib/useIsExpiredInvite';
911
1012import { ReactComponent as PlaceholderSigil } from 'assets/blank-planet-sigil.svg';
1113import { FadeablePointPresenter as PointPresenter } from './PointPresenter';
@@ -35,58 +37,64 @@ export default function ActivateCode() {
3537 [impliedTicket, impliedPatp]
3638 );
3739
40+ const { isExpired } = useIsExpiredInvite(impliedPatp, impliedTicket);
41+
3842 return (
3943 <View inset hideBack>
40− <ActivateView
41− hideBack={hasInitialValues}
42− header={
43− <ActivateHeader
44− content={
45− hasInitialValues
46− ? 'Welcome. This is your Urbit ID.'
47− : 'Activate a Planet'
48− }
49− />
50− }
51− footer={<ActivateCodeForm afterSubmit={goToMasterKey} />}>
52− <Box className="flex-col align-center justify-center w-full h-full">
53− {hasInitialValues ? (
54− <Box>
55− <p
56− className="mb2 sans gray5"
57− style={{
58− fontSize: 14,
59− textAlign: 'center',
60− maxWidth: '38ch',
61− marginLeft: 'auto',
62− }}>
63− An Urbit ID is your unique identity that you use to communicate
64− on Urbit. You own it forever.
65− </p>
66− <p
67− className="mb2 sans gray5"
68− style={{
69− fontSize: 14,
70− textAlign: 'center',
71− maxWidth: '38ch',
72− marginLeft: 'auto',
73− }}>
74− To activate your Urbit ID, begin by claiming it via the link
75− below.
76− </p>
77− </Box>
78− ) : (
79− <Box className="mb2 sans gray5" fontSize={14}>
80− Enter your planet activation code below.
81− </Box>
82− )}
83− {impliedPatp ? (
84− <PointPresenter patp={impliedPatp} className="mb6 mt7" />
85− ) : (
86− <PlaceholderSigil className="mv9" style={{ marginTop: 78 }} />
87− )}
88− </Box>
89− </ActivateView>
44+ {isExpired ? (
45+ <CodeExpired />
46+ ) : (
47+ <ActivateView
48+ hideBack={hasInitialValues}
49+ header={
50+ <ActivateHeader
51+ content={
52+ hasInitialValues
53+ ? 'Welcome. This is your Urbit ID.'
54+ : 'Activate a Planet'
55+ }
56+ />
57+ }
58+ footer={<ActivateCodeForm afterSubmit={goToMasterKey} />}>
59+ <Box className="flex-col align-center justify-center w-full h-full">
60+ {hasInitialValues ? (
61+ <Box>
62+ <p
63+ className="mb2 sans gray5"
64+ style={{
65+ fontSize: 14,
66+ textAlign: 'center',
67+ maxWidth: '38ch',
68+ marginLeft: 'auto',
69+ }}>
70+ An Urbit ID is your unique identity that you use to
71+ communicate on Urbit. You own it forever.
72+ </p>
73+ <p
74+ className="mb2 sans gray5"
75+ style={{
76+ fontSize: 14,
77+ textAlign: 'center',
78+ maxWidth: '38ch',
79+ marginLeft: 'auto',
80+ }}>
81+ To activate your Urbit ID, begin by claiming it via the link
82+ below.
83+ </p>
84+ </Box>
85+ ) : (
86+ <Box className="mb2 sans gray5" fontSize={14}>
87+ Enter your planet activation code below.
88+ </Box>
89+ )}
90+ {impliedPatp ? (
91+ <PointPresenter patp={impliedPatp} className="mb6 mt7" />
92+ ) : (
93+ <PlaceholderSigil className="mv9" style={{ marginTop: 78 }} />
94+ )}
95+ </Box>
96+ </ActivateView>
97+ )}
9098 </View>
9199 );
92100}