Skip to content
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

[5주차] diaMEtes 미션 제출합니다. #7

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0722d1d
[Set] create-next-app
seondal Nov 8, 2022
e7aa6c5
chore : 폴더 구조 변경
heeeesoo Nov 9, 2022
718b2ef
feat : footer 기능
heeeesoo Nov 10, 2022
26cb3e0
feat : footer에 router 추가
heeeesoo Nov 10, 2022
86f634d
test : home 페이지에 movie api 적용해보기
heeeesoo Nov 10, 2022
b6bd0be
feat : nowPlayingMovies api data 불러오기 테스트
heeeesoo Nov 11, 2022
e2b5931
feat : nowPlaying에 movie image 추가
heeeesoo Nov 11, 2022
cbe7100
feat : home 페이지에 top rated movie list 추가
heeeesoo Nov 11, 2022
d889118
feat : popular movie 홈페이지에 추가
heeeesoo Nov 11, 2022
eab70b3
chore : home 페이지 스타일 수정
heeeesoo Nov 11, 2022
1d51cca
feat : home 페이지 중간 바 추가
heeeesoo Nov 11, 2022
208ff67
feat : header 추가
heeeesoo Nov 11, 2022
88bc19d
fix : 화면 상단 맞추기
heeeesoo Nov 11, 2022
9d574c0
fix : 사진 배경으로 옮김
heeeesoo Nov 11, 2022
2af09da
Merge pull request #1 from diaFEtes/heeeesoo
heeeesoo Nov 11, 2022
52bf317
feat : get top rated movies
seondal Nov 11, 2022
b7750ac
feat : 검색페이지 -> 상세페이지 연결
seondal Nov 11, 2022
dd7bfa4
feat : 상세페이지 구현
seondal Nov 11, 2022
9d65c0c
refact : search 페이지 getServerSideProps()
seondal Nov 11, 2022
da0101b
refact : movies api
seondal Nov 11, 2022
137a270
refact : home 페이지 getServerSideProps 방식 변경
seondal Nov 11, 2022
8a14858
refact : 폴더 구조 변경 & fix : 푸터 새로고침시 스타일 적용 안되는 오류 수정
seondal Nov 11, 2022
b39d18b
del : 불필요한 import 삭제
seondal Nov 11, 2022
9e44cd5
del Layout.tsx
seondal Nov 11, 2022
a5f5075
fix : 로고 화면에서 푸터가 보이는 현상 제거
seondal Nov 11, 2022
86a466b
refact : styled-component 전부 삭제 -> <style jsx/> 형식으로 변경
seondal Nov 11, 2022
133e534
style : Layout style 설정
seondal Nov 11, 2022
ca96436
edit : footer styled-components 삭제
seondal Nov 11, 2022
190afad
Feat : 메인페이지 -> 영화 상세 페이지 연결
seondal Nov 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
779 changes: 777 additions & 2 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"next": "13.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"styled-components": "^5.3.6",
"typescript": "4.8.4"
},
"devDependencies": {
Expand Down
Binary file added public/img/Footer/Comingsoon-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Footer/Comingsoon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Footer/Downloads-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Footer/Downloads.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Footer/Home-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Footer/Home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Footer/More-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Footer/More.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Footer/Search-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Footer/Search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions src/assets/FooterInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"id":0,
"name":"Home",
"alt":"home"
},
{
"id":1,
"name":"Search",
"alt":"search"
},
{
"id":2,
"name":"Comingsoon",
"alt":"comingsoon"
},
{
"id":3,
"name":"Downloads",
"alt":"downloads"
},
{
"id":4,
"name":"More",
"alt":"more"
Copy link
Member

Choose a reason for hiding this comment

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

오.. JSON으로 저장해서 불러오는거 진짜 좋은 거 같아요 다음번에 참고해야겠습니다.
저희는 react-icon으로 일일이 불러와서 사용했어요!

Copy link
Member

Choose a reason for hiding this comment

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

헉 이렇게 json 파일로 만들어 두는 방식 진짜 깔끔하네요!!...

}
]
43 changes: 43 additions & 0 deletions src/components/common/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import styled from 'styled-components';
import FooterItem from './FooterItem';
import FooterInfo from "../../assets/FooterInfo.json"
import { useRouter } from "next/router";

export default function Footer(){
const router = useRouter();
const footerInfo = FooterInfo;

return(
<Container>
{
footerInfo.map((f)=>{
const select = router.pathname === '/'+f.alt;
Copy link
Member

Choose a reason for hiding this comment

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

오 이부분 어떻게 해야할지 고민이 많았는데 간단히 해결하셨군요!! 능력자

return (
<FooterItem
key={f.id}
alt={f.alt}
name={f.name}
selected = {select}
/>
)
})
}
</Container>
);
};

const Container = styled.div`
position : fixed;

// 중앙 정렬
left: 50%;
transform: translate(-50%, 0);

bottom: 0;

width: 375px;
height: 48px;

display: flex;
justify-content: space-evenly;
`
50 changes: 50 additions & 0 deletions src/components/common/FooterItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { IFooter } from "../../interfaces/interface"
import Image from 'next/image';
import styled from 'styled-components';
import { useRouter } from "next/router";
import { useEffect, useState } from "react";

export default function FooterItem({alt,name,selected}:IFooter){
let src = '';
if (selected){
src = '/img/Footer/'+name+'.png'
}else{
src = '/img/Footer/'+name+'-2.png'
}

return (
<Container>
<StyledButton select = {selected}>
<Image
alt={alt}
src={src}
width={25}
height={25}
/>
<StyledFont>
{name}
</StyledFont>
</StyledButton>
</Container>
)
}

const Container = styled.div`
display: flex;
flex-direction: column;
align-items: center;
`

const StyledFont = styled.div`
font-size: 8.2px;
`

const StyledButton = styled.button<{select : boolean}>`
border: 0;
outline: 0;
background: black;
color: #8C8787;
color: ${
({select}) => (select? 'white' : '#8C8787')
}
`
5 changes: 5 additions & 0 deletions src/interfaces/interface.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface IFooter{
alt: string;
name: string;
selected: boolean;
}
19 changes: 16 additions & 3 deletions src/pages/home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import Footer from "../../components/common/Footer"
import styled from 'styled-components'

export default function Home(){
return (
<>
<Container>
home
</>
<Footer/>
</Container>
)
};
};

const Container = styled.div`
background: blue;
display: flex;
justify-content: center;
align-items: center;
width: 375px;

`