Skip to content

Conversation

@young-jin-son
Copy link
Collaborator

@young-jin-son young-jin-son commented Jul 26, 2025

Issue Number

close #324

As-Is

  • 로딩 컴포넌트가 없었음
  • 로딩 처리가 임시 텍스트로 되어 있는 페이지가 있었음

To-Be

  • 로딩 컴포넌트 생성
  • 로딩 처리가 임시 텍스트로 되어 있는 페이지에 로딩 컴포넌트 적용

Check List

  • 테스트가 전부 통과되었나요?
  • 모든 commit이 push 되었나요?
  • merge할 branch를 확인했나요?
  • Assignee를 지정했나요?
  • Label을 지정했나요?

Test Screenshot

(Optional) Additional Description

Summary by CodeRabbit

  • New Features

    • Introduced a unified loading indicator component with consistent styling and messaging across the app.
  • Refactor

    • Replaced various inline and custom loading UIs with the new reusable loading component in multiple pages and components.
    • Consolidated loading state handling for search address results, improving maintainability and user experience.
  • Style

    • Removed redundant loading container styles now handled by the shared loading component.

@young-jin-son young-jin-son self-assigned this Jul 26, 2025
@young-jin-son young-jin-son added feat 새로운 기능 구현 FE 프론트엔드 작업 labels Jul 26, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 26, 2025

Walkthrough

A reusable Loading component and its styled elements were introduced to standardize loading indicators across the frontend. Existing inline or custom loading UIs in several components and pages were replaced with this new Loading component. Conditional rendering logic was updated to delegate loading state handling to the relevant child components.

Changes

Files/Paths Change Summary
frontend/src/components/Loading/Loading.styled.ts, frontend/src/components/Loading/index.tsx Introduced new styled-components and a reusable Loading React component.
frontend/src/components/SearchAddress/SearchAddressResult/index.tsx Added isLoading prop; renders Loading component when loading.
frontend/src/components/SearchAddress/index.tsx Refactored to always render SearchAddressResult, passing isLoading prop for internal handling.
frontend/src/pages/KakaoLoginPage/index.tsx,
frontend/src/pages/MyPage/index.tsx
Replaced inline "Loading..." JSX with the new Loading component.
frontend/src/pages/RouteSelectPage/components/RouteResult/RouteResult.styled.ts Removed unused LoadingContainer styled component.
frontend/src/pages/RouteSelectPage/components/RouteResult/index.tsx Replaced custom loading UI with the shared Loading component.

Sequence Diagram(s)

sequenceDiagram
    participant ParentComponent
    participant Loading
    participant ChildComponent

    ParentComponent->>ChildComponent: Render with isLoading prop
    alt isLoading is true
        ChildComponent->>Loading: Render Loading UI
    else isLoading is false
        ChildComponent->>ChildComponent: Render normal content
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

refactor

Poem

🐇✨
A spinner spins, a fire glows,
Now loading’s clear—everybody knows!
No more plain divs to make us frown,
Our unified loader calms us down.
Across the pages, joy is showing—
Consistent loading, smoothly flowing!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#324

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
frontend/src/pages/KakaoLoginPage/index.tsx (1)

6-7: Consider removing the extra empty line.

The Loading component import is correct, but the extra empty line on line 7 could be removed for cleaner formatting.

 import Loading from '@/components/Loading';
-
frontend/src/pages/RouteSelectPage/components/RouteResult/index.tsx (1)

53-58: Consider removing unnecessary wrapper containers.

The Loading component likely has its own styling and container, so wrapping it in S.NoRouteContainer and S.NoRouteText may create unnecessary nesting or conflicting styles.

