Skip to content

[feature] 상세페이지 동아리 SNS 링크 노출 기능 추가#409

Merged
oesnuj merged 13 commits intodevelop-fefrom
feature/#403-club-detail-sns-display-FE-114
May 15, 2025
Merged

[feature] 상세페이지 동아리 SNS 링크 노출 기능 추가#409
oesnuj merged 13 commits intodevelop-fefrom
feature/#403-club-detail-sns-display-FE-114

Conversation

@oesnuj
Copy link
Member

@oesnuj oesnuj commented May 15, 2025

#️⃣연관된 이슈

#403

📝작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지/동영상 첨부 가능)
image

1. 각 플랫폼별 아이콘 추가 및 SNS_CONFIG에 속성으로 추가

  • 각 플랫폼별 아이콘(youtube, x, instagram) 추가
  • SNS_CONFIG에 icon 속성 추가하여 아이콘 경로 관리
  • 인스타그램은 svg 대신 png 사용
    → 무지개 그라데이션 특성상 벡터(svg)보다 png가 용량이 더 작음

2. InfoBox 내 구조 확장 (label : 컴포넌트 허용)

  • 기존 label : value 형식에 더해 label : ReactNode 형식도 지원하도록 확장하여 아이콘들 띄움
  • InfoBox 구조는 최대한 유지하며 범용성 확보

3. SnsLinkIcons 컴포넌트 제작 및 일반화

플랫폼이 추가되더라도 SNS_CONFIG만 수정하면 되도록 일반화된 구조로 구현
Object.entries 반복 렌더링 구조로 중복 제거

(참고)
Object.entries()는 키를 string으로 추론해서 SNS_CONFIG[platform] 접근 시 에러가 발생합니다.
platform as SNSPlatform 단언으로 해결했습니다.

https://www.notion.so/SnsLinkIcons-SNS_CONFIG-1f4aad2320968051982cdb56e8e23eac?pvs=4


4. 모바일에서 모집 기간 UI가 벗어나는 문제 해결

commit: e380a5f


중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

InfoBox에 컴포넌트를 넣을 수 있게 확장한 게 괜찮은 방향일지, 더 나은 표현 방식이 있을지 궁금합니다.


💬 논의 하고싶은 부분(선택)

해당 UI 컴포넌트에 대해 어떤 테스트를 진행하는 게 좋을까요
(렌더링 조건, 링크 유효성, 속성 테스트 등 ?? )


Summary by CodeRabbit

  • New Features

    • 동아리 상세 페이지에 SNS(YouTube, Instagram, X) 아이콘 링크 표시 기능이 추가되었습니다.
    • SNS 아이콘 클릭 시 해당 동아리의 SNS 페이지로 새 창에서 이동할 수 있습니다.
  • Style

    • InfoBox 및 SNS 아이콘 컴포넌트의 레이아웃과 반응형 스타일이 개선되었습니다.
    • InfoBox의 높이 및 내부 간격이 조정되어 가독성이 향상되었습니다.

@oesnuj oesnuj requested review from Copilot and seongwon030 May 15, 2025 05:34
@oesnuj oesnuj self-assigned this May 15, 2025
@oesnuj oesnuj added ✨ Feature 기능 개발 💻 FE Frontend labels May 15, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 15, 2025

Walkthrough

동아리 상세 페이지에서 SNS(YouTube, Instagram, X) 링크를 아이콘 형태로 보여주는 기능이 추가되었습니다. SNS별 아이콘 이미지가 SNS 설정에 포함되고, 새로운 SnsLinkIcons 컴포넌트가 생성되어 InfoBox에서 SNS 정보로 렌더링됩니다. 관련 스타일 파일도 추가 및 수정되었습니다.

Changes

