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

[Feat/#65] 커뮤니티 뷰 구현 #86

Closed
wants to merge 27 commits into from

Conversation

Leeyoonji23
Copy link
Collaborator

@Leeyoonji23 Leeyoonji23 commented Jan 16, 2025

🔥 Related Issues

✅ 작업 리스트

  • 헤더
  • 배너
  • 커뮤니티 분류 아이템들
  • Divider 붙이기
  • 최신글/인기글 버튼 구현
  • 하단 Nav 바 붙이기
  • 플로팅 버튼 붙이기

🔧 작업 내용

커뮤니티 메인 뷰 구현했어용

  • 중간에 커뮤니티 대분류 아이콘 있는 부분은 예림언니 도움 받아서 구현했어요.
    Nav 바 활용해서
<Nav content={COMMUNITY_CONTENT} type="community" />
<Nav content={NAV_CONTENT} type="nav" />

요로코롬
변경사항 커밋했습니다.

image

  • 헤더하고 최신글/인기글 버튼부분 position:"sticky" 값 줘서 더 스크롤 될 때 더 올라가지 않게 했습니다
bandicam.2025-01-17.06-59-48-406.mp4

😵‍💫 잘 모르겠어요

커뮤니티 대분류 아이콘 들어갈 부분 누르면 그 분류 페이지로 들어가야되는데 쿼리 파라미터를 어디서 어떻게 세팅해야할지 감이 잡히질 않아서 의견 주시면 감사하겠습니다 -!

📸 스크린샷 / GIF / Link

bandicam.2025-01-17.06-47-30-245.mp4

@Leeyoonji23 Leeyoonji23 added 🎨 design 사용자 UI 디자인 변경 - ex) CSS ✨ feat 기능 구현 labels Jan 16, 2025
@Leeyoonji23 Leeyoonji23 requested review from ocahs9, minjeoong and yarimu and removed request for ocahs9 and minjeoong January 16, 2025 22:11
@Leeyoonji23 Leeyoonji23 self-assigned this Jan 16, 2025
Comment on lines 11 to 19
{ id: "/community/category?symptom", label: "증상·질병", path: "/community/category?type=symptom", svg: IcShape },
{ id: "/community/category?hospital", label: "병원고민", path: "/community/category?type=hospital", svg: IcShape },
{ id: "/community/category?healing", label: "일상·치유", path: "/community/category?type=healing", svg: IcShape },
{
id: "/community/category?magazine",
label: "코코스매거진",
path: "/community/category?type=magazine",
svg: IcShape,
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

p3) id 를 이렇게 지정한 이유가 있을까요????
쿼리파라미터 기본 형식과 다른 것 같아서요!

Copy link
Collaborator

Choose a reason for hiding this comment

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

p3) 민정이 말에 저도 동의합니다~

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ㅎ..ㅎ 옆에거 복붙하다가 잘못들어갔나봐요.. 수정했습니다 -!

Comment on lines 29 to 39
{isActive && (
<IcUnderline
style={{
position: "absolute",
bottom: "-1.2rem",
left: "50%",
transform: "translateX(-50%)",
width: "2.4rem",
}}
/>
)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

p4) 이거 inline 스타일 준 이유가 있을까유

Copy link
Collaborator

Choose a reason for hiding this comment

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

p3) 이 정도의 양이라면 차라리 겉에 span으로 감싸고, 해당 span에 className을 주는게 더 나아보여요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

준혁오빠 의견 동의합니다 ! className으로 뺐어요!

@@ -28,7 +34,7 @@ const Nav = () => {

return (
<div className={styles.container}>
{NAV_CONTENT.map((item) => {
{content.map((item) => {
const SvgComponent = item.svg;

return (
Copy link
Collaborator

Choose a reason for hiding this comment

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

p2) 쿼리 스트링 관련해서 코멘트 남깁니다.
세팅 방법은 여러가지 입니다.
제가 남긴 방법 말고도 여러가지 방법이 있으니까, 한번 검색해서 찾아보는 것도 좋을 것 같아요!

  1. 🎱 useSearchParams Hook 사용
import { useSearchParams } from "react-router-dom";

const MyComponent = () => {
  const [searchParams, setSearchParams] = useSearchParams();

  // 쿼리 스트링에서 페이지 type 가져옴
  const id = searchParams.get("type"); // ?id=123 => "123"

  // 쿼리 스트링 세팅 
  const updateQuery = () => {
    setSearchParams({ type: "symptom" }); // URL: ?type=symptom
  };
  1. 🎱 React Router의 useNavigate 사용
import { useNavigate } from "react-router-dom";
  
  // 쿼리 스트링 세팅 
    const params = new URLSearchParams();
    params.set("type", "symptom");

    navigate({
      pathname: "/",
      search: `?${params.toString()}`, 
    });

  // 가져올 때는
  const pagetype = searchParams.get("type"); // ?type=symptom

[ 참고자료 :
https://developer.mozilla.org/ko/docs/Web/API/URL/searchParams ]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

레전드 코리다.... 참고자료 공유까지 감사합니도🥹❤️👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

p3) 민정이가 너무 잘 남겨줬네요! 저거 잘 참고하고, 제가 구두로 설명했던 내용들 잊지 말고 구현하면 좋을 것 같아요!

  1. category?type = 타입내용 을 쿼리로 잘 받아와서, 타입에 따라 적절한 화면 렌더링 구현하기
  2. 만약 없는 타입이 입력되었다면 빈 화면 렌더링하거나, 센스 있게 "해당 타입은 존재하지 않습니다" 텍스트가 써진 화면 렌더링

또 이해 안되면 물어봐주세요 ~!

Copy link
Collaborator

@ocahs9 ocahs9 left a comment

Choose a reason for hiding this comment

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

이거 커뮤니티 카테고리랑 하단 Nav바 버튼 크기가 동일한데, 달라야 해요. 피그마 확인 후 수정 부탁드립니다! (하단 네비바 버튼들이 좀 커서, 밑에 여유공간도 없어보여요)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨 design 사용자 UI 디자인 변경 - ex) CSS ✨ feat 기능 구현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ Feat ] 커뮤니티 뷰
3 participants