From 84af82938a3a43d2ed8b098c1d68fda3287ad2a9 Mon Sep 17 00:00:00 2001 From: wonderlandpark Date: Wed, 3 Mar 2021 14:25:09 +0900 Subject: [PATCH] feat: added ResponsiveGrid component --- components/BotCard.tsx | 4 ++-- components/ResponsiveGrid.tsx | 9 +++++++++ pages/categories/[category].tsx | 5 +++-- pages/index.tsx | 21 +++++++++++---------- pages/list/new.tsx | 5 +++-- pages/list/votes.tsx | 5 +++-- pages/search.tsx | 5 +++-- pages/users/[id].tsx | 5 +++-- 8 files changed, 37 insertions(+), 22 deletions(-) create mode 100644 components/ResponsiveGrid.tsx diff --git a/components/BotCard.tsx b/components/BotCard.tsx index 994a25d..d96a011 100644 --- a/components/BotCard.tsx +++ b/components/BotCard.tsx @@ -28,7 +28,7 @@ const BotCard = ({ manage = false, bot }: BotProps): JSX.Element => {
-
+
{

{bot.name}

-
+
diff --git a/components/ResponsiveGrid.tsx b/components/ResponsiveGrid.tsx new file mode 100644 index 0000000..1fb62fc --- /dev/null +++ b/components/ResponsiveGrid.tsx @@ -0,0 +1,9 @@ +import { ReactNode } from 'react' + +const ResponsiveGrid = ({ children }:{ children: ReactNode }):JSX.Element => { + return
+ {children} +
+} + +export default ResponsiveGrid \ No newline at end of file diff --git a/pages/categories/[category].tsx b/pages/categories/[category].tsx index debfb5b..190fc4a 100644 --- a/pages/categories/[category].tsx +++ b/pages/categories/[category].tsx @@ -10,6 +10,7 @@ import NotFound from 'pages/404' const Hero = dynamic(() => import('@components/Hero')) const Advertisement = dynamic(() => import('@components/Advertisement')) const SEO = dynamic(() => import('@components/SEO')) +const ResponsiveGrid = dynamic(() => import('@components/ResponsiveGrid')) const BotCard = dynamic(() => import('@components/BotCard')) const Container = dynamic(() => import('@components/Container')) const Paginator = dynamic(() => import('@components/Paginator')) @@ -22,11 +23,11 @@ const Category: NextPage = ({ data, query }) => { -
+ { data.data.map(bot => ) } -
+
diff --git a/pages/index.tsx b/pages/index.tsx index 773bf8f..b5ef1fc 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -5,10 +5,11 @@ import { BotList } from '@types' import * as Query from '@utils/Query' import LongButton from '@components/LongButton' -const Advertisement = dynamic(()=> import('@components/Advertisement')) -const Container = dynamic(()=> import('@components/Container')) -const BotCard = dynamic(()=> import('@components/BotCard')) -const Paginator = dynamic(()=> import('@components/Paginator')) +const Advertisement = dynamic(() => import('@components/Advertisement')) +const ResponsiveGrid = dynamic(() => import('@components/ResponsiveGrid')) +const Container = dynamic(() => import('@components/Container')) +const BotCard = dynamic(() => import('@components/BotCard')) +const Paginator = dynamic(() => import('@components/Paginator')) const Hero = dynamic(() => import('@components/Hero')) const Index: NextPage = ({ votes, newBots, trusted }) => { @@ -21,32 +22,32 @@ const Index: NextPage = ({ votes, newBots, trusted }) => { 하트 랭킹

하트를 많이 받은 봇들의 순위입니다!

-
+ { votes.data.map(bot=> ) } -
+

새로운 봇

최근에 한국 디스코드봇 리스트에 추가된 따끈따끈한 봇입니다.

-
+ { newBots.data.slice(0, 4).map(bot=> ) } -
+ 더보기

신뢰된 봇

KOREANBOTS에서 인증받은 신뢰할 수 있는 봇들입니다!!

-
+ { trusted.data.slice(0, 4).map(bot=> ) } -
+ diff --git a/pages/list/new.tsx b/pages/list/new.tsx index 9846bd0..59486d0 100644 --- a/pages/list/new.tsx +++ b/pages/list/new.tsx @@ -9,6 +9,7 @@ const Advertisement = dynamic(() => import('@components/Advertisement')) const SEO = dynamic(() => import('@components/SEO')) const BotCard = dynamic(() => import('@components/BotCard')) const Container = dynamic(() => import('@components/Container')) +const ResponsiveGrid = dynamic(() => import('@components/ResponsiveGrid')) const New:NextPage = ({ data }) => { return <> @@ -16,11 +17,11 @@ const New:NextPage = ({ data }) => { -
+ { data.data.map(bot => ) } -
+
diff --git a/pages/list/votes.tsx b/pages/list/votes.tsx index 61b8c1b..24c8b59 100644 --- a/pages/list/votes.tsx +++ b/pages/list/votes.tsx @@ -13,6 +13,7 @@ const Hero = dynamic(() => import('@components/Hero')) const Advertisement = dynamic(() => import('@components/Advertisement')) const SEO = dynamic(() => import('@components/SEO')) const BotCard = dynamic(() => import('@components/BotCard')) +const ResponsiveGrid = dynamic(() => import('@components/ResponsiveGrid')) const Container = dynamic(() => import('@components/Container')) const Paginator = dynamic(() => import('@components/Paginator')) @@ -24,11 +25,11 @@ const Votes:NextPage = ({ data }) => { -
+ { data.data.map(bot => ) } -
+
diff --git a/pages/search.tsx b/pages/search.tsx index 1a70213..edf2baa 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -14,6 +14,7 @@ const Advertisement = dynamic(() => import('@components/Advertisement')) const SEO = dynamic(() => import('@components/SEO')) const BotCard = dynamic(() => import('@components/BotCard')) const Container = dynamic(() => import('@components/Container')) +const ResponsiveGrid = dynamic(() => import('@components/ResponsiveGrid')) const Paginator = dynamic(() => import('@components/Paginator')) const Search:NextPage = ({ data, query }) => { @@ -29,11 +30,11 @@ const Search:NextPage = ({ data, query }) => { { !data || data.data.length === 0 ?

검색 결과가 없습니다.

: <> -
+ { data.data.map(bot => ) } -
+ } diff --git a/pages/users/[id].tsx b/pages/users/[id].tsx index d6e07e7..bc6538f 100644 --- a/pages/users/[id].tsx +++ b/pages/users/[id].tsx @@ -15,6 +15,7 @@ const SEO = dynamic(() => import('@components/SEO')) const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar')) const Divider = dynamic(() => import('@components/Divider')) const BotCard = dynamic(() => import('@components/BotCard')) +const ResponsiveGrid = dynamic(() => import('@components/ResponsiveGrid')) const Tag = dynamic(() => import('@components/Tag')) const Advertisement = dynamic(() => import('@components/Advertisement')) const Tooltip = dynamic(() => import('@components/Tooltip')) @@ -83,11 +84,11 @@ const Users: NextPage = ({ data }) => {

제작한 봇

-
+ {(data.bots as Bot[]).map((bot: Bot) => ( ))} -
+ )