-
Notifications
You must be signed in to change notification settings - Fork 21
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
[한수진] Sprint9 #120
Merged
GANGYIKIM
merged 10 commits into
codeit-bootcamp-frontend:Next-한수진
from
minim1nh:Next-한수진-sprint9
Oct 31, 2024
The head ref may contain hidden characters: "Next-\uD55C\uC218\uC9C4-sprint9"
Merged
[한수진] Sprint9 #120
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
93a0e93
chore: 머지 후 브랜치 삭제 github action 추가
withyj-codeit b2e37bd
reset
hanseulhee 6f8bbb0
Merge branch 'codeit-bootcamp-frontend:main' into main
hanseulhee e11e25f
fix: 머지 후 브랜치 삭제 github action 수정
hanseulhee 212e864
env: workflows 폴더로 이동
hanseulhee 4dc5dd0
Merge pull request #237 from hanseulhee/fix-github-actions
withyj-codeit bf0e449
sprint9
5d35acd
이름 변경
6ec7e56
nodemodule삭제
3dcfe65
Merge branch 'Next-한수진' into Next-한수진-sprint9
minim1nh 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
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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,40 @@ | ||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
# or | ||
bun dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. | ||
|
||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. | ||
|
||
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. | ||
|
||
## Learn More | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
|
||
## Deploy on Vercel | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. |
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,47 @@ | ||
import Link from 'next/link'; | ||
import styles from '@/styles/ArticleList.module.css'; | ||
import Medal from '@/image/ic_medal.svg'; | ||
import Heart from '@/image/ic_heart.svg'; | ||
|
||
export default function ArticleList({ articles = [] }) { | ||
return ( | ||
<ul className={styles.articleList}> | ||
{articles.map((article) => ( | ||
<li key={article.id}> | ||
<Link className={styles.article} href={`/boards/${article.id}`}> | ||
<div className={styles.topBanner}> | ||
<Medal /> | ||
<h4 className={styles.best}>Best</h4> | ||
</div> | ||
<div className={styles.insideSection}> | ||
<div className={styles.firstSection}> | ||
<h3 className={styles.articleContent}>{article.content}</h3> | ||
<img | ||
className={styles.articleImage} | ||
src={article.image} | ||
width="50" | ||
height="50" | ||
alt={article.title} | ||
/> | ||
</div> | ||
<div className={styles.secondSection}> | ||
<div className={styles.firstLikeSection}> | ||
<span className={styles.articleNickname}> | ||
{article.writer.nickname} | ||
</span> | ||
<div className={styles.likeSection}> | ||
<Heart /> | ||
{article.likeCount} | ||
</div> | ||
</div> | ||
<span className={styles.articleUpdate}> | ||
{article.updatedAt.split('T')[0]} | ||
</span> | ||
</div> | ||
</div> | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
); | ||
} |
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 Link from 'next/link'; | ||
import styles from '@/styles/BehindList.module.css'; | ||
import Heart from '@/image/ic_heart.svg'; | ||
import Profile from '@/image/ic_profile.svg'; | ||
|
||
export default function BehindList({ articles = [] }) { | ||
return ( | ||
<ul className={styles.articleList}> | ||
{articles.map((article) => ( | ||
<li key={article.id}> | ||
<Link className={styles.article} href={`/boards/${article.id}`}> | ||
<div className={styles.insideSection}> | ||
<div className={styles.firstSection}> | ||
<h3 className={styles.articleContent}>{article.content}</h3> | ||
<br /> | ||
<img | ||
className={styles.articleImage} | ||
src={article.image} | ||
width="50" | ||
height="50" | ||
alt={article.title} | ||
/> | ||
</div> | ||
<div className={styles.secondSection}> | ||
<div className={styles.firstContain}> | ||
<Profile className={styles.profileIcon} /> | ||
<span className={styles.articleNickname}> | ||
{article.writer.nickname} | ||
</span> | ||
<span className={styles.articleUpdate}> | ||
{article.updatedAt.split('T')[0]} | ||
</span> | ||
</div> | ||
<div className={styles.likeSection}> | ||
<Heart /> | ||
{article.likeCount} | ||
</div> | ||
</div> | ||
</div> | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
); | ||
} |
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,42 @@ | ||
import DropIcon from '@/image/ic_arrow_down.svg'; | ||
import styles from '@/styles/DropDown.module.css'; | ||
import { useState } from 'react'; | ||
|
||
export default function Dropdown({ selectedOption, onChange }) { | ||
const sortOptions = [ | ||
{ value: 'liked', label: '좋아요순' }, | ||
{ value: 'new', label: '최신순' }, | ||
]; | ||
|
||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const handleOptionClick = (value) => { | ||
onChange(value); | ||
setIsOpen(false); | ||
}; | ||
|
||
return ( | ||
<div className={styles.dropDownContainer}> | ||
<div | ||
className={styles.selectedOption} | ||
onClick={() => setIsOpen((prev) => !prev)} | ||
> | ||
{sortOptions.find((option) => option.value === selectedOption)?.label} | ||
<DropIcon className={styles.dropIcon} /> | ||
</div> | ||
{isOpen && ( | ||
<ul className={styles.optionList}> | ||
{sortOptions.map((option) => ( | ||
<li | ||
className={styles.optionValue} | ||
key={option.value} | ||
onClick={() => handleOptionClick(option.value)} | ||
> | ||
{option.label} | ||
</li> | ||
))} | ||
</ul> | ||
)} | ||
</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,11 @@ | ||
import styles from '@/styles/MoreButton.module.css'; | ||
|
||
const MoreButton = ({ onClick }) => { | ||
return ( | ||
<button className={styles.moreButton} onClick={onClick}> | ||
더보기 | ||
</button> | ||
); | ||
}; | ||
|
||
export default MoreButton; |
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,35 @@ | ||
import { useRouter } from 'next/router'; | ||
import { useState } from 'react'; | ||
import SearchIcon from '@/image/ic_search.svg'; | ||
import styles from '@/styles/Search.module.css'; | ||
|
||
export default function SearchForm({ initialValue = '', hideIcon = false }) { | ||
const router = useRouter(); | ||
const [value, setValue] = useState(initialValue); | ||
|
||
function handleChange(e) { | ||
setValue(e.target.value); | ||
} | ||
|
||
function handleSubmit(e) { | ||
e.preventDefault(); | ||
if (!value) { | ||
router.push('/'); | ||
return; | ||
} | ||
router.push(`/search?q=${value}`); | ||
} | ||
|
||
return ( | ||
<form onSubmit={handleSubmit} className={styles.searchForm}> | ||
{!value && <SearchIcon className={styles.searchIcon} />} | ||
<input | ||
className={styles.searchInput} | ||
name="q" | ||
value={value} | ||
onChange={handleChange} | ||
placeholder="검색할 내용을 입력해주세요" | ||
/> | ||
</form> | ||
); | ||
} |
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,38 @@ | ||
function formatDate(date) { | ||
const MM = String(date.getUTCMonth() + 1).padStart(2, '0'); | ||
const dd = String(date.getUTCDate()).padStart(2, '0'); | ||
const YYYY = String(date.getUTCFullYear()); | ||
|
||
return `${YYYY}. ${MM}. ${dd}.`; | ||
} | ||
|
||
const labels = { | ||
sex: { | ||
male: '남자', | ||
female: '여자', | ||
}, | ||
fit: { | ||
small: '작음', | ||
good: '적당함', | ||
big: '큼', | ||
}, | ||
}; | ||
|
||
export default function SizeReviewList({ sizeReviews }) { | ||
return ( | ||
<ul> | ||
{sizeReviews.map((sizeReview) => ( | ||
<li key={sizeReview.id}> | ||
<div> | ||
<div>{formatDate(new Date(sizeReview.createdAt))}</div> | ||
<div> | ||
({labels.sex[sizeReview.sex]} {sizeReview.height}cm 기준){' '} | ||
{sizeReview.size} | ||
</div> | ||
</div> | ||
<div>{labels.fit[sizeReview.fit]}</div> | ||
</li> | ||
))} | ||
</ul> | ||
); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
P2:
key는 필수값으므로 파악하기 쉽게 최상단에 두는 것을 추천드려요.