Skip to content

Commit

Permalink
Removed resend email button
Browse files Browse the repository at this point in the history
  • Loading branch information
atrincas committed Nov 18, 2024
1 parent 2b91cf4 commit 4f26e71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
16 changes: 0 additions & 16 deletions client/src/app/auth/confirm-email/[token]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
import Link from "next/link";

import ConfirmEmailForm from "@/containers/auth/confirm-email/form";
import AuthLayout from "@/containers/auth-layout";

import { Button } from "@/components/ui/button";
import { Card } from "@/components/ui/card";

export default function ConfirmEmailPage() {
return (
<AuthLayout>
<ConfirmEmailForm />
<Card variant="secondary" className="p-6">
<p className="text-sm">
<span className="pr-2 text-muted-foreground">
Didn&apos;t receive your email?
</span>
<Button variant="link" className="p-0 text-primary" asChild>
{/* TODO: Add correct implementation when API call is available */}
<Link href="/auth/signin">Resend email</Link>
</Button>
</p>
</Card>
</AuthLayout>
);
}
14 changes: 6 additions & 8 deletions client/src/containers/auth/confirm-email/form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useParams, useRouter, useSearchParams } from "next/navigation";
import { zodResolver } from "@hookform/resolvers/zod";
import { TOKEN_TYPE_ENUM } from "@shared/schemas/auth/token-type.schema";
import { RequestEmailUpdateSchema } from "@shared/schemas/users/request-email-update.schema";
import { useQuery } from "@tanstack/react-query";
import { useSuspenseQuery } from "@tanstack/react-query";
import { z } from "zod";

import { client } from "@/lib/query-client";
Expand Down Expand Up @@ -52,7 +52,7 @@ const NewPasswordForm: FC = () => {
data: isValidToken,
isFetching,
isError,
} = useQuery({
} = useSuspenseQuery({
queryKey: queryKeys.auth.confirmEmailToken(params.token).queryKey,
queryFn: () => {
return client.auth.validateToken.query({
Expand Down Expand Up @@ -105,15 +105,13 @@ const NewPasswordForm: FC = () => {
<CardTitle className="text-xl font-semibold">
Confirm your email
</CardTitle>
<CardDescription className="text-muted-foreground">
{!isValidToken ? (
{!isValidToken && (
<CardDescription className="text-muted-foreground">
<p className="text-sm text-destructive">
The token is invalid or has expired.
</p>
) : (
<p>To create your account please fill in the details bellow.</p>
)}
</CardDescription>
</CardDescription>
)}
</CardHeader>
<CardContent>
<Form {...form}>
Expand Down

0 comments on commit 4f26e71

Please sign in to comment.