-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[김미소]Week7 #313
The head ref may contain hidden characters: "part2-\uAE40\uBBF8\uC18C-week7"
[김미소]Week7 #313
Conversation
[Fix] delete merged branch github action
'emailErrorMessage','passwordErrorMessage'를 추가하여, 'validateEmail','validatePassword'에서 에러메세지 기능을 따로 분리하였습니다.
- 분리되어있던 validation.js 파일 삭제, signin, signup 파일에 추가하여 작업 - accessToken 받아, 로그인, 회원가입 떄 확인하고 접근 못하게 accessControl.js 파일 작업(수정 중)
- 로그인, 회원가입시 성공하면 토근을 로컬스토리지에 저정 - 액세스 토큰의 유무 여부로 로그인, 회원가입 페이지 접근 제어하는 로직 추가
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다 :)
{ | ||
"liveServer.settings.port": 3001 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
라이브 서버 세팅은 보통 git 에 올리지는 않습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저번 주에 멘토링 때 잘못말씀드렸었던 부분이에요! src > assets 내부로 옮겨주세요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엇 저는 좋긴한데 ts 를 쓰셨네요! 크게 상관은 없을 거 같습니다!
|
||
<FootSocial className="d__flex foot__btn__sns"> | ||
{imageSnsArr.map((sns) => ( | ||
<SocialLinkButton key={sns.id} {...sns} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
(async () => { | ||
try { | ||
const data = await headerUserLoginInfo(); | ||
setUserInfo(data); | ||
} catch (e) { | ||
console.error("유저 정보를 가지고 올수 없습니다.", e); | ||
} | ||
})(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
즉시실행함수로 쓰지 않으시고, 따로 비동기 함수로 빼신 다음 useEffect 에서 해당 함수를 호출하는 식으로 짜시면 더 간결할 거 같아요!
{description} | ||
</EllipsisLine> | ||
<p className="card__date"> | ||
{new Date(`${created_at}`).toLocaleString()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 로직이 return 부에 있으면 계속 렌더링 타게 되어서 useMemo 써서 위쪽에서 변수로 내려주면 좋을 거 같아요~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constant 는 정말 상수를 모아두는 곳이라 지금처럼 api 통신을 하는 함수들을 모아두기 위해서는 따로 그냥 api 폴더를 파시는 것도 괜찮을 거 같아요~!
export async function folderListApi() { | ||
try { | ||
const response = await fetch("dummy.json"); | ||
const result = response.json(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const result = response.json(); | |
const result = await response.json(); |
try { | ||
const response = await fetch("dummy.json"); | ||
const result = response.json(); | ||
if(response.ok) { | ||
return result; | ||
} | ||
} catch (e) { | ||
console.log(e); | ||
return ; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
headerUserLoginInfo 와 앞으로도 전부 동일하다면 따로 api 통신하는 함수를 빼주시고 url 만 파라미터로 받아도 좋을 거 같아요!
if (minutesDifference < 2) { | ||
return "1 minute ago"; | ||
} else if (minutesDifference <= 59) { | ||
return `${minutesDifference} minutes ago`; | ||
} else if (hoursDifference === 1) { | ||
return "1 hour ago"; | ||
} else if (hoursDifference <= 23) { | ||
return `${hoursDifference} hours ago`; | ||
} else if (daysDifference === 1) { | ||
return "1 day ago"; | ||
} else if (daysDifference <= 30) { | ||
return `${daysDifference} days ago`; | ||
} else if (monthsDifference === 1) { | ||
return "1 month ago"; | ||
} else if (monthsDifference <= 11) { | ||
return `${monthsDifference} months ago`; | ||
} else if (yearsDifference === 1) { | ||
return "1 year ago"; | ||
} else { | ||
const years = Math.floor(yearsDifference); | ||
return `${years} years ago`; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (minutesDifference < 2) { | |
return "1 minute ago"; | |
} else if (minutesDifference <= 59) { | |
return `${minutesDifference} minutes ago`; | |
} else if (hoursDifference === 1) { | |
return "1 hour ago"; | |
} else if (hoursDifference <= 23) { | |
return `${hoursDifference} hours ago`; | |
} else if (daysDifference === 1) { | |
return "1 day ago"; | |
} else if (daysDifference <= 30) { | |
return `${daysDifference} days ago`; | |
} else if (monthsDifference === 1) { | |
return "1 month ago"; | |
} else if (monthsDifference <= 11) { | |
return `${monthsDifference} months ago`; | |
} else if (yearsDifference === 1) { | |
return "1 year ago"; | |
} else { | |
const years = Math.floor(yearsDifference); | |
return `${years} years ago`; | |
} | |
if (minutesDifference <= 59) { | |
return `${minutesDifference} minute${minutesDifference < 2 ? '' : 's'} ago`; | |
} | |
if (hoursDifference <= 23) { | |
return `${hoursDifference} hour${hoursDifference < 2 ? '' : 's'} ago`; | |
} | |
if (daysDifference <= 30) { | |
return `${daysDifference} day${daysDifference < 2 ? '' : 's'} ago`; | |
} | |
if (monthsDifference <= 11) { | |
return `${monthsDifference} month${monthsDifference < 2 ? '' : 's'} ago`; | |
} | |
const years = Math.floor(yearsDifference); | |
return `${years} year${years < 2 ? '' : 's'} ago`; | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추가적으로 현재 코드라면 1년 2분 전이면 2분 전이라고 뜨게될 거 같은데, 해당 부분 확인해주세요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://date-fns.org/v3.3.1/docs/formatDistance 이것도 활용할 수 있을 거 같아요~
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게