Skip to content

Commit 816b099

Browse files
committed
Merge branch 'develop' of https://github.com/prgrms-web-devcourse-final-project/WEB2_3_9crops_FE into 130-feat-admin-qa
2 parents 51dd1b8 + e2d90da commit 816b099

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+203
-92
lines changed

src/App.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,23 @@ import RandomLettersPage from './pages/RandomLetters';
2727
import RollingPaperPage from './pages/RollingPaper';
2828
import WritePage from './pages/Write';
2929
import ShareApprovalPage from './pages/Share';
30+
import useThemeStore from './stores/themeStore';
31+
import { useServerSentEvents } from './hooks/useServerSentEvents';
3032

3133
const App = () => {
34+
const theme = useThemeStore((state) => state.theme);
3235
useViewport();
36+
useServerSentEvents();
37+
38+
const initializeTheme = () => {
39+
if (theme === 'dark') {
40+
document.documentElement.classList.add('dark');
41+
} else {
42+
document.documentElement.classList.remove('dark');
43+
}
44+
};
45+
46+
initializeTheme();
3347

3448
return (
3549
<Routes>
278 KB
Loading

src/assets/images/field-4-dark.png

266 KB
Loading
2.04 KB
Loading
530 KB
Loading
247 KB
Loading
544 KB
Loading

src/assets/images/landing-dark.png

1.41 MB
Loading

src/components/BackgroundBottom.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import BgItem from '@/assets/images/field-4.png';
2+
import BgItemDark from '@/assets/images/field-4-dark.png';
23

34
import BackgroundImageWrapper from './BackgroundImageWrapper';
5+
import useThemeStore from '@/stores/themeStore';
46

57
const BackgroundBottom = () => {
8+
const theme = useThemeStore((state) => state.theme);
9+
610
return (
711
<BackgroundImageWrapper
812
as="div"
9-
className="fixed bottom-[-40px] left-1/2 h-42 w-full -translate-x-1/2 opacity-70"
10-
imageUrl={BgItem}
13+
className="fixed bottom-[-40px] left-1/2 z-[-10] h-42 w-full -translate-x-1/2 opacity-70"
14+
imageUrl={theme === 'light' ? BgItem : BgItemDark}
1115
/>
1216
);
1317
};

src/components/NoticeRollingPaper.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ const NoticeRollingPaper = () => {
4646
<Link to={`/board/rolling/${data?.eventPostId}`}>
4747
<article
4848
className={twMerge(
49-
'text-gray-60 flex w-full items-center gap-2.5 rounded-lg px-4 py-2',
49+
'text-gray-60 flex w-full items-center gap-2.5 rounded-lg px-4 py-2 dark:text-white',
5050
'bg-linear-[275deg,rgba(255,255,255,0.4)_13.74%,rgba(238,238,238,0.4)_67.61%]',
51-
'shadow-[0_1px_6px_rgba(218,189,74,0.8)]',
51+
'shadow-[0_1px_6px_rgba(218,189,74,0.8)] dark:shadow-[0_1px_6px_rgba(255,255,255,0.8)]',
5252
)}
5353
>
54-
<NoticeIcon className="h-6 w-6 shrink-0 text-gray-50" />
54+
<NoticeIcon className="h-6 w-6 shrink-0 text-gray-50 dark:text-white" />
5555
<div ref={containerRef} className="w-full overflow-hidden whitespace-nowrap">
5656
<p
5757
ref={textRef}

0 commit comments

Comments
 (0)