Skip to content

Commit

Permalink
chore: Display "reset password" tooltip (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
evadecker authored Oct 20, 2024
1 parent 5f1387a commit 103e0d9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/sour-pumas-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"namesake": patch
---

Display tooltip on reset password button
12 changes: 6 additions & 6 deletions src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ const inputStyles = tv({
export interface TextFieldProps extends AriaTextFieldProps {
label?: string;
description?: string | React.ReactNode;
icon?: React.ReactNode;
rightIcon?: React.ReactNode;
prefix?: React.ReactNode;
suffix?: React.ReactNode;
errorMessage?: string | ((validation: ValidationResult) => string);
}

export function TextField({
label,
description,
icon,
rightIcon,
prefix,
suffix,
errorMessage,
...props
}: TextFieldProps) {
Expand All @@ -58,9 +58,9 @@ export function TextField({
>
{label && <Label>{label}</Label>}
<FieldGroup className={inputStyles}>
{icon}
{prefix}
<Input />
{rightIcon}
{suffix}
{props.type === "password" && (
<TooltipTrigger>
<Button
Expand Down
2 changes: 1 addition & 1 deletion src/routes/_authenticated/settings/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function SettingsOverviewRoute() {
value={name}
onChange={handleUpdateName}
description="How do you want to be addressed?"
rightIcon={textFieldIcon}
suffix={textFieldIcon}
/>
<Switch
name="isMinor"
Expand Down
21 changes: 13 additions & 8 deletions src/routes/_unauthenticated/signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
TabPanel,
Tabs,
TextField,
Tooltip,
TooltipTrigger,
} from "@/components";
import { useAuthActions } from "@convex-dev/auth/react";
import { RiArrowLeftSLine } from "@remixicon/react";
Expand Down Expand Up @@ -100,14 +102,17 @@ const SignIn = () => {
name="password"
type="password"
isRequired
rightIcon={
<Button
variant="ghost"
size="small"
onPress={() => setFlow("reset")}
>
Forgot?
</Button>
suffix={
<TooltipTrigger>
<Button
variant="ghost"
size="small"
onPress={() => setFlow("reset")}
>
Forgot?
</Button>
<Tooltip>Reset password</Tooltip>
</TooltipTrigger>
}
value={password}
onChange={setPassword}
Expand Down

0 comments on commit 103e0d9

Please sign in to comment.