From ce94457cc4a027ccd6ef088ab01160a244d3e419 Mon Sep 17 00:00:00 2001 From: Heojoooon <45158550+hjy0951@users.noreply.github.com> Date: Wed, 28 Aug 2024 01:45:46 +0900 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20no-floating-promises=20lint=20error?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20(#261)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/news/components/organisms/news-list.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/features/news/components/organisms/news-list.tsx b/features/news/components/organisms/news-list.tsx index 5c49332f..ac3cce23 100644 --- a/features/news/components/organisms/news-list.tsx +++ b/features/news/components/organisms/news-list.tsx @@ -1,5 +1,6 @@ 'use client'; +import { useQueryClient } from '@tanstack/react-query'; import { useRef } from 'react'; import { PullToRefresh } from '@/components/atoms'; @@ -8,12 +9,11 @@ import { TimeLineCard, TimeLineContent } from '@/features/main'; import { css } from '@/styled-system/css'; import { flex } from '@/styled-system/patterns'; +import { useNewsData } from '../../hooks'; import { NewsContent } from '../../types'; -import { EmptyNews, NewsItemWrapper, NewsItemWrapperProps } from '../molecules'; import { FindMemberButton, FollowingListLinkButton } from '../atoms'; -import { useNewsData } from '../../hooks'; -import { useQueryClient } from '@tanstack/react-query'; - +import { EmptyNews, NewsItemWrapper, NewsItemWrapperProps } from '../molecules'; + export const NewsList = () => { const ptrRef = useRef(null); const queryClient = useQueryClient(); @@ -21,13 +21,13 @@ export const NewsList = () => { if (!newsData) return null; - let contents = newsData.pages.flatMap(({ data }) => data.content); + const contents = newsData.pages.flatMap(({ data }) => data.content); const isEmpty = contents.length === 0; const lastItemIndex = contents.length - 1; const handlePullToRefresh = () => { - queryClient.invalidateQueries({ queryKey: ['newsData'] }); - queryClient.refetchQueries({ queryKey: ['newsData'], type: 'active' }); + void queryClient.invalidateQueries({ queryKey: ['newsData'] }); + void queryClient.refetchQueries({ queryKey: ['newsData'], type: 'active' }); }; return isEmpty ? ( From 9fe36c7ba261fe4d2fe49a78b6ad6bf9a0af9700 Mon Sep 17 00:00:00 2001 From: brian <90752841+wokbjso@users.noreply.github.com> Date: Wed, 28 Aug 2024 01:13:29 +0900 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20gnb=EC=97=90=EC=84=9C=20=EB=A7=88?= =?UTF-8?q?=EC=9D=B4=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=9D=BC=EC=9A=B0?= =?UTF-8?q?=ED=8C=85=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global-navigation-bar/global-navigation-bar.tsx | 5 ++++- hooks/apis/use-current-member-info.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/molecules/global-navigation-bar/global-navigation-bar.tsx b/components/molecules/global-navigation-bar/global-navigation-bar.tsx index 8e432e74..c0e3852b 100644 --- a/components/molecules/global-navigation-bar/global-navigation-bar.tsx +++ b/components/molecules/global-navigation-bar/global-navigation-bar.tsx @@ -3,6 +3,7 @@ import { MyIcon } from '@/components/atoms/icons/my-icon'; import { NewsIcon } from '@/components/atoms/icons/news-icon'; import { RecordIcon } from '@/components/atoms/icons/record-icon'; +import { useCurrentMemberInfo } from '@/hooks'; import { css } from '@/styled-system/css'; import { flex } from '@/styled-system/patterns'; @@ -11,10 +12,12 @@ import { useGlobalNavigationBar } from './use-global-navigation-bar'; export function GlobalNavigationBar() { //Todo: 내 userId api로 받아온 후, 마이페이지 route 추가 + const { data } = useCurrentMemberInfo(); + const barItems = [ { label: '기록', icon: RecordIcon, route: '/' }, { label: '소식', icon: NewsIcon, route: '/news' }, - { label: '마이', icon: MyIcon, route: '/profile/2' }, + { label: '마이', icon: MyIcon, route: `/profile/${data?.data.id}` }, ]; const { barIndex, handlers } = useGlobalNavigationBar( barItems.map((item) => item.route), diff --git a/hooks/apis/use-current-member-info.ts b/hooks/apis/use-current-member-info.ts index e70f6d3b..7f1a8ead 100644 --- a/hooks/apis/use-current-member-info.ts +++ b/hooks/apis/use-current-member-info.ts @@ -18,5 +18,6 @@ export const useCurrentMemberInfo = () => { queryKey: ['currentMember'], queryFn: () => getCurrentMemberInfo(), placeholderData: keepPreviousData, + staleTime: Infinity, }); }; From 258675bf16f6e8fc882e32d0c62cb0a41d2959ce Mon Sep 17 00:00:00 2001 From: brian <90752841+wokbjso@users.noreply.github.com> Date: Wed, 28 Aug 2024 01:34:48 +0900 Subject: [PATCH 3/5] =?UTF-8?q?chore:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=ED=8E=B8=EC=A7=91=20=EB=9D=BC=EC=9A=B0=ED=8C=85=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile/components/organisms/my-page.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/features/profile/components/organisms/my-page.tsx b/features/profile/components/organisms/my-page.tsx index 33c484f0..31b6262c 100644 --- a/features/profile/components/organisms/my-page.tsx +++ b/features/profile/components/organisms/my-page.tsx @@ -1,5 +1,6 @@ 'use client'; +import Link from 'next/link'; import { useState } from 'react'; import { Button } from '@/components/atoms'; @@ -24,13 +25,15 @@ export function MyProfile({
-