@@ -33,10 +33,7 @@ export const GenerateInvites = () => {
3333 InviteGeneratingStatus
3434 >('initial');
3535 const [error, setError] = useState('');
36− const currentL2 = Boolean(point.isL2Spawn);
37− const [numInvites, setNumInvites] = useState(
38− currentL2 ? DEFAULT_NUM_INVITES : 1
39− );
36+ const [numInvites, setNumInvites] = useState(DEFAULT_NUM_INVITES);
4037
4138 const createInvites = useCallback(async () => {
4239 setGeneratingStatus('generating');
@@ -80,39 +77,26 @@ export const GenerateInvites = () => {
8077 </HeaderPane>
8178 <BodyPane>
8279 <Box className="upper">
83− {currentL2 ? (
84− <Row className="points-input">
85− I want to generate
86− <StatelessTextInput
87− className={`input-box ${overQuota ? 'over-quota' : ''}`}
88− value={numInvites}
89− maxLength={3}
90− onChange={e => {
91− const target = e.target as HTMLInputElement;
92− setNumInvites(Number(target.value.replace(/\D/g, '')));
93− }}
94− />
95− planet invite code{numInvites > 1 ? 's' : ''}
96− </Row>
97− ) : (
98− <Box className="migration-prompt">
99− ETH fees are very high currently. You can spawn invites for free
100− after{' '}
101− <span className="migrate" onClick={() => null}>
102− {/* TODO: change this to navigate to migration */}
103− migrating this star to L2.
104− </span>
105− </Box>
106− )}
107− {currentL2 && (
108− <Box className="mb4" lineHeight="1.4em">
109− You can generate up to
110− <strong>{` ${point.l2Quota} `}</strong>
111− invites. You will be able to generate another
112− <strong>{` ${point.l2Allowance}`}</strong> invites on
113− <strong>{` ${ddmmmYYYY(nextQuotaTime)}`}</strong>.
114− </Box>
115− )}
80+ <Row className="points-input">
81+ I want to generate
82+ <StatelessTextInput
83+ className={`input-box ${overQuota ? 'over-quota' : ''}`}
84+ value={numInvites}
85+ maxLength={3}
86+ onChange={e => {
87+ const target = e.target as HTMLInputElement;
88+ setNumInvites(Number(target.value.replace(/\D/g, '')));
89+ }}
90+ />
91+ planet invite code{numInvites > 1 ? 's' : ''}
92+ </Row>
93+ <Box className="mb4" lineHeight="1.4em">
94+ You can generate up to
95+ <strong>{` ${point.l2Quota} `}</strong>
96+ invites. You will be able to generate another
97+ <strong>{` ${point.l2Allowance}`}</strong> invites on
98+ <strong>{` ${ddmmmYYYY(nextQuotaTime)}`}</strong>.
99+ </Box>
116100 {showTxnNote && (
117101 <Box className="mb6" lineHeight="1.4em">
118102 Note: you will have to sign <strong>4</strong> transactions per
@@ -121,32 +105,23 @@ export const GenerateInvites = () => {
121105 </Box>
122106 )}
123107 </Box>
124− {/* <Inviter /> */}
125108 <Box className="lower">
126− {currentL2 && (
127− <Row className="next-roll">
128− <span>Next Roll in</span>
129− <span className="timer">{nextRoll}</span>
130− </Row>
131− )}
132− {currentL2 ? (
133− // Ignoring for deprecated `indigo-react` component
134− //@ts-ignore
135− <Button
136− as={'button'}
137− className={`generate-codes ${
138− generateDisabled ? 'disabled' : ''
139− }`}
140− disabled={generateDisabled}
141− center
142− onClick={createInvites}>
143− {overQuota
144− ? `You can only generate ${point.l2Quota} codes`
145− : `Generate Invite Code${
146− currentL2 ? `s (${numInvites})` : ''
147− }`}
148− </Button>
149− ) : null}
109+ <Row className="next-roll">
110+ <span>Next Roll in</span>
111+ <span className="timer">{nextRoll}</span>
112+ </Row>
113+ {/*
114+ // @ts-ignore */}
115+ <Button
116+ as={'button'}
117+ className={`generate-codes ${generateDisabled ? 'disabled' : ''}`}
118+ disabled={generateDisabled}
119+ center
120+ onClick={createInvites}>
121+ {overQuota
122+ ? `You can only generate ${point.l2Quota} codes`
123+ : `Generate Invite Codes (${numInvites})`}
124+ </Button>
150125 </Box>
151126 </BodyPane>
152127 </Window>