Conversation
Salint
left a comment
There was a problem hiding this comment.
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.
web/src/styled.d.ts
Outdated
There was a problem hiding this comment.
Why did you change the routing? Use createBrowserRouter. It's the newer and recommended way to do routing using react-router.
web/src/templates/AuthLayout.tsx
Outdated
| <Page> | ||
| <Card> | ||
| <Logo subtitle={subtitle} /> | ||
| <ContentArea>{children}</ContentArea> |
web/src/index.css
Outdated
web/src/styles/theme.ts
Outdated
There was a problem hiding this comment.
Use a global index.css file with our colors like in index.css.
web/src/molecules/RegisterForm.tsx
Outdated
There was a problem hiding this comment.
A form is not a molecule, its an organism.
| 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 | ||
| } |
| export const auth = getAuth(app); | ||
| export const db = getFirestore(app); | ||
| export const analytics = getAnalytics(app); | ||
| export const googleProvider = new GoogleAuthProvider(); |
There was a problem hiding this comment.
The google provider does not belong here. Imagine if we had a lot of providers.
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"> |
There was a problem hiding this comment.
| 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.' | ||
| } | ||
| } |
There was a problem hiding this comment.
Should not be handled in the context.
|
no promlem , i will maintain what u requested |

No description provided.