Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
|
|
||
|
|
||
| export let analytics; | ||
| if (typeof window !== 'undefined') { |
There was a problem hiding this comment.
Try to convert this code into async await just like we are doing inside the entire code base
| // validator: passwordValidation, | ||
| // }, | ||
| { | ||
| label: "Password", |
There was a problem hiding this comment.
Check with one of the other mentors that this is ok to un-comment
| return parsedData; | ||
| } catch (error) {} | ||
| const parsed = parseCsv(csvData); | ||
| console.log('[useSheets] parsed rows:', parsed.length, parsed.slice(0, 3)); |
| console.log('[useSheets] parsed rows:', parsed.length, parsed.slice(0, 3)); | ||
| return parsed; | ||
| } catch (error) { | ||
| console.error('[useSheets] fetch failed:', error); |
|
|
||
| const parseCsv = (csvData) => { | ||
| return csvData.split('\n').map((row) => row.split(/","/)); | ||
| return csvData |
There was a problem hiding this comment.
Check if we can parse the file something like this :
return data.split(/n).map((row) => row.split(/","/)| queryKey: ['googleSheetsData'], | ||
| queryFn: fetchDataFromCsv, | ||
| refetchOnWindowFocus: false, | ||
| staleTime: 5 * 60 * 1000, |
There was a problem hiding this comment.
The magic number should be saved inside a const variable
For example:
const VARIABLE_NAME = 5
And so on
| import Avatar from '@mui/material/Avatar'; | ||
| import { useCreateUser } from 'src/hooks/firebase.hooks'; | ||
|
|
||
| // ✅ ייבוא ישיר לבדיקה יעילה ב-Firestore |
|
|
||
| const createUser = useCreateUser(); | ||
|
|
||
| const onSignupHandler = async () => { |
There was a problem hiding this comment.
Check if you can push your changed into smaller helper function
| if (!rules) return; | ||
|
|
||
| try { | ||
| const emailToCheck = String(formValues.email || '').trim().toLowerCase(); |
There was a problem hiding this comment.
use existing validations, also the formValues should already contain valid email because otherwise we cannot validate the form - check it
| if (!emailToCheck) return; | ||
|
|
||
| if (validationState[key]) { | ||
| const q = query( |
There was a problem hiding this comment.
This entire part could be extracted into a service that handles all of the users.
| paddingBottom: '3rem', | ||
|
|
||
| }} | ||
| sx={{ paddingTop: '3rem', paddingBottom: '3rem' }} |
There was a problem hiding this comment.
Generally its not recommended to mix inline style into the jsx.
You can use external file to save those styles.
| })} | ||
| </Box> | ||
|
|
||
| {/* מודל הצלחה */} |
| fieldOfStudy: '', | ||
| }); | ||
|
|
||
| const setField = (key) => (e) => setForm((p) => ({ ...p, [key]: e.target.value })); |
There was a problem hiding this comment.
Do you think we can have a better name for this ? p is a bit confusing in this context
| const q = query( | ||
| collection(db, COLLECTION), | ||
| where('email', '==', normalized.email), | ||
| limit(1) | ||
| ); |
There was a problem hiding this comment.
This should come from the user service that we talked about before
Creating this pr for noam for cr