website refactor
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { ForgotPasswordViewData } from '@/lib/builders/view-data/ForgotPasswordViewDataBuilder';
|
||||
import { ForgotPasswordViewData } from '@/lib/builders/view-data/types/ForgotPasswordViewData';
|
||||
import { ForgotPasswordTemplate } from '@/templates/auth/ForgotPasswordTemplate';
|
||||
import { ForgotPasswordMutation } from '@/lib/mutations/auth/ForgotPasswordMutation';
|
||||
import { ForgotPasswordViewModelBuilder } from '@/lib/builders/view-models/ForgotPasswordViewModelBuilder';
|
||||
@@ -73,7 +73,7 @@ export function ForgotPasswordClient({ viewData }: ForgotPasswordClientProps) {
|
||||
setShowSuccess: (show) => {
|
||||
if (!show) {
|
||||
// Reset to initial state
|
||||
setViewModel(prev => ForgotPasswordViewModelBuilder.build(viewData));
|
||||
setViewModel(() => ForgotPasswordViewModelBuilder.build(viewData));
|
||||
}
|
||||
},
|
||||
}}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import { ForgotPasswordPageQuery } from '@/lib/page-queries/auth/ForgotPasswordPageQuery';
|
||||
import { ForgotPasswordClient } from './ForgotPasswordClient';
|
||||
import { AuthError } from '@/components/ui/AuthError';
|
||||
|
||||
export default async function ForgotPasswordPage({
|
||||
searchParams,
|
||||
@@ -19,12 +20,7 @@ export default async function ForgotPasswordPage({
|
||||
const queryResult = await ForgotPasswordPageQuery.execute(params);
|
||||
|
||||
if (queryResult.isErr()) {
|
||||
// Handle query error
|
||||
return (
|
||||
<div className="min-h-screen bg-deep-graphite flex items-center justify-center">
|
||||
<div className="text-red-400">Failed to load forgot password page</div>
|
||||
</div>
|
||||
);
|
||||
return <AuthError action="forgot password" />;
|
||||
}
|
||||
|
||||
const viewData = queryResult.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user