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

내정보 페이지 채널톡 연동 #417

Merged
merged 2 commits into from
Nov 2, 2024
Merged

Conversation

leeminhee119
Copy link
Member

내정보 페이지 채널톡 연동


🏄🏼‍♂️‍ Summary (요약)

  • 내정보 화면 /myinfo에 채널톡 버튼 추가

🫨 Describe your Change (변경사항)

🧐 Issue number and link (참고)

📚 Reference (참조)

  • 채널톡은 SPA 환경에서 경로가 변경되는 걸 인지하지 못해서, GlobalLayout에 location 변경될 때마다 경로 판단해서 내정보 페이지 (마이페이지)일 경우만 버튼 띄우게 해놨습니다.
  • 혹시 더 좋은 방법이 있다면 알려주세요오
스크린샷 2024-11-01 오전 10 07 01

@leeminhee119 leeminhee119 added the 🚀 feature New feature or request label Nov 1, 2024
@leeminhee119 leeminhee119 self-assigned this Nov 1, 2024
Copy link

vercel bot commented Nov 1, 2024

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

Name Status Preview Comments Updated (UTC)
layer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 1:10am

Copy link

coderabbitai bot commented Nov 1, 2024

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

@klmhyeonwoo klmhyeonwoo left a comment

Choose a reason for hiding this comment

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

역시 갓민희민희~

Comment on lines +23 to +30
useEffect(() => {
if (location.pathname.startsWith(PATHS.myInfo())) {
ChannelService.showChannelButton();
} else {
ChannelService.hideChannelButton();
}
}, [location]);

Copy link
Member

Choose a reason for hiding this comment

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

location 값에 따라 코드로 채널톡 버튼을 숨겨주는 것도 좋은 방법이지만,
혹시 채널톡에서 제공하는 화이트리스트 관리 기능을 사용해보면 어떨까요?!

혹여나 변동 사항이 생기게 된다면 다시 소스 코드를 고치고 배포하는 과정이 필요할 것 같은데 채널톡 백오피스에서 제공하는 화이트리스트를 사용하게 되면 조금 더 과정이 편해질 것 같다는 생각이 듭니다!

스크린샷 2024-11-01 오후 5 57 57

Copy link
Member Author

@leeminhee119 leeminhee119 Nov 2, 2024

Choose a reason for hiding this comment

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

앗 요거 설정해봤는데, 채널톡이 SPA 환경에서 URL 변경되는 걸 인지하지 못해서 아래와 같이 제대로 작동하지 않더라구요!

  • /myinfo 경로로 최초 진입하면 채널톡 버튼이 뜨는데 홈으로 이동 시 사라지지 않음
  • 반대로 홈 화면 경로로 최초 진입 후 내정보로 진입 시 버튼이 뜨지 않음

그래서 사이트 최초 진입 시에 채널톡 부트시키고, 경로 이동 시 버튼만 hide/show로 설정해두었습니다.
혹시 제가 놓친게 있다면 알려주세요! 😸

Copy link
Member

Choose a reason for hiding this comment

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

앗 코드를 보니까 그러네요!
생각해보니 예전에 채널톡 화이트리스트를 적용했던 프로젝트는 Next로 구성된 프로젝트였던 기억이..

Copy link
Member Author

Choose a reason for hiding this comment

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

네네 일단 요렇게 머지하께요!

@@ -256,5 +257,9 @@ const router = createBrowserRouter([
]);

export const Routers = () => {
ChannelService.loadScript();
ChannelService.boot({
pluginKey: import.meta.env.VITE_CHANNELTALK_PLUGIN_KEY,
Copy link
Member

Choose a reason for hiding this comment

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

환경 변수 공유해주시면, 플랫폼에도 잘 등록을 해놓겠습니다 :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

넵!

@leeminhee119 leeminhee119 merged commit 07417c0 into develop Nov 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants