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

๐Ÿ› ๏ธ ๋„คํŠธ์›Œํฌ ๋ถˆ์•ˆ์ • ํ† ์ŠคํŠธ ๋ฉ”์‹œ์ง€ ๊ด€๋ฆฌ #47

Merged
merged 17 commits into from
May 11, 2024

Conversation

BangDori
Copy link
Collaborator

@BangDori BangDori commented May 10, 2024

์ž‘์—… ์ด์œ 

#44 ์ด์Šˆ ํ•ด๊ฒฐ


์ž‘์—… ์‚ฌํ•ญ

1๏ธโƒฃ ๋„คํŠธ์›Œํฌ ์—๋Ÿฌ ํ† ์ŠคํŠธ ์ค‘์•™ํ™” ๊ด€๋ฆฌ

  • ์ค‘์•™์—์„œ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋„๋ก ํ† ์ŠคํŠธ ์ปดํฌ๋„ŒํŠธ๋ฅผ App.tsx์—์„œ ์„ ์–ธํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • ์ฟผ๋ฆฌ ๋ฐ ๋ฎคํ…Œ์ด์…˜ ๋„์ค‘ ๋ฐœ์ƒํ•˜๋Š” Success, Error ์— ๋Œ€ํ•œ ์ƒํƒœ๋ฅผ ๋‹ค๋ฃจ๊ธฐ ์œ„ํ•ด ์ฟผ๋ฆฌ ํ•ธ๋“ค๋Ÿฌ ํ•จ์ˆ˜๋ฅผ ์ถ”๊ฐ€ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • ์ฟผ๋ฆฌ ํ‚ค๋Š” ๋‹ค์–‘ํ•œ ๊ณณ์—์„œ ์‚ฌ์šฉ๋  ์ˆ˜ ์žˆ๋Š” ์ƒ์ˆ˜ ์ •๋ณด์ด๊ณ , ์ฟผ๋ฆฌ ํด๋ผ์ด์–ธํŠธ๋Š” ์ดˆ๊ธฐ์— QueryClientProvider์—์„œ ์ถ”๊ฐ€ํ•ด์ฃผ๋Š” ์—ญํ• ์ด์ง€๋งŒ React Query์™€ ๊ด€๋ จํ•œ ์ •๋ณด ์ž์ฒด๋ฅผ ํ•˜๋‚˜์˜ ํด๋”๋กœ ๋ฌถ์–ด๋‘๋Š” ๊ฒƒ์ด ์ข‹๋‹ค๊ณ  ์ƒ๊ฐํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ FSD ์•„ํ‚คํ…์ฒ˜์˜ ๊ด€์ ์—์„œ ํ•˜๋‚˜์˜ ์Šฌ๋ผ์ด์Šค๋กœ ๊ด€๋ฆฌํ•˜๋Š” ํŽธ์ด ๋” ์ข‹๋‹ค๊ณ  ์ƒ๊ฐํ•˜์—ฌ shared ํด๋”๋กœ ์ด๋™ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

2๏ธโƒฃ ๋„คํŠธ์›Œํฌ ์—๋Ÿฌ ํ† ์ŠคํŠธ ์ž๋™ ์ œ๊ฑฐ

  • ๊ธฐ์กด์˜ ์ž๋™ ์ œ๊ฑฐ๊ฐ€ ๋”ฐ๋กœ ์—†์ด, API ์š”์ฒญ์ด ์™„๋ฃŒ๋˜์–ด์•ผ๋งŒ ์‚ฌ๋ผ์ง€๊ฒŒ ์„ค์ •๋˜์–ด ์žˆ์—ˆ๋Š”๋ฐ autoClose๋ฅผ 3์ดˆ๋กœ ์„ค์ •ํ•˜์—ฌ 3์ดˆ ํ›„์— ์ž๋™์œผ๋กœ ์‚ฌ๋ผ์ง€๋„๋ก ์„ค์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • ๋„คํŠธ์›Œํฌ ์—๋Ÿฌ ํ† ์ŠคํŠธ autoClose๋ฅผ ์„ค์ •ํ•˜์—ฌ๋„ autoClose ์ดํ›„๋กœ ์ œ๊ฑฐ๋˜์ง€ ์•Š๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜์—ฌ toastify__progress-bar์— ๋Œ€ํ•œ ์Šคํƒ€์ผ ์‹œํŠธ๋ฅผ ์ˆ˜์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค. (display: none -> visibility: hidden)

