Skip to content

Commit 8aa0cef

Browse files
committed
accessibility tweaks
1 parent cac868c commit 8aa0cef

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/app/[locale]/(auth)/profile/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default async function Profile() {
3232
className="gap-2"
3333
after={
3434
<>
35-
<div className="my-4 flex flex-col gap-4 sm:flex-row-reverse">
35+
<div className="my-4 flex flex-col items-center gap-4 sm:flex-row">
3636
<LogoutButton />
3737
<DeleteAccountButton user={user} />
3838
</div>

src/components/navigation/user-widget.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ export function UserWidget({
2222
return (
2323
<div className="grid h-full max-w-[90%] place-items-center font-light sm:max-w-full">
2424
{user == null ? (
25-
<div className="flex flex-col-reverse gap-x-2 gap-y-4 sm:flex-row">
26-
<Button asChild variant="glow" className="min-w-28" onClick={closeMenu}>
27-
<ClientLink href="/signup">{t("profile.formDetails.signup")}</ClientLink>
28-
</Button>
25+
<div className="flex flex-col gap-x-2 gap-y-4 sm:flex-row">
2926
<Button asChild className="min-w-28" onClick={closeMenu}>
3027
<ClientLink href={`/login?from=${encodeURIComponent(pathname)}`}>
3128
{t("loginShort")}
3229
</ClientLink>
3330
</Button>
31+
<Button asChild variant="glow" className="min-w-28" onClick={closeMenu}>
32+
<ClientLink href="/signup">{t("profile.formDetails.signup")}</ClientLink>
33+
</Button>
3434
</div>
3535
) : (
3636
<Link

src/components/ui/button.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,11 @@ export function Button({
9494
{...props}
9595
style={getColorMixStyle(sliderProgress, "success", "error")}
9696
disabled={loading || props.disabled}
97+
// use comma notation to return using the original event handler
9798
onMouseEnter={(event_) => (startHoverTimer(), props.onMouseEnter?.(event_))}
9899
onMouseLeave={(event_) => (stopHoverTimer(), props.onMouseLeave?.(event_))}
100+
onFocus={(event_) => (startHoverTimer(), props.onFocus?.(event_))}
101+
onBlur={(event_) => (stopHoverTimer(), props.onBlur?.(event_))}
99102
onClick={(event_) => click(event_)}
100103
onTouchMove={(event_) => {
101104
const touch = event_.touches[0];

src/components/ui/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const buttonVariants = cva(
1111
"bg-accent shadow-xs text-primary-strong shadow-xs hover:bg-accent/80 hover:text-primary-strong/80",
1212
cancel: "border-background-soft shadow-xs shadow-xs hover:text-error",
1313
destructive:
14-
"bg-background border-error shadow-xs text-error shadow-xs hover:bg-error hover:text-primary-strong",
14+
"bg-transparent border-error shadow-xs text-error shadow-xs hover:bg-error hover:text-primary-strong",
1515
"super-destructive":
1616
"relative overflow-hidden bg-success text-primary-strong sm:text-primary hover:text-primary-strong shadow-xs min-w-14",
1717
outline:

0 commit comments

Comments
 (0)