From c28b9f0ba0ad2a02d78e15c0afb25f60ea0d099f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=97=A4=EC=9D=B8?= <157036488+Hain-tain@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:01:39 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix(src):=20import=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/SelectList/SelectList.style.ts | 1 + .../src/components/SelectList/SelectList.tsx | 24 ++++++++----------- .../src/components/SourceCode/SourceCode.tsx | 3 +-- .../SourceCodeEditor/SourceCodeEditor.tsx | 2 +- .../SourceCodeViewer.style.ts | 3 ++- frontend/src/components/Toast/Toast.style.ts | 4 +++- .../src/pages/TemplatePage/TemplatePage.tsx | 3 +-- 7 files changed, 19 insertions(+), 21 deletions(-) diff --git a/frontend/src/components/SelectList/SelectList.style.ts b/frontend/src/components/SelectList/SelectList.style.ts index 5ce32eb8b..5cc4fb1f1 100644 --- a/frontend/src/components/SelectList/SelectList.style.ts +++ b/frontend/src/components/SelectList/SelectList.style.ts @@ -1,6 +1,7 @@ import styled from '@emotion/styled'; import { theme } from '@/style/theme'; + import type { OptionProps } from './SelectList'; export const SelectListContainer = styled.div` diff --git a/frontend/src/components/SelectList/SelectList.tsx b/frontend/src/components/SelectList/SelectList.tsx index 5c4c23568..19af20f64 100644 --- a/frontend/src/components/SelectList/SelectList.tsx +++ b/frontend/src/components/SelectList/SelectList.tsx @@ -1,7 +1,7 @@ -import { useTheme } from '@emotion/react'; import { PropsWithChildren } from 'react'; import { Text } from '@/components'; +import { theme } from '@/style/theme'; import * as S from './SelectList.style'; @@ -12,19 +12,15 @@ export interface OptionProps { const SelectListBase = ({ children }: PropsWithChildren) => {children}; -const SelectListOption = ({ children, isSelected, onClick }: PropsWithChildren) => { - const theme = useTheme(); - - return ( - - - - {children} - - - - ); -}; +const SelectListOption = ({ children, isSelected, onClick }: PropsWithChildren) => ( + + + + {children} + + + +); const SelectList = Object.assign(SelectListBase, { Option: SelectListOption, diff --git a/frontend/src/components/SourceCode/SourceCode.tsx b/frontend/src/components/SourceCode/SourceCode.tsx index b00b75fe4..b6d7b8ae4 100644 --- a/frontend/src/components/SourceCode/SourceCode.tsx +++ b/frontend/src/components/SourceCode/SourceCode.tsx @@ -1,7 +1,6 @@ -import { ViewUpdate } from '@codemirror/view'; import { type LanguageName, loadLanguage } from '@uiw/codemirror-extensions-langs'; import { quietlight } from '@uiw/codemirror-theme-quietlight'; -import ReactCodeMirror, { EditorView, ReactCodeMirrorRef } from '@uiw/react-codemirror'; +import ReactCodeMirror, { EditorView, ReactCodeMirrorRef, type ViewUpdate } from '@uiw/react-codemirror'; import { useRef } from 'react'; import { useWindowWidth } from '@/hooks'; diff --git a/frontend/src/components/SourceCodeEditor/SourceCodeEditor.tsx b/frontend/src/components/SourceCodeEditor/SourceCodeEditor.tsx index 0f0e61348..d192f325b 100644 --- a/frontend/src/components/SourceCodeEditor/SourceCodeEditor.tsx +++ b/frontend/src/components/SourceCodeEditor/SourceCodeEditor.tsx @@ -1,4 +1,4 @@ -import { ViewUpdate } from '@codemirror/view'; +import { type ViewUpdate } from '@uiw/react-codemirror'; import { useRef } from 'react'; import { TrashcanIcon } from '@/assets/images'; diff --git a/frontend/src/components/SourceCodeViewer/SourceCodeViewer.style.ts b/frontend/src/components/SourceCodeViewer/SourceCodeViewer.style.ts index ec3ecb365..a1d2a55c5 100644 --- a/frontend/src/components/SourceCodeViewer/SourceCodeViewer.style.ts +++ b/frontend/src/components/SourceCodeViewer/SourceCodeViewer.style.ts @@ -1,6 +1,7 @@ import styled from '@emotion/styled'; import { Button } from '@/components'; +import { theme } from '@/style/theme'; export const SourceCodeViewerContainer = styled.div` overflow: hidden; @@ -17,7 +18,7 @@ export const FilenameContainer = styled.div` height: 3rem; padding: 1rem 1.5rem; - background: ${({ theme }) => theme.color.light.tertiary_600}; + background: ${theme.color.light.tertiary_600}; `; export const ToggleButton = styled.button` diff --git a/frontend/src/components/Toast/Toast.style.ts b/frontend/src/components/Toast/Toast.style.ts index 9d8bef67c..3818a73ea 100644 --- a/frontend/src/components/Toast/Toast.style.ts +++ b/frontend/src/components/Toast/Toast.style.ts @@ -1,6 +1,8 @@ import { keyframes } from '@emotion/react'; import styled from '@emotion/styled'; +import { theme } from '@/style/theme'; + const slideIn = keyframes` from { transform: translateY(20px) translateX(-50%); @@ -37,7 +39,7 @@ export const BaseToast = styled.div<{ visible: boolean; type: 'success' | 'fail' font-size: 16px; color: white; - background-color: ${({ theme, type }) => { + background-color: ${({ type }) => { switch (type) { case 'success': return theme.color.light.complementary_300; diff --git a/frontend/src/pages/TemplatePage/TemplatePage.tsx b/frontend/src/pages/TemplatePage/TemplatePage.tsx index cb60809c6..b4c6d7c21 100644 --- a/frontend/src/pages/TemplatePage/TemplatePage.tsx +++ b/frontend/src/pages/TemplatePage/TemplatePage.tsx @@ -1,4 +1,3 @@ -import { useTheme } from '@emotion/react'; import { Link, useParams } from 'react-router-dom'; import { ClockIcon, PrivateIcon, ShareIcon } from '@/assets/images'; @@ -25,6 +24,7 @@ import { useTrackPageViewed } from '@/service/amplitude'; import { trackClickTemplateShare, trackLikeButton } from '@/service/amplitude/track'; import { VISIBILITY_PRIVATE } from '@/service/constants'; import { ICON_SIZE } from '@/style/styleConstants'; +import { theme } from '@/style/theme'; import { formatRelativeTime } from '@/utils'; import { useTemplate, useLike } from './hooks'; @@ -37,7 +37,6 @@ const TemplatePage = () => { const { infoAlert } = useToast(); - const theme = useTheme(); const [isNonmemberAlerterOpen, toggleNonmemberAlerter] = useToggle(); const { From 0a87fff48285a2c14c9253df5ccb3f7ba4ffdb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=97=A4=EC=9D=B8?= <157036488+Hain-tain@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:02:10 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix(routes):=20=EB=A9=A4=EB=B2=84=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20RouteGuard=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/routes/router.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/src/routes/router.tsx b/frontend/src/routes/router.tsx index bebdb7e37..93df1b6b5 100644 --- a/frontend/src/routes/router.tsx +++ b/frontend/src/routes/router.tsx @@ -53,11 +53,9 @@ const router = createBrowserRouter([ { path: ROUTE_END_POINT.MEMBERS_TEMPLATES, element: ( - - }> - - - + }> + + ), }, {