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

[Release] v0.1.15 #327

Merged
merged 21 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2e92d2d
feat: #321 - ์ด๋ฏธ์ง€ ์ตœ์ ํ™”
bomi8489 Jul 23, 2024
7c6c90a
feat: #321 - ์ด๋ฏธ์ง€ ์ตœ์ ํ™”
bomi8489 Jul 23, 2024
7109c04
feat: #321 - link prefetch ์ ์šฉ
bomi8489 Jul 23, 2024
72a7883
feat: #321 - mockData ์‚ญ์ œ
bomi8489 Jul 23, 2024
a8708e7
feat: #321 - 2์ฐจ ๋ผ์ดํŠธํ•˜์šฐ์Šค ๊ธฐ๋ฐ˜ ์„ฑ๋Šฅ ๊ฐœ์„  ์ž‘์—…
bomi8489 Jul 26, 2024
de69398
feat: #321 - ๋ฉ”์ธํ™”๋ฉด suspense์ ์šฉ ๋ฐ ์Šค์ผˆ๋ ˆํ†ค ์ ์šฉ
bomi8489 Jul 30, 2024
b02106c
feat: #321 - ๋ธ”๋Ÿฌ ์ด๋ฏธ์ง€ ์‚ญ์ œ
bomi8489 Jul 30, 2024
1fac745
feat: #321 - ๋ฉ”์ธ์ŠคํŽ˜์ด์Šค ์Šค์ผˆ๋ ˆํ†คํ†คUI ์ ์šฉ
bomi8489 Aug 1, 2024
70a2c6e
feat: #310 - ๋ฉ”์ธํŽ˜์ด์ง€ Suspense์ ์šฉ ๋ฐ ์Šค์ผˆ๋ ˆํ†คUI ์ ์šฉ
bomi8489 Aug 3, 2024
1651668
chore: #324 - react ๋ฒ„์ „ 18.0.0์—์„œ 18.2.0๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ
bomi8489 Aug 3, 2024
d316df3
feat: #324 - ์ธ๊ธฐ๋งํฌ ์ปดํฌ๋„ŒํŠธ hydration
bomi8489 Aug 3, 2024
7e74e50
feat: #324 - Provider ์ปดํฌ๋„ŒํŠธ ๋งˆ์šดํŠธ์ด์ „ null ๋ฆฌํ„ด ์‚ญ์ œ
bomi8489 Aug 8, 2024
ffee84f
feat: #324 - ์ธ๊ธฐ๋งํฌ๋ฆฌ์ŠคํŠธ ๋ชจ๋“ˆํ™” ๋ฐ fetch ์ œ์™ธ ssr ์ ์šฉ
bomi8489 Aug 8, 2024
4b9768b
feat: #324 - ๋ฉ”์ธ์ŠคํŽ˜์ด์Šค fetch ์ œ์™ธ ssr ์ ์šฉ ๋ฐ ๋ฉ”์ธํ™”๋ฉด ssr ์ ์šฉ
bomi8489 Aug 8, 2024
01ee488
feat: #324 - Suspense ๋ฐ”์šด๋”๋ฆฌ์— Header ์ ์šฉ
bomi8489 Aug 8, 2024
633151f
feat: 324 - query์ƒ์„ฑ ์œ ํ‹ธํ•จ์ˆ˜ ์ถ”๊ฐ€
bomi8489 Aug 14, 2024
661423b
feat: #324 - ์ธ๊ธฐ๋งํฌ๋ฆฌ์ŠคํŠธ ๋ฐ์ดํ„ฐ prefetching ๋ฐ ssr ์ ์šฉ
bomi8489 Aug 14, 2024
168a2f1
feat: #324 - ๋ฉ”์ธ ํ™ˆ ์ˆ˜์ • ๋ฐ ๋ฉ”์ธ์ŠคํŽ˜์ด์Šค๋ฆฌ์ŠคํŠธ ์ˆ˜์ •
bomi8489 Aug 14, 2024
e8590a7
feat: #324 - ๋ฉ”์ธ์ŠคํŽ˜์ด์Šค๋ฆฌ์ŠคํŠธ prefetch ์ ์šฉ(์ˆ˜์ •์ค‘)
bomi8489 Aug 14, 2024
a5b7ab0
feat: #324 - ๋ฉ”์ธํŽ˜์ด์ง€ SSR ์ ์šฉ (1/2)
bomi8489 Aug 14, 2024
8c25ca6
feat: s3 ์ฃผ์†Œ ๋ณ€๊ฒฝ
dudwns Sep 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
})

