Skip to content

refactor: #133/로딩 스피너 추가#139

Merged
codeit-kkm merged 2 commits intomainfrom
refactor/#133/loading
Apr 18, 2025
Merged

refactor: #133/로딩 스피너 추가#139
codeit-kkm merged 2 commits intomainfrom
refactor/#133/loading

Conversation

@ARON-Y
Copy link
Collaborator

@ARON-Y ARON-Y commented Apr 17, 2025

#️⃣ Issue Number

#133

📝 요약

  • 리액트 스피너로 로딩 스피너 추가 (색상은 저희 상징 색 같은 violet으로 했습니다. 변경도 가능합니다.)

🛠️ PR 유형

  • 새로운 기능 추가
  • 버그 수정
  • CSS 등 사용자 UI 디자인 변경
  • 코드에 영향을 주지 않는 변경사항(오타 수정, 변수명 변경 등)
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 테스트 추가, 테스트 리팩토링
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

📷 스크린샷

2025-04-16.221100.mp4

📢 공유 사항

https://www.npmjs.com/package/react-spinners?activeTab=readme
리액트 스피너를 사용했습니다. npm install 필요합니다.


📚 참고 자료

https://velog.io/@scy512/REACT-SPINNERS

@ARON-Y ARON-Y self-assigned this Apr 17, 2025
@vercel
Copy link

vercel bot commented Apr 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
taskify ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 17, 2025 11:27am

@hyeonjiroh
Copy link
Owner

hyeonjiroh commented Apr 17, 2025

너무 멋져요! 고생하셨습니다~!

Copy link
Collaborator

@codeit-kkm codeit-kkm left a comment

Choose a reason for hiding this comment

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

늦어서 죄송합니다 ! 수고하셨습니다!

@codeit-kkm codeit-kkm merged commit 1423cf3 into main Apr 18, 2025
3 checks passed
@codeit-kkm codeit-kkm deleted the refactor/#133/loading branch April 18, 2025 04:41
Comment on lines 20 to +22
const observerRef = useRef<HTMLDivElement | null>(null);
const accessToken = localStorage.getItem("accessToken") ?? "";
// const accessToken = localStorage.getItem("accessToken") ?? "";
const accessToken = Cookies.get("accessToken") ?? "";

Choose a reason for hiding this comment

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

안쓰는 코드는 삭제하는게 어떨까요?

import { twMerge } from "tailwind-merge";
import clsx from "clsx";
import { postImage } from "@/lib/apis/imageApi";
import { HashLoader } from "react-spinners";

Choose a reason for hiding this comment

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

Spinner 컴포넌트는 지피티로도 간단하게 만들 수 있어서 굳이 라이브러리로 안해도 될 거 같아요.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

오 라이브러리 사용보다 ai로 컴포넌트 만드는게 더 간단하게 할 수 있는 방법이군요! 참고하겠습니다🙏🏻

color="#5534DA"
size={variant === "task" ? 30 : 50}
className="z-20"
/>

Choose a reason for hiding this comment

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

중첩 3항연산자를 사용하면 코드 가독성이 내려가요.
보통 삼항연산자는 해당 논리를 다 읽어야 이 코드가 어떻게 돌아가는지 이해가 가능한데 그 논리를 중첩으로 쓰면 더 이해하기 어렵겠죠?
그래서 이런경우에는 ts-pattern같은 라이브러리를 활용해보거나 함수로 분리하는 등 다른 방법을 고려해보는게 좋을 거 같아요.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

토스 ts-pattern
관련 글 찾아서 읽어봤는데 처음보는 방법이라 흥미롭네요! 견해를 넓혀주셔서 감사합니다😆

);
setImageUrl(imageUrl);
} catch (error) {
console.error("이미지 업로드 에러:", error);

Choose a reason for hiding this comment

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

이런부분 console이 아니라 Toast로 에러메시지 띄어주면 유저가 더 이해하기 수월하겠죠?

toast.open("이미지 업로드 에러")

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

토스트 알림을 사용하면 유저 경험이 확실히 좋아질것 같다고 느꼈습니다.🥲 우선 해당 페이지 일관성을 위해서 콘솔로 에러처리 해뒀는데 다시 리팩토링 해보겠습니다 의견주셔서 너무 감사드려요!👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants