-
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 #272
The head ref may contain hidden characters: "part2-\uC870\uD61C\uC9C4-week7"
[조혜진] Week7 #272
Conversation
[Fix] delete merged branch github action
[조혜진] Week2
[조혜진] Week3
[조혜진] Week4
@@ -0,0 +1,26 @@ | |||
// Article.js | |||
import { useFetch } from './hooks/useFetch'; |
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.
경로 잘못 지정된 것 같습니다~!
@@ -0,0 +1,26 @@ | |||
// Article.js | |||
import { useFetch } from './hooks/useFetch'; | |||
import '../style.css'; |
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.
style.css에서 모든 css를 작성하기 보다는 컴포넌트별로 css 파일을 작성하는 것이 좋습니다.
react의 css module에 대해서 알아보시면 컴포넌트 별 스타일을 작성하시는데 도움이 되실거에요!
const folderData = useFetch('https://bootcamp-api.codeit.kr/api/sample/folder'); | ||
|
||
// 날짜 형식 변경 함수 | ||
const formatDate = (dateString) => { |
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.
날짜 형식에 대한 함수는 공통으로 사용될 수 있으니 utils 폴더를 만들어 작성하면 좋을 것 같습니다~!
// Cards.js | ||
import { useFetch } from '../hooks/useFetch'; | ||
import { Link } from 'react-router-dom'; | ||
import moment from 'moment'; |
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.
moment를 사용하셨네요 잘하셨습니다!
const months = Math.floor(timeDiff / (60 * 24 * 30)); | ||
return months === 1 ? '1 month ago' : `${months} months ago`; | ||
} | ||
const years = Math.floor(timeDiff / (60 * 24 * 30 * 12)); |
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.
60, 24, 30, 12 는 상수로 작성해서 사용하면 더 알기 쉬울 것 같습니다!
{generateTimeText(link.createdAt)} | ||
</p> | ||
</div> | ||
<div className="card_txt_div_body"> |
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.
여기도 굳이 p태그를 감싸야할 이유가 있으신가요??
불필요한 태그 중첩은 가독성이 오히려 떨어지기 때문에 필요한 요소만 작성해주시는 것이 좋습니다!
return ( | ||
<header className="navbar"> | ||
<Link to="/" className="logo"> | ||
<img src={logo} width="133" height="24" alt="logo" /> |
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.
logo 보다는 "Linkbrary" 텍스트를 넣어주는 것이 접근성 측면에서 더 좋겠죠??
이 내용도 멘토링 시간에 얘기나눌게요!
// useFetch.js | ||
import { useState, useEffect } from 'react'; | ||
|
||
export function useFetch(url) { |
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.
데이터를 가져오는 훅을 잘 만들으셨네요! 👍
import '../style.css'; | ||
|
||
function Article() { | ||
const folderData = useFetch('https://bootcamp-api.codeit.kr/api/sample/folder'); |
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.
baseurl 을 constants 폴더를 만들어 상수로 분리해서 사용하면 좋을 것 같습니다!
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
<title>Linkbrary</title> | ||
`````` |
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.
이 텍스트는 왜 들어간걸까요??🤔
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게