Consider simplifying to:

       {isLoading ? (
-        <S.NoRouteContainer>
-          <S.NoRouteText>
             <Loading />
-          </S.NoRouteText>
-        </S.NoRouteContainer>
+        </S.LoadingWrapper>
       ) : routes.length === 0 ? (

Or simply:

-      {isLoading ? (
-        <S.NoRouteContainer>
-          <S.NoRouteText>
-            <Loading />
-          </S.NoRouteText>
-        </S.NoRouteContainer>
-      ) : routes.length === 0 ? (
+      {isLoading ? <Loading /> : routes.length === 0 ? (
frontend/src/components/Loading/index.tsx (1)

6-13: Consider improvements for responsiveness and internationalization.

The Loading component implementation is solid, but consider these enhancements:

  1. Icon size: 150x150px may be too large for smaller screens
  2. Internationalization: The hardcoded Korean text limits global usage

Consider making the component more flexible:

+interface LoadingProps {
+  size?: number;
+  message?: string;
+}
+
-const Loading = () => {
+const Loading = ({ size = 100, message = "조금만 기다려주세요!" }: LoadingProps) => {
   return (
     <S.LoadingContainer>
-      <Icon icon="Fire" width={150} height={150} color={theme.colors.green600} />
+      <Icon icon="Fire" width={size} height={size} color={theme.colors.green600} />
-      <S.LoadingText>조금만 기다려주세요!</S.LoadingText>
+      <S.LoadingText>{message}</S.LoadingText>
     </S.LoadingContainer>
   );
 };

This maintains backward compatibility while allowing customization when needed.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 866d65e and c51f493.

📒 Files selected for processing (8)
  • frontend/src/components/Loading/Loading.styled.ts (1 hunks)
  • frontend/src/components/Loading/index.tsx (1 hunks)
  • frontend/src/components/SearchAddress/SearchAddressResult/index.tsx (1 hunks)
  • frontend/src/components/SearchAddress/index.tsx (1 hunks)
  • frontend/src/pages/KakaoLoginPage/index.tsx (2 hunks)
  • frontend/src/pages/MyPage/index.tsx (2 hunks)
  • frontend/src/pages/RouteSelectPage/components/RouteResult/RouteResult.styled.ts (0 hunks)
  • frontend/src/pages/RouteSelectPage/components/RouteResult/index.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • frontend/src/pages/RouteSelectPage/components/RouteResult/RouteResult.styled.ts
🔇 Additional comments (9)
frontend/src/pages/MyPage/index.tsx (2)

11-11: LGTM: Clean import addition.

The Loading component import follows proper conventions and is correctly positioned.


36-36: LGTM: Proper loading UI standardization.

The replacement of inline loading text with the dedicated Loading component improves consistency while maintaining the same conditional rendering logic.

frontend/src/pages/KakaoLoginPage/index.tsx (1)

19-19: LGTM: Appropriate loading UI for login processing.

The Loading component replacement is suitable for this login processing page that requires a loading state throughout its lifecycle.

frontend/src/pages/RouteSelectPage/components/RouteResult/index.tsx (1)

8-8: LGTM: Proper import addition.

The Loading component import is correctly added and follows project conventions.

frontend/src/components/SearchAddress/index.tsx (1)

63-68: Loading state handling in SearchAddressResult verified

SearchAddressResult correctly checks the isLoading prop and renders the standardized <Loading /> component (lines 20–27 in frontend/src/components/SearchAddress/SearchAddressResult/index.tsx). This confirms the parent’s delegation of loading state is implemented as intended—approving these changes.

frontend/src/components/Loading/Loading.styled.ts (1)

1-15: LGTM! Well-structured loading component styles.

The styled components are properly implemented with:

  • Appropriate flexbox centering for the loading container
  • Consistent typography usage from theme
  • Clean separation of concerns
frontend/src/components/SearchAddress/SearchAddressResult/index.tsx (3)

5-5: Good addition of the Loading component import.

Clean integration of the new shared loading component.


11-11: Proper interface extension for loading state.

The boolean isLoading prop is appropriately typed and follows naming conventions.


18-27: Excellent loading state implementation.

The early return pattern with conditional rendering is clean and maintains UI consistency by preserving the container structure and title while showing the loading component.

@young-jin-son young-jin-son merged commit 32629e3 into develop Jul 26, 2025
3 checks passed
@young-jin-son young-jin-son deleted the feat/#324 branch July 26, 2025 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FE 프론트엔드 작업 feat 새로운 기능 구현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 로딩 컴포넌트 생성 및 적용

2 participants