const nextConfig = {
reactStrictMode: false,
images: {
domains: ['linkhub-s3.s3.ap-northeast-2.amazonaws.com'],
minimumCacheTTL: 1 * 60 * 60 * 24 * 365,
domains: ['linkhub-s3-2025.s3.ap-northeast-2.amazonaws.com'],
formats: ['image/avif', 'image/webp'],
remotePatterns: [
{
protocol: 'https',
hostname: 'linkhub-s3-2025.s3.ap-northeast-2.amazonaws.com',
port: '',
pathname: '/**',
},
],
},
async redirects() {
return [
Expand Down
32 changes: 12 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"next-pwa": "^5.6.0",
"next-themes": "^0.2.1",
"open-graph-scraper": "^6.3.2",
"react": "^18",
"react-dom": "^18",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.47.0",
"react-spinners": "^0.13.8",
"react-toastify": "^9.1.3",
Expand Down
17 changes: 8 additions & 9 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Suspense } from 'react'
import { Providers } from '@/components'
import Header from '@/components/common/Header/Header'
import ToastContainer from '@/components/common/Toast/ToastContainer'
Expand Down Expand Up @@ -35,7 +36,7 @@ export const metadata: Metadata = {
locale: 'ko_KR',
type: 'website',
images: [
'https://linkhub-s3.s3.ap-northeast-2.amazonaws.com/linkhub-og-image.png',
'https://linkhub-s3-2025.s3.ap-northeast-2.amazonaws.com/linkhub-og-image.png',
],
},
manifest: '/manifest.json',
Expand All @@ -53,17 +54,15 @@ export default function RootLayout({
children: React.ReactNode
}) {
return (
<html
lang="ko"
className={`${pretendard.variable}`}>
<html lang="ko">
<TanstackQueryContext>
<AuthProvider>
<body className="bg-bgColor">
<body className={`bg-bgColor ${pretendard.variable}`}>
<Providers>
<div
id="root"
className="relative mx-auto min-h-screen w-full pb-4 shadow-xl">
<Header />
<div className="relative mx-auto min-h-screen w-full pb-4 shadow-xl">
<Suspense>
<Header />
</Suspense>
<main className="pt-[53px]">{children}</main>
</div>
<ToastContainer />
Expand Down
1 change: 1 addition & 0 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const NotFoundPage = () => {
width={240}
height={300}
alt="404"
placeholder="blur"
/>
<div className="flex flex-col items-center text-base">
<div>{NOT_FOUND.TEXT_1}</div>
Expand Down
110 changes: 11 additions & 99 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,110 +1,22 @@
'use client'

import { CategoryList, Dropdown, LinkItem, Spinner } from '@/components'
import FloatingButton from '@/components/FloatingButton/FloatingButton'
import { ChipColors } from '@/components/common/Chip/Chip'
import DeferredComponent from '@/components/common/DeferedComponent/DeferedComponent'
import MainSpaceList from '@/components/common/MainSpaceList/MainSpaceList'
import { useCategoryParam, useSortParam } from '@/hooks'
import useGetPopularLinks from '@/hooks/useGetPopularLinks'
import { fetchGetSpaces } from '@/services/space/spaces'
import { PopularLinkResBody } from '@/types'
import 'swiper/css'
import 'swiper/css/free-mode'
import 'swiper/css/pagination'
import { FreeMode } from 'swiper/modules'
import { Swiper, SwiperSlide } from 'swiper/react'
import HydratePopularLinkList from '@/components/PopularLinkList/HydratePopularLinkList'
import FloatingBtnController from '@/components/common/MainSpaceList/FloatingBtnController'
import MainSpaceHeader from '@/components/common/MainSpaceList/MainSpaceHeader'
import SpaceListController from '@/components/common/MainSpaceList/SpaceListController'

export default function Home() {
const { links, isPopularLinksLoading } = useGetPopularLinks()
const { sort, sortIndex, handleSortChange } = useSortParam('space')
const { category, categoryIndex, handleCategoryChange } =
useCategoryParam('all')

return isPopularLinksLoading ? (
<DeferredComponent>
<Spinner />
</DeferredComponent>
) : (
return (
<>
<section className="px-4 pb-8">
<h2 className="py-4 font-bold text-gray9">์ธ๊ธฐ์žˆ๋Š” ๋งํฌ</h2>
{links && (
<Swiper
slidesPerView={2.2}
breakpoints={{
640: {
slidesPerView: 2.2,
},
743: {
slidesPerView: 3.2,
},
1099: {
slidesPerView: 4.2,
},
1455: {
slidesPerView: 5.2,
},
1811: {
slidesPerView: 6.2,
},
2152: {
slidesPerView: 7.2,
},

2324: {
slidesPerView: 8.2,
},
}}
spaceBetween={16}
freeMode={true}
pagination={{
clickable: true,
}}
modules={[FreeMode]}
className="mySwiper">
{links.map((link: PopularLinkResBody) => (
<SwiperSlide key={link.linkId}>
<LinkItem
linkId={link.linkId}
title={link.title}
url={link.url}
tagName={link.tagName}
tagColor={link.tagColor as ChipColors}
isInitLiked={link.isLiked}
likeInitCount={link.likeCount}
type="card"
/>
</SwiperSlide>
))}
</Swiper>
)}
<div className="min-h-[101.5px]">
<HydratePopularLinkList />
</div>
</section>
<section>
<div className="sticky top-[53px] z-40 bg-bgColor">
<div className="flex items-center justify-between px-4 pt-2">
<h2 className="font-bold text-gray9">์ŠคํŽ˜์ด์Šค ๋ชจ์Œ</h2>
<Dropdown
type="space"
placement="right"
defaultIndex={sortIndex}
onChange={handleSortChange}
/>
</div>
<CategoryList
type="all"
defaultIndex={categoryIndex}
onChange={handleCategoryChange}
/>
</div>
<MainSpaceList
queryKey="main"
sort={sort ?? ''}
category={category ?? ''}
fetchFn={fetchGetSpaces}
/>
<MainSpaceHeader />
<SpaceListController />
</section>
<FloatingButton />
<FloatingBtnController />
</>
)
}
66 changes: 66 additions & 0 deletions src/components/PopularLink/PopularLinkList/PopularLinkList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
'use client'

import useGetPopularLinks from '@/components/PopularLinkList/hooks/useGetPopularLinks'
import { ChipColors } from '@/components/common/Chip/Chip'
import LinkItem from '@/components/common/LinkItem/LinkItem'
import { PopularLinkResBody } from '@/types'
import 'swiper/css'
import 'swiper/css/free-mode'
import 'swiper/css/pagination'
import { FreeMode } from 'swiper/modules'
import { Swiper, SwiperSlide } from 'swiper/react'

const PopularLinkList = () => {
const { data } = useGetPopularLinks()
return (
<Swiper
slidesPerView={2.2}
breakpoints={{
640: {
slidesPerView: 2.2,
},
743: {
slidesPerView: 3.2,
},
1099: {
slidesPerView: 4.2,
},
1455: {
slidesPerView: 5.2,
},
1811: {
slidesPerView: 6.2,
},
2152: {
slidesPerView: 7.2,
},
2324: {
slidesPerView: 8.2,
},
}}
spaceBetween={16}
freeMode={true}
pagination={{
clickable: true,
}}
modules={[FreeMode]}
className="mySwiper">
{data?.responses.map((link: PopularLinkResBody) => (
<SwiperSlide key={link.linkId}>
<LinkItem
linkId={link.linkId}
title={link.title}
url={link.url}
tagName={link.tagName}
tagColor={link.tagColor as ChipColors}
isInitLiked={link.isLiked}
likeInitCount={link.likeCount}
type="card"
/>
</SwiperSlide>
))}
</Swiper>
)
}

export default PopularLinkList
21 changes: 21 additions & 0 deletions src/components/PopularLinkList/HydratePopularLinkList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react'
import { getQueryClient } from '@/lib/queryClient'
import { fetchGetPopularLinks } from '@/services/link/link'
import { HydrationBoundary, dehydrate } from '@tanstack/react-query'
import PopularLinkList from './PopularLinkList'

const HydratePopularLinkList = async () => {
const queryClient = getQueryClient()
await queryClient.prefetchQuery({
queryKey: ['PopularLinks'],
queryFn: fetchGetPopularLinks,
})

return (
<HydrationBoundary state={dehydrate(queryClient)}>
<PopularLinkList />
</HydrationBoundary>
)
}

export default React.memo(HydratePopularLinkList)
Loading
Loading