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: 홈(구 탐색) 개편 #263

Merged
merged 16 commits into from
Oct 29, 2024

Conversation

Nahyun-Kang
Copy link
Contributor

개요

  • 개요는 변경 사항 및 관련 이슈에 대해 간단하게 작성해주세요.
  • 해당 PR에 대한 리뷰어와 라벨을 생성해 주세요.

작업 사항

  • 홈 페이지 퍼블리싱
  • 홈 페이지 > 최신 로직 구현 및 API 연결
  • 홈 페이지 > 팔로잉 로직 구현 및 API 연결

참고 사항 (optional)

[남은 작업]

  • 홈 페이지 추천 탭 API 연결(요청 주제 목록, 추천 리스트)
  • 권한 분기 처리 (사용자 추천 리스트 - 비회원 버튼 클릭 시, 로그인 모달 나오게)
  • 에러 처리
  • 스켈레톤 구현
  • 대대적 리팩토링
  • 검색 바 컴포넌트 연결 (현지님 PR 받아서)
    @kanglocal 현지님 검색 바 받아서 제가 추가하겠습니다!

관련 이슈 (optional)

  • 스케쥴 이슈...잦은 야근으로 인해 완벽하게 하지 못했습니다..죄송합니다
  • 공통 컴포넌트 분리 및 사용, 공용 폰트 및 컬러 사용 등 리팩토링 할 부분이 많습니다.
  • 죽 머지 이후 다른 분들이 하신 것처럼 공용 컴포넌트, 폰트 사용 등, 컴포넌트 분리 진행하겠습니다.

스크린샷

홈 > 추천
홈_추천

홈 > 최신
홈_최신

홈 > 팔로잉

홈_팔로잉


리뷰어에게

  • 밥 머지 때 좀 더 완벽하게 하겠습니다..ㅠㅠㅠ

@Nahyun-Kang Nahyun-Kang self-assigned this Oct 27, 2024
Copy link

vercel bot commented Oct 27, 2024

@Nahyun-Kang is attempting to deploy a commit to the Eujin Ahn's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@ParkSohyunee ParkSohyunee left a comment

Choose a reason for hiding this comment

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

나현님, Ver3.0 홈 디자인 너무 예쁘네요 🥹✨ 기존과는 전혀 다른 디자인으로 리팩토링 해주셔서 감사합니다👍 더불어 코드도 잘 확인하였습니다. 💕

Comment on lines 27 to 50
const [isSearchBarOpened, setIsSearchBarOpened] = useState(false);
const { isOn, handleSetOn, handleSetOff } = useBooleanOutput();
const [isLoggedIn, setIsLoggedIn] = useState(false); // 로그인 상태를 관리하는 useState 추가

const { user } = useUser();

const { data: userData } = useQuery<UserType>({
queryKey: [QUERY_KEYS.userOne, user.id],
queryFn: () => getUserOne(user.id as number),
enabled: !!user.id,
});

const handleAuthButtonClick = () => {
handleSetOn();
};

const handleInactivateSearchBar = () => {
setIsSearchBarOpened(false);
};

const handleSearchIconClick = () => {
setIsSearchBarOpened(true);
};

Copy link
Contributor

Choose a reason for hiding this comment

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

검색바 오픈 상태를 관리하는 부분도 hook useBooleanOutput을 사용해서 리팩토링하면 좋을 것 같아요.

  const { isOn: isSearchBarOpened , handleSetOn: handleSearchBarOpened, handleSetOff: handleSetSearchBarClosed } = useBooleanOutput();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

항상 더 나은 대안을 주셔서 너무 감사합니다...♥️

Comment on lines 13 to 28
<button
onClick={() => setCurrentTab('recommendation')}
className={currentTab === 'recommendation' ? `${styles.activeTab}` : `${styles.tabButton}`}
>
추천
</button>
<button
onClick={() => setCurrentTab('recent')}
className={currentTab === 'recent' ? `${styles.activeTab}` : `${styles.tabButton}`}
>
최신
</button>
<button
onClick={() => setCurrentTab('following')}
className={currentTab === 'following' ? `${styles.activeTab}` : `${styles.tabButton}`}
>
Copy link
Contributor

Choose a reason for hiding this comment

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

선택된 탭에 따른 스타일 적용하는 부분은 따로 함수로 빼두면 좋을 것 같아요.

// 탭 스타일을 정하는 함수
  const getButtonStyle = (selectedTap: string) => {
    return currentTab === selectedTap ? styles.activeTab : styles.tabButton;
  };

// 사용
 <button onClick={() => setCurrentTab('recommendation')} className={getButtonStyle('recommendation')}> 
 </button>

Copy link
Contributor

Choose a reason for hiding this comment

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

헉 이런 방법이!!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

헙 대박....훨씬 깔끔하네요 ㅠㅠ 감사합니다..!

@Nahyun-Kang Nahyun-Kang merged commit 4c6f95d into 8-Sprinters:dev Oct 29, 2024
1 of 2 checks passed
@Nahyun-Kang Nahyun-Kang deleted the Feature/homeamend branch December 9, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants