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

feat(main): Add main page #152

Closed
wants to merge 15 commits into from
Closed

feat(main): Add main page #152

wants to merge 15 commits into from

Conversation

Jay-WKJun
Copy link

@Jay-WKJun Jay-WKJun commented Oct 3, 2023

๐Ÿ“Œ ์ด์Šˆ ๋งํฌ


๐Ÿ“– ์ž‘์—… ๋ฐฐ๊ฒฝ

๋ฉ”์ธํŽ˜์ด์ง€๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

client side์˜ interaction์€ ์ถ”ํ›„์— ์ถ”๊ฐ€ํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค. (with react-query)

์•„์ง login ๋กœ์ง์ด ์—†์–ด login ์—ฌ๋ถ€์— ๋”ฐ๋ฅธ header์˜ ๋‚ด์šฉ ๋ณ€ํ™”๋Š” ์•„์ง ๊ตฌํ˜„ํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.


๐Ÿ› ๏ธ ๊ตฌํ˜„ ๋‚ด์šฉ

  • Server component๋ฅผ ์ด์šฉํ•ด data๋ฅผ fetchํ•ด ๊ทธ๋ ธ์Šต๋‹ˆ๋‹ค.
  • Vanilla Extract๋ฅผ ์‚ฌ์šฉํ•ด style์„ ์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ’ก ์ฐธ๊ณ ์‚ฌํ•ญ


๐Ÿ–ผ๏ธ ์Šคํฌ๋ฆฐ์ƒท


Copy link

@milkboy2564 milkboy2564 left a comment

Choose a reason for hiding this comment

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

๊ฒฝ์ค€๋‹˜ ๊ณ ์ƒ ๋งŽ์œผ์…จ์Šต๋‹ˆ๋‹ค!
์ €๋Š” vanila extract ์ ์šฉ์„ ๋ฏธ๋ค„๋’€๋Š”๋ฐ ๋Œ€๋‹จํ•˜์‹ญ๋‹ˆ๋‹ค.. ใ…Žใ…Ž

์ฝ”๋“œ ๋„ˆ๋ฌด ์ž˜๋ดค๊ณ  ๊ถ๊ธˆํ•œ๊ฑฐ ๋ช‡๊ฐœ ์ ์–ด๋†จ์–ด์šฉ!!

++
์ ๊ณ  ๋‚˜๋‹ˆ ํšŒ์‚ฌ ๊ณ„์ •์ด์—ˆ๋„ค์š”.. @SeolJaeHyeok ์ด๊ฑธ๋กœ ํ–ˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ด์ฃผ์„ธ์š”..

import React, { Suspense } from 'react';

import { ArticleSummary } from '@/components';
import { ArticlesApi } from '@/gen';

Choose a reason for hiding this comment

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

NIT: /gen ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ git ignore ์‹œ์ผœ์ฃผ์‹ ๊ฑฐ ๊ฐ™์€๋ฐ ํ˜น์‹œ ์ด์œ ๊ฐ€ ๋ฌด์—‡์ธ์ง€ ๊ถ๊ธˆํ•ด์š”!

Copy link
Author

Choose a reason for hiding this comment

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

gen ๋ถ€๋ถ„์€ ๋ฒ„์ „์— ๋”ฐ๋ผ ๋ณ€๊ฒฝ์ด ์žˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ, node_modules์ฒ˜๋Ÿผ gitignore๋กœ ๊ด€๋ฆฌํ•ด์ฃผ๋Š”๊ฒŒ ์ตœ์„ ์ด๋ผ๊ณ  ์ƒ๊ฐํ–ˆ์Šต๋‹ˆ๋‹ค.

Comment on lines +12 to +23
<Suspense>
<section>
{articles.map((article) => {
return (
<ArticleSummary
key={`${article.title}-${article.author}-${article.createdAt}`}
article={article}
/>
);
})}
</section>
</Suspense>

Choose a reason for hiding this comment

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

ArticleSummary ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋ณด๋‹ˆ Suspense๊ฐ€ ๊ฐ์ง€ํ• ๋งŒํ•œ ๋น„๋™๊ธฐ ์ฒ˜๋ฆฌ๊ฐ€ ์—†๋Š”๊ฑฐ ๊ฐ™์€๋ฐ ์š” ๋ถ€๋ถ„์ด ์ œ๋Œ€๋กœ ๋™์ž‘ํ•˜๋Š”๊ฑธ๊นŒ์š”?!?

