Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: focus on email input #320

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions components/view/access-form/email-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ export default function EmailSection({
name="email"
id="email"
type="email"
autoCorrect="off"
autoComplete="email"
autoFocus
className="flex w-full rounded-md border-0 py-1.5 text-white bg-black shadow-sm ring-1 ring-inset ring-gray-600 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-gray-300 sm:text-sm sm:leading-6"
value={email || ""}
placeholder="Enter email"
onChange={handleEmailChange}
aria-invalid="true"
data-1p-ignore
/>
<p className="text-sm text-gray-600">
This data will be shared with the sender.
Expand Down
10 changes: 9 additions & 1 deletion components/view/access-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ export default function AccessForm({
) : null}

<div className="flex justify-center">
<Button type="submit" className="w-1/3" loading={isLoading}>
<Button
type="submit"
disabled={
(requireEmail && !data.email) ||
(requirePassword && !data.password)
}
className="w-1/3 bg-white text-gray-950 hover:bg-white/90"
loading={isLoading}
>
Continue
</Button>
</div>
Expand Down
3 changes: 3 additions & 0 deletions components/view/access-form/password-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ export default function PasswordSection({
name="password"
id="password"
type={showPassword ? "text" : "password"}
autoCorrect="off"
autoComplete="off"
className="flex w-full rounded-md border-0 py-1.5 text-white bg-black shadow-sm ring-1 ring-inset ring-gray-600 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-gray-300 sm:text-sm sm:leading-6"
value={password || ""}
placeholder="Enter passcode"
onChange={(e) => {
setData({ ...data, password: e.target.value });
}}
aria-invalid="true"
data-1p-ignore
/>
<button
type="button"
Expand Down