파일/그룹 변경 요약
frontend/src/constants/snsConfig.ts SNS별 아이콘 이미지 import 및 SNS_CONFIG에 icon 속성 추가
frontend/src/pages/ClubDetailPage/components/InfoBox/InfoBox.tsx InfoBox에서 SNS 정보 항목 추가, ClubInfoItemrender 속성 추가, SNS 아이콘 컴포넌트 렌더링 로직 반영
frontend/src/pages/ClubDetailPage/components/SnsLinkIcons/SnsLinkIcons.tsx
frontend/src/pages/ClubDetailPage/components/SnsLinkIcons/SnsLinkIcons.styles.ts
SNS 아이콘 링크 렌더링용 신규 컴포넌트 및 스타일 파일 추가
frontend/src/pages/ClubDetailPage/components/InfoBox/InfoBox.styles.ts InfoBox 및 관련 요소의 스타일 조정(높이, gap, 반응형 등)

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ClubDetailPage
    participant InfoBox
    participant SnsLinkIcons

    User->>ClubDetailPage: 상세 페이지 접근
    ClubDetailPage->>InfoBox: 동아리 정보 전달
    InfoBox->>SnsLinkIcons: SNS 링크 정보 전달
    SnsLinkIcons->>User: SNS 아이콘(링크) 렌더링
    User->>SnsLinkIcons: SNS 아이콘 클릭
    SnsLinkIcons->>User: 새 탭에서 SNS 링크 오픈
Loading

Assessment against linked issues

Objective Addressed Explanation
SNS 링크 조건부 렌더링 컴포넌트 작성, 링크 클릭 시 새 탭 열기, 반응형 스타일 및 정렬 처리 (FE-114)
렌더링 및 클릭 동작 테스트 코드 작성 (FE-114) 테스트 코드 추가 내역이 없음

Possibly related PRs

Suggested labels

🎨 Design

Suggested reviewers

  • seongwon030

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
  • 📝 Generate Docstrings

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 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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR extends the club detail view by introducing a generalized SNS link icon component and updating the InfoBox to optionally accept React components.

  • Added a new SnsLinkIcons component to render clickable SNS icons based on configuration.
  • Updated InfoBox to support a ReactNode render prop, allowing flexible content such as SNS icons.
  • Adjusted styles and updated the SNS_CONFIG to include icon paths.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/src/pages/ClubDetailPage/components/SnsLinkIcons/SnsLinkIcons.tsx New component for rendering SNS icons from provided social links.
frontend/src/pages/ClubDetailPage/components/SnsLinkIcons/SnsLinkIcons.styles.ts Styles for the SNS icon and link layout.
frontend/src/pages/ClubDetailPage/components/InfoBox/InfoBox.tsx Extended InfoBox to accept either string or ReactNode for descriptions.
frontend/src/pages/ClubDetailPage/components/InfoBox/InfoBox.styles.ts Adjusted layout dimensions and spacing for responsive design.
frontend/src/constants/snsConfig.ts Updated configuration to include icon paths for SNS platforms.
Comments suppressed due to low confidence (1)

frontend/src/pages/ClubDetailPage/components/InfoBox/InfoBox.tsx:65

  • [nitpick] Since Styled.RightText is now used to render both text and arbitrary ReactNodes, consider renaming it to a more generic name (e.g., RightContent) to better reflect its purpose.
<Styled.RightText>{desc.render ?? desc.value}</Styled.RightText>

@oesnuj oesnuj changed the title Feature/#403 club detail sns display fe 114 [feature] 상세페이지 동아리 SNS 링크 노출 기능 추가 May 15, 2025
@netlify
Copy link

netlify bot commented May 15, 2025

Deploy Preview for moadong ready!

Name Link
🔨 Latest commit 3194092
🔍 Latest deploy log https://app.netlify.com/projects/moadong/deploys/68257cdb2f639700088a8f93
😎 Deploy Preview https://deploy-preview-409--moadong.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 41
Accessibility: 87
Best Practices: 92
SEO: 92
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

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 (1)
frontend/src/pages/ClubDetailPage/components/SnsLinkIcons/SnsLinkIcons.tsx (1)

13-17: 타입 단언 개선 고려

현재 platform as SNSPlatform 타입 단언을 사용하고 있습니다. 이는 TypeScript에서 Object.entries()의 타입 제한 때문에 필요한 부분이지만, 타입 안전성을 높이기 위한 대안을 고려해 볼 수 있습니다.

다음과 같이 타입 가드 함수를 사용하여 타입 안전성을 개선할 수 있습니다:

