-
Notifications
You must be signed in to change notification settings - Fork 0
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
PR: 4주차 과제 - Gang #1
base: main
Are you sure you want to change the base?
Conversation
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 SkeletonMain = () => { | ||
return ( | ||
<S.SkeletonWrapper> | ||
<SkeletonBase $width="200px" $height="300px" /> | ||
</S.SkeletonWrapper> | ||
); | ||
}; | ||
export default SkeletonMain; | ||
|
||
const SkeletonWrapper = styled.div` | ||
width: 200px; | ||
height: 300px; | ||
display: grid; | ||
overflow: hidden; | ||
`; |
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.
불필요하게 컴포넌트가 분리되어 있다고 느껴집니다.
- 일단 SkeletonBase 의 props 전달에 문제가 있어보여요,
$width
->width
로 해야할 것 같습니다. SkeletonMain
는SkeletonBase
의 크기를 조정하는 게 목적인가요?- 그게 맞다면,
SkeletonBase
컴포넌트의 width, height 모두 100% 로 미리 설정하고, 크기와 관련된 props 를 받지 못하도록,,, (저라면 그렇게) 설계할 것 같습니다.!
- 그게 맞다면,
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.
main page에서 사용하기 위한 스켈레톤 컴포넌트 입니다
const ImageLoader = ({ src, sizes, srcSet }) => { | ||
const [loading, setLoading] = useState(true); | ||
|
||
return ( | ||
<Container> | ||
{loading && <SkeletonMain />} | ||
<ImageWrapper> | ||
<Image | ||
alt="image" | ||
fetchPriority="high" | ||
src={src} | ||
sizes={sizes} | ||
srcSet={srcSet} | ||
onLoad={() => setLoading(false)} | ||
/> | ||
</ImageWrapper> | ||
</Container> | ||
); | ||
}; |
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.
👍
이미지 로딩 중 skeleton 출력하는 것과 관련해서, 1조가 이 방법 말고 다른 방법을 찾은게 있습니다.
조금 더 코드가 간결해 지더라구요.! 한번 읽어봐주세요.
load 되지 않는 동안 출력없이 src 에 대한 데이터만 불러오고, 완전히 load 되면 그때 출력하는 방법인 것 같습니다.!
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.
오 신기하네요 적용해보겠습니다!
week4/src/App.js
Outdated
import "./App.css"; | ||
|
||
import { Provider } from "react-redux"; | ||
|
||
import store from "./libs/redux/store"; | ||
import Main from "./page/main"; | ||
import GlobalStyle from "./styles/global-style"; | ||
|
||
function App() { | ||
return ( | ||
<> | ||
<Provider store={store}> | ||
<GlobalStyle /> | ||
<Main /> | ||
</Provider> | ||
</> | ||
); | ||
} | ||
|
||
export default App; |
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.
🙄 불필요한 fragment 가 보입니다.
week4/src/components/common/box.jsx
Outdated
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.
오.. 혹시 이게 headless 인가요?? 😮
Task 1, Task 2, Task 3
Task 4
Task 5
Task 6