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

refact : Alarm Item에서 비즈니스 로직을 useAlarm으로 분리 #60

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

yeongipark
Copy link
Member

구현한 것

  1. Alarm Item에 너무 많은 비즈니스 로직이 있어 해당 로직을 useAlarm으로 분리했습니다.
  • 수정 후 AlarmItem 코드
const { url, text, clock, alarmCheck, handleOnFriend, handleImageClick } =
    useAlram({ type, check, id, data, time });

  return (
    <Wrap>
      {/*  안 읽은 알람일 때 빨간색 점 모양 보여주기 */}
      {!alarmCheck && <NotRead></NotRead>}
      <Container>
        <RowContainer>
          <Image
            src={url}
            alt={type}
            width={80}
            height={80}
            onClick={handleImageClick}
          />
          <P>{text}</P>
        </RowContainer>
        <Clock>{clock}</Clock>
      </Container>
      {/* 친구 요청 알람인 경우 거절 수락 버튼 띄우고 수락,거절 버튼이 눌렀으면 버튼 사라지게 구현*/}
      {type === "FRIEND_REQUEST" && (
        <Container>
          {!alarmCheck && (
            <>
  );
};

@yeongipark yeongipark merged commit 1280845 into develop Aug 6, 2024
1 check passed
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.

1 participant