Skip to content

Commit 70960b4

Browse files
Merge pull request #252 from dreamyPatisiel/dev
[Dev to Main] 기술블로그 메뉴 원복을 위한 `dev` => `main` 머지
2 parents af94a57 + 9582ea9 commit 70960b4

47 files changed

Lines changed: 1160 additions & 450 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/common/buttons/mainButtonsV2.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export function MainButtonV2({
3232
{/* 아이콘 왼쪽 정렬 */}
3333
{iconPosition === 'left' && icon}
3434
{/* 텍스트 */}
35-
<span className='p1 font-bold'>{text}</span>
35+
<span className='p1 font-bold'>{text}</span>{' '}
36+
{/* FIXME: 버튼 size마다 폰트 사이즈 조정 필요 */}
3637
{/* 아이콘 오른쪽 정렬 */}
3738
{iconPosition === 'right' && icon}
3839
{isPending && <Spinner width={16} height={16} color='var(--gray50)' />}

components/common/buttons/variants/textButton.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ export const TextButtonVariants = ({
4040
size: TextButtonSize;
4141
fontWeight: TextButtonFontWeight;
4242
}) => {
43+
const defaultClass = 'flex flex-row justify-center items-center gap-[0.8rem]';
4344
const { textbuttonColor, textbuttonSize, textbuttonLine, textbuttonFontWeight } =
4445
TextButtonVariantsClass;
4546
const colorClass = textbuttonColor[color];
4647
const sizeClass = textbuttonSize[size];
4748
const lineClass = textbuttonLine[line];
4849
const fontWeightClass = textbuttonFontWeight[fontWeight];
4950

50-
return cn(`${sizeClass} ${colorClass} ${lineClass} ${fontWeightClass}`);
51+
return cn(`${defaultClass} ${sizeClass} ${colorClass} ${lineClass} ${fontWeightClass}`);
5152
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import dynamic from 'next/dynamic';
2+
3+
import { useInfiniteTechBlogData } from '@pages/techblog/api/useInfiniteTechBlog';
4+
import {
5+
MOBILE_MAIN_TECH_VIEW_SIZE,
6+
TECH_VIEW_SIZE,
7+
} from '@pages/techblog/constants/techBlogConstants';
8+
9+
import { useMediaQueryContext } from '@/contexts/MediaQueryContext';
10+
import { TechInfiniteDataType } from '@/types/infiniteQueryType';
11+
12+
const DynamicTechBlogComponent = dynamic(
13+
() => import('@components/features/main/dynamicTechBlogComponent'),
14+
);
15+
16+
export default function MainTechBlogSection() {
17+
const { isMobile } = useMediaQueryContext();
18+
19+
const VIEW_SIZE = isMobile ? MOBILE_MAIN_TECH_VIEW_SIZE : TECH_VIEW_SIZE;
20+
21+
const techblogData = useInfiniteTechBlogData(
22+
'LATEST',
23+
undefined,
24+
undefined,
25+
VIEW_SIZE,
26+
) as TechInfiniteDataType;
27+
28+
return <DynamicTechBlogComponent data={techblogData} skeletonCnt={2} type='main' />;
29+
}

components/features/main/dynamicTechBlogComponent.tsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import React from 'react';
33
import dynamic from 'next/dynamic';
44

55
import NoMyInfoData from '@pages/myinfo/components/NoMyInfoData';
6-
import { useInfiniteTechBlogData } from '@pages/techblog/api/useInfiniteTechBlog';
7-
import {
8-
MOBILE_MAIN_TECH_VIEW_SIZE,
9-
TECH_VIEW_SIZE,
10-
} from '@pages/techblog/constants/techBlogConstants';
116
import { TechCardProps } from '@pages/techblog/types/techBlogType';
127

138
import { useObserver } from '@hooks/useObserver';
@@ -20,34 +15,26 @@ import {
2015
import { useMediaQueryContext } from '@/contexts/MediaQueryContext';
2116
import { TechInfiniteDataType } from '@/types/infiniteQueryType';
2217

18+
import BookmarkComponent from '../techblog/BookmarkComponent';
2319
import DesktopMainTechCard from '../techblog/desktopMainTechCard';
2420
import GradientDiv from './gradientDiv';
2521

2622
const DynamicTechCard = dynamic(() => import('@/pages/techblog/components/techCard'));
2723

2824
export default function DynamicTechBlogComponent({
25+
data,
2926
skeletonCnt,
3027
isScroll = true,
31-
bottomDiv,
3228
type = 'main',
33-
// data,
3429
}: {
30+
data: TechInfiniteDataType;
3531
skeletonCnt: number;
3632
isScroll?: boolean;
37-
bottomDiv?: React.MutableRefObject<null>;
38-
type: 'main' | 'myinfo';
39-
data?: TechInfiniteDataType; //FIXME: 추후에 수정 필요
33+
type?: 'main' | 'myinfo';
4034
}) {
4135
const { isMobile } = useMediaQueryContext();
4236

43-
const VIEW_SIZE = isMobile ? MOBILE_MAIN_TECH_VIEW_SIZE : TECH_VIEW_SIZE;
44-
45-
const data = useInfiniteTechBlogData(
46-
'LATEST',
47-
undefined,
48-
undefined,
49-
VIEW_SIZE,
50-
) as TechInfiniteDataType;
37+
const bottomDiv = React.useRef(null);
5138

5239
const { techBlogData, isFetchingNextPage, hasNextPage, status, onIntersect } = data;
5340

@@ -100,5 +87,19 @@ export default function DynamicTechBlogComponent({
10087
}
10188
};
10289

103-
return <>{getStatusComponent()}</>;
90+
return (
91+
<>
92+
{type === 'main' ? (
93+
<>{getStatusComponent()}</>
94+
) : (
95+
<div className='flex flex-col gap-[2.4rem] pb-40'>
96+
<BookmarkComponent />
97+
<div>
98+
{getStatusComponent()}
99+
<div ref={bottomDiv} />
100+
</div>
101+
</div>
102+
)}
103+
</>
104+
);
104105
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { useInfiniteMyInfoBookmark } from '@pages/myinfo/bookmark/api/useInfiniteMyInfoBookmark';
2+
import { MyinfoBookmarkDropdownProps } from '@pages/myinfo/bookmark/bookmarkType';
3+
4+
import { useDropdownStore } from '@stores/dropdownStore';
5+
6+
import { Dropdown } from '@components/common/dropdowns/dropdown';
7+
import MobileDropdown from '@components/common/dropdowns/mobileDropdown';
8+
9+
import { useMediaQueryContext } from '@/contexts/MediaQueryContext';
10+
import { TechInfiniteDataType } from '@/types/infiniteQueryType';
11+
12+
export default function BookmarkComponent() {
13+
const { isMobile } = useMediaQueryContext();
14+
const { sortOption } = useDropdownStore();
15+
16+
const myInfoBookmarkData = useInfiniteMyInfoBookmark(
17+
sortOption as MyinfoBookmarkDropdownProps,
18+
) as TechInfiniteDataType;
19+
20+
const hasData =
21+
myInfoBookmarkData?.techBlogData?.pages[0]?.data.content.length === 0 ? false : true;
22+
23+
return (
24+
<div className='flex justify-between items-center'>
25+
{isMobile ? <></> : <h1 className='h3 font-bold'>북마크</h1>}
26+
{isMobile ? (
27+
<div className='ml-auto'>
28+
<MobileDropdown type='bookmark' />
29+
</div>
30+
) : (
31+
<Dropdown type='bookmark' disable={!hasData} />
32+
)}
33+
</div>
34+
);
35+
}

components/features/techblog/desktopMainTechCard.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Link from 'next/link';
66
import { useQueryClient } from '@tanstack/react-query';
77

88
import { usePostBookmarkStatus } from '@pages/techblog/api/usePostBookmarkStatus';
9-
import { ArticleViewBtn } from '@pages/techblog/components/techDetailCardSubComponent';
9+
import { ArticleViewTextButton } from '@pages/techblog/components/techDetailCardSubComponent';
1010
import { TechContent, TechInfo } from '@pages/techblog/components/techSubComponents';
1111
import { TechCardProps } from '@pages/techblog/types/techBlogType';
1212

@@ -70,13 +70,7 @@ export default function DesktopMainTechCard({
7070
<div>
7171
<TechBlogImg id={id} thumbnailUrl={thumbnailUrl} rounded='rounded-[0.8rem]' size='small' />
7272

73-
<ArticleViewBtn
74-
techArticleUrl={techArticleUrl}
75-
fontSize='c1'
76-
textIconGap={'mr-[0.8rem]'}
77-
paddingY='pt-[1.6rem]'
78-
iconSize='w-[6px] h-[20px]'
79-
/>
73+
<ArticleViewTextButton techArticleUrl={techArticleUrl} paddingY='pt-[1.6rem]' />
8074
</div>
8175
<div>
8276
<div className='flex items-center justify-between border-white'>
@@ -105,6 +99,7 @@ export default function DesktopMainTechCard({
10599
date={regDate}
106100
company={company?.name}
107101
companyId={id}
102+
className='pb-[0.7rem]'
108103
/>
109104
<Link href={`${ROUTES.TECH_BLOG}/${id}`}>
110105
<TechContent content={contents} maxLines={4} className='mr-4' />

components/features/techblog/techBlogImg.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const TechBlogImg: FC<TechBlogImgProps> = ({
3131
id,
3232
isLogoImage = false,
3333
thumbnailUrl,
34-
rounded = 'rounded-[1.6rem]',
34+
rounded = 'rounded-Radius16',
3535
}) => {
3636
const [techMainImgUrl, setTechMainImgUrl] = useState<string>(DefaultTechMainImg.src);
3737
useEffect(() => {

constants/NavListConstants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import { ROUTES } from '@/constants/routes';
33
/** nav 목록 */
44
export const MENU_LISTS = [
55
{ key: 'pick', label: '픽픽픽 💘', route: ROUTES.PICKPICKPICK.MAIN },
6-
// { key: 'techblog', label: '기술블로그 🧪', route: ROUTES.TECH_BLOG },
6+
{ key: 'techblog', label: '기술블로그 🧪', route: ROUTES.TECH_BLOG },
77
];

constants/routes.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ const MY_INFO_ROUTES = {
2222
MY_COMMENT: '/myinfo/mywriting/mycomment' as const,
2323
BOOK_MARK: '/myinfo/bookmark' as const,
2424
ACCOUNT_DELETE: '/myinfo/account-delete' as const,
25+
NOTIFICATIONS: '/myinfo/notifications' as const,
26+
NOTIFICATION: '/myinfo/notifications/notification' as const,
27+
SUBSCRIBE: '/myinfo/notifications/subscribe' as const,
2528
};
2629

2730
export const ROUTES = {

pages/main/index.page.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Image from 'next/image';
55

66
import QueryErrorBoundary from '@components/common/QueryErrorBoundary';
77
import ArrowWithTitle from '@components/common/title/ArrowWithTitle';
8+
import MainTechBlogSection from '@components/features/main/MainTechBlogSection';
89
import MainCardComponent from '@components/features/main/mainCard/MainCardComponent';
910
import MetaHead from '@components/meta/MetaHead';
1011

@@ -16,10 +17,6 @@ const DynamicPickComponent = dynamic(
1617
() => import('@components/features/main/dynamicPickComponent'),
1718
);
1819

19-
const DynamicTechBlogComponent = dynamic(
20-
() => import('@components/features/main/dynamicTechBlogComponent'),
21-
);
22-
2320
export const MainPageLogo = () => {
2421
return (
2522
<div className='flex flex-col justify-center items-center mb-[8rem]'>
@@ -79,7 +76,7 @@ export default function Index() {
7976
routeURL={TECH_PATH}
8077
/>
8178
<QueryErrorBoundary type='section'>
82-
<DynamicTechBlogComponent skeletonCnt={2} type='main' />
79+
<MainTechBlogSection />
8380
</QueryErrorBoundary>
8481
</div>
8582
</section>

0 commit comments

Comments
 (0)