๋ฆฌ๋ทฐ์–ด๊ฐ€ ์ค‘์ ์ ์œผ๋กœ ํ™•์ธํ•ด์•ผ ํ•˜๋Š” ๋ถ€๋ถ„

  • ์ด์Šˆ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ํ•ด๊ฒฐ๋˜์—ˆ๋‚˜์š”?
  • ํ† ์ŠคํŠธ๊ฐ€ ํ˜ธ์ถœ๋˜๋Š” ์ƒํ™ฉ์— ๋Œ€ํ•ด ์ดํ•ด๋˜์ง€ ์•Š๋Š” ์ ์ด ์žˆ์œผ์‹ ๊ฐ€์š”?

๋ฐœ๊ฒฌํ•œ ์ด์Šˆ

1๏ธโƒฃ ์ข‹์•„์š” API ๊ด€๋ จ ์ด์Šˆ

์ข‹์•„์š” API ๊ด€๋ จํ•ด์„œ ์ด์Šˆ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋Š”๋ฐ, delay๋ฅผ ์„ค์ •ํ•˜๊ณ  ํ…Œ์ŠคํŠธํ•˜๋Š” ๊ณผ์ • ์ค‘์— ๋ฐœ์ƒํ•œ ํœด๋จผ ์—๋Ÿฌ์˜€์Šต๋‹ˆ๋‹ค.


API Timeout ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•ด delay๋ฅผ ์„ค์ •ํ•˜์˜€๋Š”๋ฐ ์ข‹์•„์š”๊ฐ€ ๊ณ„์†ํ•ด์„œ ๋ฐ˜์˜๋˜๊ณ  ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทผ๋ฐ ํ™•์ธํ•ด๋ณด๋‹ˆ ํ”„๋ก ํŠธ์—์„œ๋Š” delay๋กœ ์—๋Ÿฌ ์ฒ˜๋ฆฌ๊ฐ€ ๋ฐœ์ƒํ•˜์—ฌ Query์— ๋ฐ˜์˜๋˜์ง€ ์•Š๋Š”๋ฐ msw์—์„œ๋Š” delay๊ฐ€ ๋๋‚œ ์ดํ›„ ์„œ๋ฒ„์— ๋ฐ์ดํ„ฐ๋ฅผ ์—…๋ฐ์ดํŠธํ•ด๋ฒ„๋ ค์„œ ๋ฐœ์ƒํ•œ ๋ฌธ์ œ์˜€์Šต๋‹ˆ๋‹ค..

2๏ธโƒฃ ์ข‹์•„์š” ๋ฒ„ํŠผ ์ƒ‰์ƒ ์ด์Šˆ

์ข‹์•„์š” ๋ฒ„ํŠผ์ด ๋น„ํ™œ์„ฑํ™”(isPending) ๋˜๋Š” ์ƒํ™ฉ์—์„œ ๋ธŒ๋ผ์šฐ์ €์—์„œ ์ œ๊ณตํ•ด์ฃผ๋Š” :disabled์˜ ๊ธฐ๋ณธ ์ƒ‰์ƒ์œผ๋กœ ์ ์šฉ๋˜๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

</ br>

ํ•ด๋‹น ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด _reset.scss์—์„œ ํ•ด๋‹น ์ƒ‰์ƒ์„ inherit์œผ๋กœ ์„ค์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

button {
  background-color: transparent;
  border: none;
  padding: 0;

  &:disabled {
    color: inherit;
  }
}

BangDori added 17 commits May 10, 2024 20:40
@BangDori BangDori self-assigned this May 10, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-47.d37mn03xh3qyyz.amplifyapp.com

Copy link
Member

@Legitgoons Legitgoons left a comment

Choose a reason for hiding this comment

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

์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค! queryClinet์˜ ์œ„์น˜์— ๋Œ€ํ•ด์„œ ๊ถ๊ธˆํ•œ ์ ์ด ์ƒ๊ฒจ์„œ Comment๋กœ ๋‹ฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ๋ถ€๋ถ„๋“ค์€ ๋ชจ๋‘ ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹น

src/app/App.tsx Outdated Show resolved Hide resolved
@BangDori BangDori merged commit f9bc08c into main May 11, 2024
2 checks passed
@BangDori BangDori deleted the fix/issue-44-network-toast branch May 11, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants