Skip to content

[#63] 댓글 컴포넌트 껍데기#65

Open
haeunkim428 wants to merge 7 commits into
developfrom
issue/63
Open

[#63] 댓글 컴포넌트 껍데기#65
haeunkim428 wants to merge 7 commits into
developfrom
issue/63

Conversation

@haeunkim428

@haeunkim428 haeunkim428 commented Apr 10, 2021

Copy link
Copy Markdown
Contributor
  • form 꽉 차게 하는 방법 아시는 분...!

Comment thread components/Comment/AuthorComment.tsx Outdated
Comment on lines +12 to +24
function AuthorComment({ content, author, created }: AuthorCommentProps) {
// Todo : form 요소 크기
return (
<VerticalMiddleDiv>
<StyledCommentThumbnail>
<StyledAtag href={`instagram.com/${author.displayId}`}>
<StyledImg src={author.profileImageUrl} alt={`${author.displayId} 님의 프로필 사진`} />
</StyledAtag>
</StyledCommentThumbnail>
<InlineDiv>
<div>
<InlineH3>
<StyledAtag href={`/instagram.com/${author.displayId}`}> {author.displayId}</StyledAtag>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
function AuthorComment({ content, author, created }: AuthorCommentProps) {
// Todo : form 요소 크기
return (
<VerticalMiddleDiv>
<StyledCommentThumbnail>
<StyledAtag href={`instagram.com/${author.displayId}`}>
<StyledImg src={author.profileImageUrl} alt={`${author.displayId} 님의 프로필 사진`} />
</StyledAtag>
</StyledCommentThumbnail>
<InlineDiv>
<div>
<InlineH3>
<StyledAtag href={`/instagram.com/${author.displayId}`}> {author.displayId}</StyledAtag>
function AuthorComment({ content, author: { displayId, profileImageUrl }, created }: AuthorCommentProps) {
// Todo : form 요소 크기
return (
<VerticalMiddleDiv>
<StyledCommentThumbnail>
<StyledAtag href={`instagram.com/${displayId}`}>
<StyledImg src={profileImageUrl} alt={`${displayId} 님의 프로필 사진`} />
</StyledAtag>
</StyledCommentThumbnail>
<InlineDiv>
<div>
<InlineH3>
<StyledAtag href={`/instagram.com/${displayId}`}> {displayId}</StyledAtag>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

와 맞네 짱이다

Comment thread components/Comment/CommentBody.tsx Outdated
Comment on lines +22 to +28
const putLike = () => {
if (like) {
setLike(false);
} else {
setLike(true);
}
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

const toggleLike = useCallback(() => {
setLike((prev) => !prev);
}, []);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

아따 급나게 깔쌈해부러잉

Comment thread components/Comment/CommentThumbnail.tsx Outdated
function CommentThumbnail({ author }: CommentThumbnailProps) {
return (
<StyledCommentThumbnail>
<a href={`instagram.com/${author.displayId}`}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

next js에서 a 태그로 이동시 csr로 동작하지 않습니다.
nextjs의 Link를 확인해보세요.

https://nextjs.org/docs/api-reference/next/link

@haeunkim428 haeunkim428 Apr 11, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

<Link href=~~> <a> </a> <Link>

로 수정했습니다!

Comment thread components/Comment/Created.tsx Outdated
Comment on lines +10 to +40
const createdTime = new Date(currentTime);
const now = new Date(Date.now());
// @ts-ignore
const millisecond = now - createdTime;
const convertedSecond = Math.floor(millisecond / 1000);
const convertedMinute = Math.floor(convertedSecond / 60);
const convertedHour = Math.floor(convertedMinute / 60);
const convertedDay = Math.floor(convertedHour / 24);
const convertedWeek = Math.floor(convertedDay / 7);
const convertedMonth = Math.floor(convertedDay / 30);
const convertedYear = Math.floor(convertedDay / 365);

let created;

if (convertedYear >= 1) {
created = `${convertedYear}년`;
} else if (convertedMonth >= 1) {
created = `${convertedMonth}월`;
} else if (convertedWeek >= 1) {
created = `${convertedWeek}주`;
} else if (convertedDay >= 1) {
created = `${convertedDay}일`;
} else if (convertedHour >= 1) {
created = `${convertedHour}시간`;
} else if (convertedMinute >= 1) {
created = `${convertedMinute}분`;
} else if (convertedSecond >= 1) {
created = `${convertedSecond}초`;
} else {
created = '지금';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

date 관련해서는 date-fns 같은 라이브러리를 사용할 예정입니다.
또한 여러곳에서 쓰일수 있는 기능은 utils에 작성해 주세요.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

완료!

@kdongha kdongha self-requested a review April 11, 2021 15:58
@kdongha kdongha requested review from Dinoryong and HyeonHak April 15, 2021 13:20
@Dinoryong Dinoryong removed request for HyeonHak and kdongha July 3, 2021 12:10
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