-
Notifications
You must be signed in to change notification settings - Fork 10
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
[7주차] REDDI 미션 제출합니다. #6
Open
leejin-rho
wants to merge
53
commits into
CEOS-Developers:main
Choose a base branch
from
team-Reddi:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
9f1bd97
init: initial setting
leejin-rho 54a8a25
feat: 페이지 구조 세팅
dhshin98 a14cbe0
feat: Layout setting
dhshin98 2993753
feat: 디렉토리 정리
dhshin98 b12fc10
style: loginBox, 이미지 위치 조정
leejin-rho f11c617
fix: 버튼 height 수정
leejin-rho 08b0c02
feat: home 화면 스타일링, link 설정
leejin-rho 6d889b7
fix: link 연결 버튼 수정, 투표 전 페이지 구현
leejin-rho fc521d5
Merge pull request #1 from team-REDDI/feature/2-vote-page
leejin-rho d820418
style: team, part 기본 스타일 구현
leejin-rho 0e29eb4
style: result페이지 디자인 구현
leejin-rho 1bffba5
fix: result 페이지 간격 수정
leejin-rho 4d5744f
feat: result page router연결
leejin-rho fc51b1e
feat: part, team router 연결
leejin-rho 657ac70
feat: login & signup 페이지 구성
dhshin98 9762af3
style: clicked style 추가
leejin-rho bc82342
feat: part 투표
leejin-rho 6bb577a
Merge pull request #2 from team-REDDI/feature/3-part-vote-page
leejin-rho 5f5c620
Merge pull request #3 from team-REDDI/feature/1-login-page
dhshin98 2384dd4
feat: 로고 클릭시 home 페이지로
dhshin98 680e10a
feat: 로그인 상태 확인
dhshin98 b2eee5d
feat: 회원가입 후 로그인페이지로 라우팅
dhshin98 02f64c8
feat: 로그아웃 버튼
dhshin98 a53db24
Merge pull request #4 from team-REDDI/feature/1-login-page
dhshin98 2c8fadd
feat: baseURL 추가
leejin-rho 40d2e8f
feat: project result get api 연결
leejin-rho f498b2a
Merge pull request #5 from team-REDDI/feature/4-vote-api
leejin-rho 68fd7fd
fix: team결과 style 수정
leejin-rho a0c218b
feat: front, back result API 연결
leejin-rho 1370cbd
feat: team, part voteList api연결
leejin-rho d4075c7
feat: 회원가입 연동
dhshin98 f9ebb07
feat: 로그인 연동
dhshin98 260497d
feat: 로그인 후 userdata 저장
dhshin98 851ea49
Merge pull request #6 from team-REDDI/feature/5-auth-api
dhshin98 6099cda
feat: voteAPI추가
leejin-rho 6a29e8d
Merge pull request #7 from team-REDDI/feature/4-vote-api
leejin-rho a5148ba
fix: isClicked 하나만 되게 수정
leejin-rho 24dd70e
feat: post api
leejin-rho 0d0b200
feat: 비밀번호 제한 추가
dhshin98 27f92ba
Merge pull request #8 from team-REDDI/feature/1-login-page
dhshin98 a92c7f5
fix: 함수 수정
leejin-rho 658d686
feat: 파트장 투표 api
dhshin98 3a6e426
feat: teamvote 구현
leejin-rho fb377be
fix: 숫자값 id->index값으로변경
leejin-rho dfdb600
Merge pull request #9 from team-REDDI/feature/6-vote-api-2
leejin-rho d016337
chore: alert 추가
leejin-rho b22d3b6
Merge pull request #10 from team-REDDI/feature/6-vote-api-2
leejin-rho 6b9536b
fix: key값 추가
leejin-rho ce621ab
fix: key값 추가
leejin-rho d0a2c60
feat: 본인이 속한 팀 투표 불가능
dhshin98 5471d5d
Merge pull request #11 from team-REDDI/feature/6-vote-api-2
dhshin98 5895390
fix: part component이름변경
leejin-rho 83aaab2
style: 가장 표 많이 받은 결과 style변경
leejin-rho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NEXT_PUBLIC_API_URL = 'http://3.34.190.160:8080/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"singleQuote": false, | ||
"semi": true, | ||
"useTabs": false, | ||
"tabWidth": 2, | ||
"trailingComma": "all", | ||
"printWidth": 80 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import client from "./client"; | ||
|
||
export const signIn = async (userData) => { | ||
const response = await client.post("/api/auth/signin", { | ||
username: userData.username, | ||
password: userData.password, | ||
}); | ||
return response.data; | ||
}; | ||
|
||
export const loginUserInfo = async (info) => { | ||
const response = await client.get("/api/member/info", { | ||
headers: { | ||
Authorization: `Bearer ${info.accessToken}`, | ||
}, | ||
}); | ||
return response.data; | ||
}; | ||
|
||
export const signUp = async (userData) => { | ||
const response = await client.post("/api/auth/signup", { | ||
username: userData.username, | ||
password: userData.password, | ||
name: userData.name, | ||
email: userData.email, | ||
teamName: userData.teamName, | ||
part: userData.part, | ||
isVerified: true, | ||
}); | ||
return response.data; | ||
}; | ||
|
||
export const checkUsername = async (username) => { | ||
const response = await client.post("/api/auth/verify/username", { | ||
username: username, | ||
}); | ||
return response.data; | ||
}; | ||
|
||
export const checkEmail = async (email) => { | ||
const response = await client.post("/api/auth/verify/email", { | ||
email: email, | ||
}); | ||
return response.data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import axios from "axios"; | ||
|
||
const client = axios.create({ | ||
baseURL: process.env.NEXT_PUBLIC_API_URL, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 서버 url env로 빼두셨군요! 저희는 하드코딩으로 넣었는데 이렇게 env로 빼두면 나중에 수정하기 좋을 것 같네요~! |
||
withCredentials: true, | ||
}); | ||
|
||
export default client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import client from "./client"; | ||
|
||
//프론트 투표 결과 get | ||
export const getFrontResult = async () => { | ||
const response = await client.get(`/api/partleader/front/result`); | ||
// console.log(response.data); | ||
return response.data.data; | ||
}; | ||
|
||
//백 투표 결과 get | ||
export const getBackResult = async () => { | ||
const response = await client.get(`/api/partleader/back/result`); | ||
// console.log(response.data); | ||
return response.data.data; | ||
}; | ||
|
||
//데모데이 투표 결과 get | ||
export const getProjectResult = async () => { | ||
const response = await client.get(`/api/project/result`); | ||
// console.log(response.data); | ||
return response.data.data; | ||
}; | ||
Comment on lines
+1
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 같은 로직이여서 url을 외부에서 매개변수로 받아서 통일시켜주는 것도 좋을 것 같아요 ㅎㅎ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import client from "./client"; | ||
|
||
//front 투표 리스트 get | ||
export const getFrontList = async () => { | ||
const response = await client.get(`/api/partleader/front`); | ||
//console.log(response.data); | ||
return response.data.data; | ||
}; | ||
|
||
//back 투표 리스트 get | ||
export const getBackList = async () => { | ||
const response = await client.get(`/api/partleader/back`); | ||
// console.log(response.data); | ||
return response.data.data; | ||
}; | ||
|
||
//team 투표 리스트 get | ||
export const getTeamList = async () => { | ||
const response = await client.get(`/api/project`); | ||
// console.log(response.data); | ||
return response.data.data; | ||
}; | ||
|
||
//partleader 투표 | ||
export const voteLeader = async (info) => { | ||
const response = await client.post( | ||
`/api/partleader`, | ||
{ partLeaderId: info.partLeaderId }, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${info.accessToken}`, | ||
}, | ||
}, | ||
); | ||
console.log(response.data); | ||
return response.data.data; | ||
}; | ||
|
||
//partleader 투표 | ||
export const voteTeam = async (info) => { | ||
const response = await client.post( | ||
`/api/project`, | ||
{ projectId: info.projectId }, | ||
|
||
{ | ||
headers: { | ||
Authorization: `Bearer ${info.accessToken}`, | ||
}, | ||
}, | ||
); | ||
//console.log(response.data); | ||
return response.data.data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Head from "next/head"; | ||
//Head Title 바꾸는 컴포넌트 | ||
export default function HeadFunction({ title }) { | ||
return ( | ||
<Head> | ||
<title>{title} page | REDDI</title> | ||
</Head> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import styles from "../styles/Home.module.css"; | ||
import { useState } from "react"; | ||
import { isLogin } from "../utils/atom"; | ||
import { useRecoilState } from "recoil"; | ||
import { useRouter } from "next/router"; | ||
|
||
export default function Layout({ children }) { | ||
const router = useRouter(); | ||
const [isLoginState, setIsLoginState] = useRecoilState(isLogin); | ||
return ( | ||
<> | ||
<div className={styles.headBox}> | ||
<Link href="/"> | ||
<a> | ||
<Image | ||
src="/images/ceosIcon.svg" | ||
width={172} | ||
height={73} | ||
alt="Logo" | ||
/> | ||
</a> | ||
</Link> | ||
|
||
{isLoginState ? ( | ||
<div className={styles.loginBox}> | ||
<button | ||
className={`${styles.buttons} ${styles.loginButton}`} | ||
onClick={() => { | ||
alert("로그아웃 완료"); | ||
setIsLoginState(false); | ||
router.push("/"); | ||
}} | ||
> | ||
로그아웃 | ||
</button> | ||
</div> | ||
) : ( | ||
<div className={styles.loginBox}> | ||
<Link href="/login"> | ||
<button className={`${styles.buttons} ${styles.loginButton}`}> | ||
로그인 | ||
</button> | ||
</Link> | ||
<Link href="/signup"> | ||
<button className={`${styles.buttons} ${styles.signupButton}`}> | ||
회원가입 | ||
</button> | ||
</Link> | ||
</div> | ||
)} | ||
</div> | ||
|
||
<div>{children}</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
} | ||
|
||
module.exports = nextConfig |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
accessToken을 사용하는 api가 많아지면 인스턴스화 할 때 헤더에 붙여줘도 좋을 것 같아요!