Skip to content

Commit e2d1e40

Browse files
authored
chore: 후원사 로고 수정 (#327)
* refactor: snowfall 코드 리팩토링 * feat: 직행, F-lab 후원사 로고 추가
1 parent 4e37d9b commit e2d1e40

File tree

5 files changed

+46
-27
lines changed

5 files changed

+46
-27
lines changed
4.64 KB
Loading
3.75 KB
Loading

apps/web/src/components/global/ClientProviders/index.tsx

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,21 @@
22

33
import { ReactNode, useEffect } from 'react';
44
import PerfectScrollbar from 'react-perfect-scrollbar';
5-
import { Snowfall } from 'react-snowfall';
65

76
import * 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

1211
function 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
);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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;

apps/web/src/components/organisms/SponsorSection/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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 (

0 commit comments

Comments
 (0)