on master help sign in
invites: removing unnecessary L1 invite remnants
7353b01Hunter Miller
src/views/Invite/Cohort.tsx+1−2
@@ -29,7 +29,6 @@ export default function InviteCohort() {
29 const { nextRoll } = useTimerStore();
29 const { nextRoll } = useTimerStore();
30
30
31 const { invites, inviteJobs } = useInviteStore();
31 const { invites, inviteJobs } = useInviteStore();
32− const currentL2 = Boolean(point.isL2Spawn);
33
32
34 // TODO: do we need to read this error? currently unused
33 // TODO: do we need to read this error? currently unused
35 const [page, setPage] = useState(0);
34 const [page, setPage] = useState(0);
@@ -99,7 +98,7 @@ export default function InviteCohort() {
99 <>
98 <>
100 You have no planet codes available.
99 You have no planet codes available.
101 <br />
100 <br />
102− {currentL2 && point.canSpawn && (
101+ {point.canSpawn && (
103 <>
102 <>
104 Generate your codes in
103 Generate your codes in
105 <br />
104 <br />
src/views/Invite/GenerateInvites.tsx+37−62
@@ -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
39− );
40
37
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">
83− {currentL2 ? (
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, '')));
93− }}
89+ }}
94− />
90+ />
95− planet invite code{numInvites > 1 ? 's' : ''}
91+ planet invite code{numInvites > 1 ? 's' : ''}
96− </Row>
92+ </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">
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>.
114− </Box>
99+ </Box>
115− )}
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 = () => {
121 </Box>
105 </Box>
122 )}
106 )}
123 </Box>
107 </Box>
124− {/* <Inviter /> */}
125 <Box className="lower">
108 <Box className="lower">
126− {currentL2 && (
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>
130− </Row>
112+ </Row>
131− )}
113+ {/*
132− {currentL2 ? (
133− // Ignoring for deprecated `indigo-react` component
134− //@ts-ignore
114+ // @ts-ignore */}
135− <Button
115+ <Button
136− as={'button'}
116+ as={'button'}
137− className={`generate-codes ${
138− generateDisabled ? 'disabled' : ''
117+ className={`generate-codes ${generateDisabled ? 'disabled' : ''}`}
139− }`}
140− disabled={generateDisabled}
118+ disabled={generateDisabled}
141− center
119+ center
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})` : ''
147− }`}
148− </Button>
124+ </Button>
149− ) : null}
150 </Box>
125 </Box>
151 </BodyPane>
126 </BodyPane>
152 </Window>
127 </Window>