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