File tree Expand file tree Collapse file tree 5 files changed +46
-27
lines changed
Expand file tree Collapse file tree 5 files changed +46
-27
lines changed Original file line number Diff line number Diff line change 22
33import { ReactNode , useEffect } from 'react' ;
44import PerfectScrollbar from 'react-perfect-scrollbar' ;
5- import { Snowfall } from 'react-snowfall' ;
65
76import * as ChannelService from '@channel.io/channel-web-sdk-loader' ;
8- import { useMediaQuery } from 'usehooks-ts' ;
97
10- import BREAK_POINT from '@/lib/constants/breakPoint' ;
8+ import SnowfallSection from '@/components/organisms/SnowfallSection' ;
9+ import { isChristmasTheme } from '@/utils' ;
1110
1211function ClientProviders ( { children } : { children : ReactNode } ) {
13- const isSmall = useMediaQuery ( BREAK_POINT . small ) ;
14- const isXLarge = useMediaQuery ( BREAK_POINT . xLarge ) ;
15-
16- const getSnowflakeCount = ( ) => {
17- if ( isXLarge ) {
18- return 100 ;
19- }
20-
21- if ( isSmall ) {
22- return 60 ;
23- }
24-
25- return 80 ;
26- } ;
27-
2812 useEffect ( ( ) => {
2913 ChannelService . loadScript ( ) ;
3014 ChannelService . boot ( { pluginKey : process . env . NEXT_PUBLIC_CHANNEL_IO_PLUGIN_KEY } ) ;
3115 } , [ ] ) ;
3216
3317 return (
3418 < PerfectScrollbar >
35- < Snowfall
36- snowflakeCount = { getSnowflakeCount ( ) }
37- style = { {
38- position : 'fixed' ,
39- width : '100vw' ,
40- height : '100vh' ,
41- zIndex : 100 ,
42- } }
43- />
19+ { isChristmasTheme ( ) && < SnowfallSection /> }
4420 { children }
4521 </ PerfectScrollbar >
4622 ) ;
Original file line number Diff line number Diff line change 1+ 'use client' ;
2+
3+ import { useMemo } from 'react' ;
4+ import { Snowfall } from 'react-snowfall' ;
5+
6+ import { useMediaQuery } from 'usehooks-ts' ;
7+
8+ import BREAK_POINT from '@/lib/constants/breakPoint' ;
9+
10+ function SnowfallSection ( ) {
11+ const isSmall = useMediaQuery ( BREAK_POINT . small ) ;
12+ const isXLarge = useMediaQuery ( BREAK_POINT . xLarge ) ;
13+
14+ const snowflakeCount = useMemo ( ( ) => {
15+ if ( isXLarge ) {
16+ return 100 ;
17+ }
18+
19+ if ( isSmall ) {
20+ return 60 ;
21+ }
22+
23+ return 80 ;
24+ } , [ isSmall , isXLarge ] ) ;
25+
26+ return (
27+ < Snowfall
28+ style = {
29+ {
30+ position : 'fixed' ,
31+ width : '100vw' ,
32+ height : '100vh' ,
33+ zIndex : 100 ,
34+ }
35+ }
36+ snowflakeCount = { snowflakeCount }
37+ />
38+ ) ;
39+ }
40+
41+ export default SnowfallSection ;
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ function SponsorSection() {
2121 { sponsor : 'notefolio' , url : 'https://notefolio.net' , image : 'notefolio.png' } ,
2222 { sponsor : 'elice' , url : 'https://elice.io/ko' , image : 'elice.png' } ,
2323 { sponsor : 'sniperfactory' , url : 'https://sniperfactory.com' , image : 'sniperfactory.png' } ,
24+ { sponsor : 'zighang' , url : 'https://zighang.com' , image : 'zighang.png' } ,
25+ { sponsor : 'f-lab' , url : 'https://f-lab.kr' , image : 'f-lab.png' } ,
2426 ] ;
2527
2628 return (
You can’t perform that action at this time.
0 commit comments