Skip to content

Commit

Permalink
Merge pull request #320 from mfts/chore/small-improvements
Browse files Browse the repository at this point in the history
feat: focus on email input
  • Loading branch information
mfts authored Feb 29, 2024
2 parents 2c91a6d + 96549c4 commit fd5bfc9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
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

0 comments on commit fd5bfc9

Please sign in to comment.