Skip to content

Commit b507469

Browse files
committed
remove auth if sunsetting
1 parent 952499e commit b507469

File tree

1 file changed

+123
-104
lines changed

1 file changed

+123
-104
lines changed

pages/auth/register.tsx

+123-104
Original file line numberDiff line numberDiff line change
@@ -110,122 +110,141 @@ function Register() {
110110
alt="Basetool Logo"
111111
/>
112112
</div>
113-
<h2 className="mt-6 text-3xl font-extrabold text-gray-900">
114-
Sign up for an account
115-
</h2>
116-
<form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
117-
<input type="hidden" {...register("csrfToken")} />
118-
119-
<FormControl id="email" isInvalid={!isEmpty(errors?.email)}>
120-
<FormLabel>
121-
Work email address <sup className="text-red-600">*</sup>
122-
</FormLabel>
123-
<Input
124-
type="email"
125-
placeholder="[email protected]"
126-
required={true}
127-
{...register("email")}
128-
autoFocus
129-
/>
130-
<FormHelperText>We'll never share your email</FormHelperText>
131-
<FormErrorMessage>{errors?.email?.message}</FormErrorMessage>
132-
</FormControl>
133-
134-
<FormControl id="password" isInvalid={!isEmpty(errors?.password)}>
135-
<FormLabel>
136-
Password <sup className="text-red-600">*</sup>
137-
</FormLabel>
138-
<Input
139-
type="password"
140-
placeholder="your strong password"
141-
required={true}
142-
{...register("password")}
143-
/>
144-
<FormHelperText>Something strong.</FormHelperText>
145-
<FormErrorMessage>{errors?.password?.message}</FormErrorMessage>
146-
</FormControl>
147-
148-
<div className="flex flex-col space-y-4">
149-
<div className="w-full">
113+
{process.env.NEXT_PUBLIC_SHOW_SUNSETTING_MESSAGE == "1" && (
114+
<a
115+
href="https://basetool.io/#sunset"
116+
target="_blank"
117+
className="block w-full bg-blue-100 text-blue-900 py-2 text-center"
118+
rel="noreferrer"
119+
>
120+
We're sunsetting Basetool. Click to find out more.
121+
</a>
122+
)}
123+
{process.env.NEXT_PUBLIC_SHOW_SUNSETTING_MESSAGE !== "1" && (
124+
<>
125+
<h2 className="mt-6 text-3xl font-extrabold text-gray-900">
126+
Sign up for an account
127+
</h2>
128+
<form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
129+
<input type="hidden" {...register("csrfToken")} />
130+
131+
<FormControl id="email" isInvalid={!isEmpty(errors?.email)}>
132+
<FormLabel>
133+
Work email address <sup className="text-red-600">*</sup>
134+
</FormLabel>
135+
<Input
136+
type="email"
137+
placeholder="[email protected]"
138+
required={true}
139+
{...register("email")}
140+
autoFocus
141+
/>
142+
<FormHelperText>We'll never share your email</FormHelperText>
143+
<FormErrorMessage>{errors?.email?.message}</FormErrorMessage>
144+
</FormControl>
145+
150146
<FormControl
151-
id="organization"
152-
isInvalid={!isEmpty(errors?.organization)}
147+
id="password"
148+
isInvalid={!isEmpty(errors?.password)}
153149
>
154150
<FormLabel>
155-
Organization name <sup className="text-red-600">*</sup>
151+
Password <sup className="text-red-600">*</sup>
156152
</FormLabel>
157153
<Input
158-
type="text"
159-
placeholder="Apple Inc"
160-
{...register("organization")}
154+
type="password"
155+
placeholder="your strong password"
156+
required={true}
157+
{...register("password")}
161158
/>
159+
<FormHelperText>Something strong.</FormHelperText>
162160
<FormErrorMessage>
163-
{errors?.organization?.message}
161+
{errors?.password?.message}
164162
</FormErrorMessage>
165163
</FormControl>
166-
</div>
167-
<div className="flex space-x-4">
168-
<div className="w-1/2">
169-
<FormControl
170-
id="firstName"
171-
isInvalid={!isEmpty(errors?.firstName)}
172-
>
173-
<FormLabel>First name</FormLabel>
174-
<Input
175-
type="text"
176-
placeholder="Ted"
177-
{...register("firstName")}
178-
/>
179-
<FormErrorMessage>
180-
{errors?.firstName?.message}
181-
</FormErrorMessage>
182-
</FormControl>
164+
165+
<div className="flex flex-col space-y-4">
166+
<div className="w-full">
167+
<FormControl
168+
id="organization"
169+
isInvalid={!isEmpty(errors?.organization)}
170+
>
171+
<FormLabel>
172+
Organization name <sup className="text-red-600">*</sup>
173+
</FormLabel>
174+
<Input
175+
type="text"
176+
placeholder="Apple Inc"
177+
{...register("organization")}
178+
/>
179+
<FormErrorMessage>
180+
{errors?.organization?.message}
181+
</FormErrorMessage>
182+
</FormControl>
183+
</div>
184+
<div className="flex space-x-4">
185+
<div className="w-1/2">
186+
<FormControl
187+
id="firstName"
188+
isInvalid={!isEmpty(errors?.firstName)}
189+
>
190+
<FormLabel>First name</FormLabel>
191+
<Input
192+
type="text"
193+
placeholder="Ted"
194+
{...register("firstName")}
195+
/>
196+
<FormErrorMessage>
197+
{errors?.firstName?.message}
198+
</FormErrorMessage>
199+
</FormControl>
200+
</div>
201+
<div className="w-1/2">
202+
<FormControl
203+
id="lastName"
204+
isInvalid={!isEmpty(errors?.lastName)}
205+
>
206+
<FormLabel>Last name</FormLabel>
207+
<Input
208+
type="text"
209+
placeholder="Lasso"
210+
{...register("lastName")}
211+
/>
212+
<FormErrorMessage>
213+
{errors?.lastName?.message}
214+
</FormErrorMessage>
215+
</FormControl>
216+
</div>
217+
</div>
183218
</div>
184-
<div className="w-1/2">
185-
<FormControl
186-
id="lastName"
187-
isInvalid={!isEmpty(errors?.lastName)}
219+
220+
<div className="flex items-center justify-between">
221+
<div className="flex items-center"></div>
222+
<div className="text-sm">
223+
Already have an account?{" "}
224+
<Link href="/auth/login">
225+
<a className="font-medium text-indigo-600 hover:text-indigo-500">
226+
Log in
227+
</a>
228+
</Link>
229+
</div>
230+
</div>
231+
232+
<div>
233+
<Button
234+
type="submit"
235+
className="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
236+
colorScheme="blue"
237+
width="100%"
238+
disabled={isLoading}
239+
isLoading={isLoading}
240+
onClick={handleSubmit(onSubmit)}
188241
>
189-
<FormLabel>Last name</FormLabel>
190-
<Input
191-
type="text"
192-
placeholder="Lasso"
193-
{...register("lastName")}
194-
/>
195-
<FormErrorMessage>
196-
{errors?.lastName?.message}
197-
</FormErrorMessage>
198-
</FormControl>
242+
Register
243+
</Button>
199244
</div>
200-
</div>
201-
</div>
202-
203-
<div className="flex items-center justify-between">
204-
<div className="flex items-center"></div>
205-
<div className="text-sm">
206-
Already have an account?{" "}
207-
<Link href="/auth/login">
208-
<a className="font-medium text-indigo-600 hover:text-indigo-500">
209-
Log in
210-
</a>
211-
</Link>
212-
</div>
213-
</div>
214-
215-
<div>
216-
<Button
217-
type="submit"
218-
className="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
219-
colorScheme="blue"
220-
width="100%"
221-
disabled={isLoading}
222-
isLoading={isLoading}
223-
onClick={handleSubmit(onSubmit)}
224-
>
225-
Register
226-
</Button>
227-
</div>
228-
</form>
245+
</form>
246+
</>
247+
)}
229248
</div>
230249
</AuthLayout>
231250
</>

0 commit comments

Comments
 (0)