-        const config = SNS_CONFIG[platform as SNSPlatform];
+        // 타입 가드 함수를 사용하여 platform이 유효한 SNSPlatform인지 확인
+        const isPlatformValid = (key: string): key is SNSPlatform => 
+          Object.keys(SNS_CONFIG).includes(key);
+        
+        if (!isPlatformValid(platform)) return null;
+        const config = SNS_CONFIG[platform];
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9b3b36b and 3194092.

⛔ Files ignored due to path filters (3)
  • frontend/src/assets/images/icons/sns/instagram_icon.png is excluded by !**/*.png
  • frontend/src/assets/images/icons/sns/x_icon.svg is excluded by !**/*.svg
  • frontend/src/assets/images/icons/sns/youtube_icon.svg is excluded by !**/*.svg
📒 Files selected for processing (5)
  • frontend/src/constants/snsConfig.ts (1 hunks)
  • frontend/src/pages/ClubDetailPage/components/InfoBox/InfoBox.styles.ts (2 hunks)
  • frontend/src/pages/ClubDetailPage/components/InfoBox/InfoBox.tsx (3 hunks)
  • frontend/src/pages/ClubDetailPage/components/SnsLinkIcons/SnsLinkIcons.styles.ts (1 hunks)
  • frontend/src/pages/ClubDetailPage/components/SnsLinkIcons/SnsLinkIcons.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
frontend/src/pages/ClubDetailPage/components/SnsLinkIcons/SnsLinkIcons.tsx (2)
frontend/src/types/club.ts (1)
  • SNSPlatform (14-14)
frontend/src/constants/snsConfig.ts (1)
  • SNS_CONFIG (5-24)
🔇 Additional comments (19)
frontend/src/constants/snsConfig.ts (2)

1-3: 적절한 소셜 미디어 아이콘 가져오기

YouTube와 X는 SVG 형식으로, Instagram은 PNG 형식으로 적절하게 가져왔습니다. PR 설명대로 Instagram의 그라데이션 효과 때문에 PNG를 사용한 것이 이해됩니다.


10-22: SNS 구성에 아이콘 속성 추가 완료

각 SNS 플랫폼 설정에 아이콘 속성을 일관되게 추가했습니다. 이는 SnsLinkIcons 컴포넌트에서 아이콘을 동적으로 표시하기 위한 좋은 접근 방식입니다.

frontend/src/pages/ClubDetailPage/components/InfoBox/InfoBox.styles.ts (4)

12-12: 사소한 스타일 개선

gap: 0px에서 gap: 0으로 변경하여 불필요한 단위를 제거했습니다. 작은 변경이지만 코드 일관성 측면에서 좋은 개선입니다.


19-19: InfoBox 높이 증가

SNS 아이콘을 수용하기 위해 InfoBox 높이를 197px로 증가시켰습니다. 추가된 콘텐츠에 맞게 적절하게 조정되었습니다.


55-57: 모바일 뷰를 위한 반응형 간격 조정

500px 이하 화면에서 간격을 50px에서 40px로 줄여 모바일 화면에서 더 나은 레이아웃을 제공합니다. 이는 PR 목표에 명시된 모바일 UI 문제를 해결하는 데 도움이 됩니다.


63-63: LeftText 너비 고정

LeftText에 30px의 고정 너비를 설정했습니다. 이는 일관된 레이아웃을 제공하지만, 향후 다국어 지원을 계획한다면 일부 언어에서 텍스트가 더 길어질 수 있다는 점을 고려해 보세요.

다른 언어로 번역 시 "SNS"와 같은 라벨이 현재 30px 제한을 초과할 가능성이 있는지 확인해 보세요.

frontend/src/pages/ClubDetailPage/components/InfoBox/InfoBox.tsx (4)

5-5: 새로운 SnsLinkIcons 컴포넌트 가져오기

새로 생성된 SnsLinkIcons 컴포넌트를 올바르게 가져왔습니다.


7-11: ReactNode를 지원하도록 인터페이스 확장

ClubInfoItem 인터페이스를 확장하여 단순한 문자열 값뿐만 아니라 React 컴포넌트도 렌더링할 수 있도록 했습니다. 이는 PR 목표에서 질문한 접근 방식으로, 기존 인터페이스를 유지하면서 컴포넌트 렌더링 유연성을 추가했기 때문에 좋은 선택입니다.


42-45: SNS 링크를 위한 새로운 설명 항목 추가

동아리 정보 섹션에 'SNS' 라벨을 가진 새 항목을 추가하고, 커스텀 렌더링을 위해 SnsLinkIcons 컴포넌트를 사용했습니다. 이 컴포넌트는 clubDetail.socialLinks를 통해 API에서 받은 소셜 링크 데이터를 전달받습니다.


65-65: 조건부 렌더링 로직 개선

nullish 병합 연산자(??)를 사용하여 render 속성이 있으면 이를 사용하고, 그렇지 않으면 value로 대체하는 방식은 간결하고 효율적입니다.

frontend/src/pages/ClubDetailPage/components/SnsLinkIcons/SnsLinkIcons.styles.ts (4)

3-7: 적절한 아이콘 그룹 스타일링

SnsIconGroup 컴포넌트는 Flexbox를 사용하여 아이콘을 수평으로 정렬하고 적절한 간격(8px)을 제공합니다. 이는 소셜 미디어 아이콘 그룹을 표시하는 데 좋은 접근 방식입니다.


9-20: 인터랙티브 아이콘 스타일링

아이콘에 대한 스타일링이 잘 구현되어 있습니다:

  • 모든 아이콘에 대해 일관된 크기(24x24px)를 설정했습니다
  • 호버 상태에서 불투명도를 증가시켜 시각적 피드백을 제공합니다
  • 클릭(active) 상태에서 약간 축소되는 효과를 추가하여 인터랙티브한 느낌을 줍니다

이러한 인터랙션은 사용자 경험을 향상시킵니다.


22-25: 앵커 요소의 레이아웃 조정

line-height: 0을 사용하여 불필요한 여백을 제거하고 display: inline-block으로 설정하여 아이콘이 올바르게 배치되도록 했습니다. 이는 스타일링 목적에 맞는 적절한 접근 방식입니다.


1-25: 누락된 SnsLinkIcons.tsx 컴포넌트

InfoBox.tsx에서 SnsLinkIcons 컴포넌트를 사용하고 있지만, 제공된 파일 목록에는 실제 SnsLinkIcons.tsx 구현이 없습니다. PR 목표에 명시된 것처럼 이 컴포넌트는 SNS_CONFIG를 사용하여 동적으로 소셜 미디어 아이콘을 렌더링해야 합니다.

SnsLinkIcons.tsx 파일이 구현되어 있는지, apiSocialLinks 속성을 올바르게 사용하여 플랫폼별 아이콘을 표시하는지 확인해 주세요.

frontend/src/pages/ClubDetailPage/components/SnsLinkIcons/SnsLinkIcons.tsx (5)

1-5: 깔끔한 가져오기 구문.

필요한 모듈과 타입들이 명확하게 정의되어 있습니다.


6-8: 인터페이스 정의가 잘 구현되었습니다.

TypeScript의 Partial과 Record 유틸리티 타입을 사용하여 소셜 링크 데이터에 대한 유연한 구조를 만들었습니다. 이는 일부 SNS 링크만 제공될 수 있는 상황을 잘 처리할 수 있게 합니다.


10-30: 컴포넌트 구현이 잘 되었습니다.

React 함수형 컴포넌트 패턴을 잘 따르고 있으며, 빈 URL 값을 적절히 처리하고 있습니다.


18-26: 링크 보안 및 접근성이 잘 고려되었습니다.

target='_blank'와 함께 rel='noreferrer'를 사용하여 보안 취약점을 방지하는 좋은 사례를 따르고 있습니다. 또한 아이콘에 alt 속성을 제공하여 접근성을 보장하고 있습니다.


32-32: 컴포넌트 내보내기가 잘 구현되었습니다.

표준 React 컴포넌트 내보내기 패턴을 따르고 있습니다.

Copy link
Member

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@oesnuj oesnuj merged commit 0cff80b into develop-fe May 15, 2025
5 checks passed
@oesnuj oesnuj deleted the feature/#403-club-detail-sns-display-FE-114 branch May 21, 2025 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend ✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants