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(my-recruit): 내 공고 뽀각 페이지 api 연결 #28

Merged
merged 5 commits into from
Aug 24, 2024

Conversation

qkrdmstlr3
Copy link
Member

@qkrdmstlr3 qkrdmstlr3 commented Aug 22, 2024

3. 관련 스크린샷을 첨부해주세요.


4. 완료 사항

  • 내 정보 뽀각 페이지에 있는 모든 api 연결

5. 추가 사항 / 코드 리뷰 받고 싶은 부분


Copy link

netlify bot commented Aug 22, 2024

Deploy Preview for bbogak failed.

Name Link
🔨 Latest commit 2371440
🔍 Latest deploy log https://app.netlify.com/sites/bbogak/deploys/66c995729d884c000912a9fd

Copy link

vercel bot commented Aug 24, 2024

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

Name Status Preview Comments Updated (UTC)
bbo-gak-client ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 24, 2024 8:12am

Copy link
Member

@Collection50 Collection50 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 12 to 27
function getAllRecruits() {
return http.get({ url: '/recruits' });
}

function getRecruitsBySeason({ season }: Request) {
return http.get({ url: '/recruits/bySeason', params: { season } });
}

export function useGetAllRecruits({ season }: Request) {
const result = useSuspenseQuery({
queryKey: [GET_RECRUITS, season],
queryFn: season === ALL_RECRUITMENT ? getAllRecruits : () => getRecruitsBySeason({ season }),
});

return result.data as unknown as Response;
}
Copy link
Member

Choose a reason for hiding this comment

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

useDeleteRecruit.ts에 있는 함수랑 선언 방법을 통일하면 좋을 것 같아요

export const GET_RECRUITS = 'recruits';

function getAllRecruits() {
return http.get({ url: '/recruits' });
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return http.get({ url: '/recruits' });
return http.get<Response>({ url: '/recruits' });

이렇게 사용하면 tanstack-query의 반환값 타입을 명시하지 않아도 가능해요

@@ -1,3 +1,4 @@
import { match } from 'ts-pattern';
Copy link
Member

Choose a reason for hiding this comment

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

ts-pattern을 사용하셨군요 !

Comment on lines +31 to +34
const rightMarkBackgroundColorClassName = match({ isOutOfDate, highlighted })
.with({ isOutOfDate: true }, () => 'bg-neutral-10')
.with({ highlighted: true }, () => 'bg-mint-40')
.otherwise(() => 'bg-neutral-95');
Copy link
Member

Choose a reason for hiding this comment

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

Cool !

Comment on lines +7 to +35
export function useResizeObserver(onResize: OnResize) {
const ref = useRef<HTMLDivElement | null>(null);
const resizeCallback = usePreservedCallback(onResize);

useIsomorphicLayoutEffect(() => {
let rAF = 0;

if (ref.current) {
const resizeObserver = new ResizeObserver((entries) => {
if (entries[0] != null) {
cancelAnimationFrame(rAF);

rAF = requestAnimationFrame(() => resizeCallback(entries[0]));
}
});

resizeObserver.observe(ref.current);

return () => {
cancelAnimationFrame(rAF);
if (ref.current != null) {
resizeObserver.unobserve(ref.current);
}
};
}
}, [resizeCallback]);

return ref;
}
Copy link
Member

Choose a reason for hiding this comment

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

Cool !

Comment on lines +12 to +34
export const AnimateHeight = forwardRef<HTMLDivElement, AnimateHeightProps>(function AnimateHeight({ children }, ref) {
const [updated, setUpdated] = useState(false);
const heightMotionValue = useMotionValue(-1);

const resizeRef = useResizeObserver(({ contentRect }) => {
if (updated === false) {
setUpdated(true);
// heightMotionValue.set(contentRect.height);
return;
}
heightMotionValue.set(contentRect.height);
// animate(heightMotionValue, contentRect.height, { duration: 0.7 });
});

return (
<motion.div
ref={ref}
style={{ maxHeight: updated ? heightMotionValue : 'auto', overflow: 'hidden' }}
transition={{ duration: 1 }}>
<div ref={resizeRef}>{children}</div>
</motion.div>
);
});
Copy link
Member

Choose a reason for hiding this comment

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

Cool !

<BoxCard
key={`${cardInfo.season}-${cardInfo.title}`}
{...cardInfo}
onDuedateAppend={() => {}}
Copy link
Member

Choose a reason for hiding this comment

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

추후 구현할 것으로 알고 있겠습니다 !

@qkrdmstlr3 qkrdmstlr3 changed the title feat(my-recruit): 내정보뽀각 페이지 api 연결 feat(my-recruit): 내 공고 뽀각 페이지 api 연결 Aug 24, 2024
Copy link
Collaborator

@woo-jk woo-jk left a comment

Choose a reason for hiding this comment

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

👍

@qkrdmstlr3 qkrdmstlr3 merged commit 9417ec4 into main Aug 24, 2024
3 of 7 checks passed
eunbeann pushed a commit that referenced this pull request Aug 25, 2024
* feat(my-recruit): 내정보뽀각 페이지 api 연결

* update

* save

* save
eunbeann pushed a commit that referenced this pull request Aug 25, 2024
* feat(my-recruit): 내정보뽀각 페이지 api 연결

* update

* save

* save
eunbeann pushed a commit that referenced this pull request Aug 26, 2024
* feat(my-recruit): 내정보뽀각 페이지 api 연결

* update

* save

* save
eunbeann pushed a commit that referenced this pull request Aug 26, 2024
* feat(my-recruit): 내정보뽀각 페이지 api 연결

* update

* save

* save
eunbeann pushed a commit that referenced this pull request Aug 26, 2024
* feat(my-recruit): 내정보뽀각 페이지 api 연결

* update

* save

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