From 7f4bdf9754bf201f3a40f741fbedfbf1fc2ef835 Mon Sep 17 00:00:00 2001 From: Yeongjun Kim Date: Tue, 31 Oct 2023 16:19:27 +0900 Subject: [PATCH 1/6] =?UTF-8?q?refactor:=20#27=20-=20Providers=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=AA=85=20=EC=88=98=EC=A0=95=20=EC=A7=84=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Providers/providers.tsx | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 src/components/Providers/providers.tsx diff --git a/src/components/Providers/providers.tsx b/src/components/Providers/providers.tsx deleted file mode 100644 index 477da4a4..00000000 --- a/src/components/Providers/providers.tsx +++ /dev/null @@ -1,9 +0,0 @@ -'use client' - -import { ThemeProvider } from 'next-themes' - -const Providers = ({ children }: { children: React.ReactNode }) => { - return {children} -} - -export default Providers From 1c9c162b8fd100b7d4f895918ae27efa2c0bfd00 Mon Sep 17 00:00:00 2001 From: Yeongjun Kim Date: Tue, 31 Oct 2023 16:20:36 +0900 Subject: [PATCH 2/6] =?UTF-8?q?refactor:=20#27=20-=20Providers=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=AA=85=20=EC=88=98=EC=A0=95=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Providers/Providers.tsx | 9 +++++++++ src/components/index.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/components/Providers/Providers.tsx diff --git a/src/components/Providers/Providers.tsx b/src/components/Providers/Providers.tsx new file mode 100644 index 00000000..477da4a4 --- /dev/null +++ b/src/components/Providers/Providers.tsx @@ -0,0 +1,9 @@ +'use client' + +import { ThemeProvider } from 'next-themes' + +const Providers = ({ children }: { children: React.ReactNode }) => { + return {children} +} + +export default Providers diff --git a/src/components/index.ts b/src/components/index.ts index d0476a34..8e276dd3 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,4 +1,4 @@ -export { default as Providers } from './Providers/providers' +export { default as Providers } from './Providers/Providers' export { default as ThemeButton } from './ThemeButton/themeButton' export { default as Avatar } from './common/Avatar/Avatar' export { default as AvatarGroup } from './common/AvatarGroup/AvatarGroup' From f1376bfea9c1e717073eb9a43dc54988934d60ff Mon Sep 17 00:00:00 2001 From: Yeongjun Kim Date: Tue, 31 Oct 2023 16:21:18 +0900 Subject: [PATCH 3/6] =?UTF-8?q?refactor:=20#27=20-=20ThemeButton=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EB=AA=85=20=EC=88=98=EC=A0=95=20=EC=A7=84?= =?UTF-8?q?=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ThemeButton/themeButton.tsx | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/components/ThemeButton/themeButton.tsx diff --git a/src/components/ThemeButton/themeButton.tsx b/src/components/ThemeButton/themeButton.tsx deleted file mode 100644 index 5ff40269..00000000 --- a/src/components/ThemeButton/themeButton.tsx +++ /dev/null @@ -1,17 +0,0 @@ -'use client' - -import { useTheme } from 'next-themes' - -const ThemeButton = () => { - const { theme, setTheme } = useTheme() - - return ( - - ) -} - -export default ThemeButton From 2d7563455711ab46ff0de1ff9836d0fa5a385164 Mon Sep 17 00:00:00 2001 From: Yeongjun Kim Date: Tue, 31 Oct 2023 16:22:00 +0900 Subject: [PATCH 4/6] =?UTF-8?q?refactor:=20#27=20-=20ThemeButton=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EB=AA=85=20=EC=88=98=EC=A0=95=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ThemeButton/ThemeButton.tsx | 17 +++++++++++++++++ src/components/index.ts | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/components/ThemeButton/ThemeButton.tsx diff --git a/src/components/ThemeButton/ThemeButton.tsx b/src/components/ThemeButton/ThemeButton.tsx new file mode 100644 index 00000000..5ff40269 --- /dev/null +++ b/src/components/ThemeButton/ThemeButton.tsx @@ -0,0 +1,17 @@ +'use client' + +import { useTheme } from 'next-themes' + +const ThemeButton = () => { + const { theme, setTheme } = useTheme() + + return ( + + ) +} + +export default ThemeButton diff --git a/src/components/index.ts b/src/components/index.ts index 8e276dd3..6ebee667 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,5 +1,5 @@ export { default as Providers } from './Providers/Providers' -export { default as ThemeButton } from './ThemeButton/themeButton' +export { default as ThemeButton } from './ThemeButton/ThemeButton' export { default as Avatar } from './common/Avatar/Avatar' export { default as AvatarGroup } from './common/AvatarGroup/AvatarGroup' export { default as Chip } from './common/Chip/Chip' From a85fb4e30d2e71280b0efba8a6c1662dbc767688 Mon Sep 17 00:00:00 2001 From: Yeongjun Kim Date: Tue, 31 Oct 2023 16:23:27 +0900 Subject: [PATCH 5/6] =?UTF-8?q?refactor:=20#27=20-=20ThemeButton=EB=A5=BC?= =?UTF-8?q?=20common=20=ED=8F=B4=EB=8D=94=20=EB=82=B4=EB=B6=80=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/{ => common}/ThemeButton/ThemeButton.tsx | 0 src/components/index.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename src/components/{ => common}/ThemeButton/ThemeButton.tsx (100%) diff --git a/src/components/ThemeButton/ThemeButton.tsx b/src/components/common/ThemeButton/ThemeButton.tsx similarity index 100% rename from src/components/ThemeButton/ThemeButton.tsx rename to src/components/common/ThemeButton/ThemeButton.tsx diff --git a/src/components/index.ts b/src/components/index.ts index 6ebee667..a8316f30 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,5 +1,5 @@ export { default as Providers } from './Providers/Providers' -export { default as ThemeButton } from './ThemeButton/ThemeButton' +export { default as ThemeButton } from './common/ThemeButton/ThemeButton' export { default as Avatar } from './common/Avatar/Avatar' export { default as AvatarGroup } from './common/AvatarGroup/AvatarGroup' export { default as Chip } from './common/Chip/Chip' From fd652564089806b3e052a0fa0e00af33d7316af4 Mon Sep 17 00:00:00 2001 From: Yeongjun Kim Date: Tue, 31 Oct 2023 16:28:53 +0900 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20#27=20-=20hydration=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Providers/Providers.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/Providers/Providers.tsx b/src/components/Providers/Providers.tsx index 477da4a4..2e08beaf 100644 --- a/src/components/Providers/Providers.tsx +++ b/src/components/Providers/Providers.tsx @@ -1,8 +1,19 @@ 'use client' +import { useEffect, useState } from 'react' import { ThemeProvider } from 'next-themes' const Providers = ({ children }: { children: React.ReactNode }) => { + const [isMount, setMount] = useState(false) + + useEffect(() => { + setMount(true) + }, []) + + if (!isMount) { + return null + } + return {children} }