Skip to content

Feature/auth#92

Open
mariam123hagras wants to merge 7 commits into
platform/webfrom
feature/auth
Open

Feature/auth#92
mariam123hagras wants to merge 7 commits into
platform/webfrom
feature/auth

Conversation

@mariam123hagras
Copy link
Copy Markdown
Collaborator

No description provided.

@mariam123hagras mariam123hagras changed the base branch from development to platform/web March 1, 2026 19:32
@Salint
Copy link
Copy Markdown
Member

Salint commented Mar 2, 2026

The project seems to not run because of react-hook-form

image

Also, why do we need it?

Copy link
Copy Markdown
Member

@Salint Salint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not put atoms, molecules, organisms, templates, and pages directly in the root of src/. Instead, put them in components/ or ui/ to clean up the code.

Additionally, a lot of the code was overengineered, and was written by AI. There's much simpler and easier approaches.

Comment thread web/src/styled.d.ts Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why create a definitions file?

Comment thread web/src/App.tsx
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change the routing? Use createBrowserRouter. It's the newer and recommended way to do routing using react-router.

Comment thread web/src/templates/AuthLayout.tsx Outdated
<Page>
<Card>
<Logo subtitle={subtitle} />
<ContentArea>{children}</ContentArea>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use <Outlet /> with layouts.

Comment thread web/src/index.css Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this file deleted?

Comment thread web/src/styles/theme.ts Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a global index.css file with our colors like in index.css.

Comment thread web/src/molecules/RegisterForm.tsx Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A form is not a molecule, its an organism.

Comment thread web/src/types/index.ts Outdated
Comment on lines +9 to +18
export interface AuthContextType {
user: User | null
loading: boolean
error: string | null
loginWithEmail: (email: string, password: string) => Promise<void>
registerWithEmail: (email: string, password: string) => Promise<void>
loginWithGoogle: () => Promise<void>
logout: () => Promise<void>
clearError: () => void
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does a context have a type?

Comment thread web/src/lib/firebase/firebase.ts Outdated
export const auth = getAuth(app);
export const db = getFirestore(app);
export const analytics = getAnalytics(app);
export const googleProvider = new GoogleAuthProvider();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The google provider does not belong here. Imagine if we had a lot of providers.

Comment thread web/src/atoms/PrivacyNote.tsx Outdated
export const PrivacyNote: React.FC = () => (
<Text>
By continuing, you agree to our{' '}
<a href="#" target="_blank" rel="noopener noreferrer">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread web/src/context/AuthContext.tsx Outdated
Comment on lines +15 to +34
function mapFirebaseError(error: FirebaseError): string {
switch (error.code) {
case 'auth/user-not-found':
case 'auth/wrong-password':
case 'auth/invalid-credential':
return 'Invalid email or password.'
case 'auth/email-already-in-use':
return 'This email is already registered.'
case 'auth/weak-password':
return 'Password must be at least 6 characters.'
case 'auth/invalid-email':
return 'Please enter a valid email address.'
case 'auth/too-many-requests':
return 'Too many attempts. Please try again later.'
case 'auth/popup-closed-by-user':
return 'Google sign-in was cancelled.'
default:
return 'An unexpected error occurred. Please try again.'
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be handled in the context.

@mariam123hagras
Copy link
Copy Markdown
Collaborator Author

no promlem , i will maintain what u requested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants