Skip to content

Christopher d'Arcy Contact List Eval#26

Open
cmdarcy wants to merge 34 commits into
projectshft:mainfrom
cmdarcy:main
Open

Christopher d'Arcy Contact List Eval#26
cmdarcy wants to merge 34 commits into
projectshft:mainfrom
cmdarcy:main

Conversation

@cmdarcy
Copy link
Copy Markdown

@cmdarcy cmdarcy commented Feb 28, 2025

No description provided.

*/
function ContactRow({ name, email, imgURL, phoneNum, id }) {
const [imageSrc, setImageSrc] = useState(imgURL);
const fallbackImageURL = '/defaultProfileIconSmall.png';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

no need to define this each time ContactRow is called

Comment thread app/utils/validateForm.js
Comment on lines +10 to +11
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
const phoneRegex = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

same, define them outside of the function

Comment thread app/utils/validateForm.js
invalidPhone: 'Phone Number is invalid. Should be in the form ###-###-####',
};

if (testName.trim() === '' || testPhoneNum.trim() === '') {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

love this

*
* @returns {number} A randomly generated ID
*/
function generateId() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can be in utils

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