Copy link
Author

Choose a reason for hiding this comment

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

์•„ ๋„ต ใ…Žใ…Žใ…Ž ๊ทธ ๋ถ€๋ถ„์€ ์ƒ๊ฐํ•˜์ง€ ์•Š๊ณ  ์šฐ์„  Suspense๋งŒ ๊ฑธ์–ด๋’€์Šต๋‹ˆ๋‹ค. ใ…Žใ…Ž

const feeds = (await articleApi.getArticles()).articles;

return (
<Suspense>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Server Component๋กœ Suspense๋ฅผ ์‚ฌ์šฉํ•˜์…จ๋Š”๋ฐ Next App Router์—์„œ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ œ๊ณตํ•ด์ฃผ๋Š” Loading ์ปดํฌ๋„ŒํŠธ์™€๋Š” ์–ด๋–ป๊ฒŒ ์ž˜ ์กฐํ•ฉํ•  ์ˆ˜ ์žˆ์„๊นŒ์š”.

Copy link
Author

Choose a reason for hiding this comment

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

์•„,,, ์†”์งํžˆ ๋ง์”€๋“œ๋ฆฌ๋ฉด ์ €๋„ ์•„์ง ์ž˜ ์‚ฌ์šฉํ•  ์ˆ˜๊ฐ€ ์—†์–ด์„œ ๊ทธ๋ƒฅ ๋‘” ์ƒํƒœ์ž…๋‹ˆ๋‹ค ใ… ใ… 

์šฐ์„ ์€ ์—ฌ๊ธฐ์— Suspense๋ฅผ ๋‘˜ ๊ฒƒ์ด๋‹ค! ๋ผ๊ณ  ๋ช…์‹œํ•ด๋‘๋Š” ์ •๋„๋กœ ์ฝ”๋“œ๋งŒ ๋‚˜๋’€์Šต๋‹ˆ๋‹ค.

@@ -14,6 +14,9 @@ importers:
'@vanilla-extract/css':
specifier: ^1.13.0
version: 1.13.0
date-fns:
Copy link
Collaborator

Choose a reason for hiding this comment

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

date-fns์™€ dayjs ๊ฐ€ ์š”์ฆ˜ ๋งŽ์ด ์“ฐ๋Š” ๊ฒƒ ๊ฐ™์€๋ฐ date-fns ์ž์ฃผ ์‚ฌ์šฉํ•˜์‹œ๋‚˜์šฉ

Copy link
Author

Choose a reason for hiding this comment

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

๋„ต ์ „ date-fns ๋งŽ์ด ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. tree-shaking๋„ ์ง€์›ํ•ด์ฃผ๊ณ  ๋ถ€์กฑํ•  ๊ฒƒ ์—†๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ผ๊ณ  ์ƒ๊ฐ๋˜์„œ์š” ใ…Žใ…Ž


ํ•ญ์ƒ ์ƒ๊ฐํ•˜๋ฉด์„œ ๋„ˆ ๋‚˜์€ ๋ฐฉ๋ฒ•๊ณผ ์„ฑ๋Šฅ ์ธก์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ตํžˆ๊ธฐ.

- Vim ์ตํžˆ๊ธฐ
Copy link
Collaborator

Choose a reason for hiding this comment

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

Vim ๐Ÿ‘

Copy link
Author

Choose a reason for hiding this comment

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

Vim ์ •๋ณตํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค ๐Ÿ‘

Comment on lines 22 to 32
<nav className={navBar}>
<h1 className={titleBanner}>
<Link href="/">Conduit</Link>
</h1>
<ul className={headControllers}>
<li className={controlButton}>Home</li>
<li className={controlButton}>New Article</li>
<li className={controlButton}>Setting</li>
<li className={controlButton}>Profile</li>
</ul>
</nav>
Copy link
Collaborator

Choose a reason for hiding this comment

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

NavBar ์ปดํฌ๋„ŒํŠธ๋กœ ๋ถ„๋ฆฌํ•ด์ค˜๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™๋„ค์š”!

Copy link
Author

Choose a reason for hiding this comment

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

70ae394 โœ…

@Jay-WKJun Jay-WKJun self-assigned this Oct 8, 2023
@Seung-wan Seung-wan self-requested a review October 11, 2023 07:32
@Jay-WKJun Jay-WKJun closed this by deleting the head repository Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants