Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

로그인하지 않아도 사용자 페이지 접근 가능하도록 RouteGuard 제거 #891

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/components/SelectList/SelectList.style.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import styled from '@emotion/styled';

import { theme } from '@/style/theme';

import type { OptionProps } from './SelectList';

export const SelectListContainer = styled.div`
Expand Down
24 changes: 10 additions & 14 deletions frontend/src/components/SelectList/SelectList.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -12,19 +12,15 @@ export interface OptionProps {

const SelectListBase = ({ children }: PropsWithChildren) => <S.SelectListContainer>{children}</S.SelectListContainer>;

const SelectListOption = ({ children, isSelected, onClick }: PropsWithChildren<OptionProps>) => {
const theme = useTheme();

return (
<S.SelectListOption href={`#${children}`} onClick={onClick} isSelected={isSelected}>
<S.SelectListText className='select-list-text'>
<Text.Medium color={isSelected ? theme.color.light.white : theme.color.light.secondary_600}>
{children}
</Text.Medium>
</S.SelectListText>
</S.SelectListOption>
);
};
const SelectListOption = ({ children, isSelected, onClick }: PropsWithChildren<OptionProps>) => (
<S.SelectListOption href={`#${children}`} onClick={onClick} isSelected={isSelected}>
<S.SelectListText className='select-list-text'>
<Text.Medium color={isSelected ? theme.color.light.white : theme.color.light.secondary_600}>
{children}
</Text.Medium>
</S.SelectListText>
</S.SelectListOption>
);

const SelectList = Object.assign(SelectListBase, {
Option: SelectListOption,
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/SourceCode/SourceCode.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import styled from '@emotion/styled';

import { Button } from '@/components';
import { theme } from '@/style/theme';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다만, 이렇게 정적 파일 변수를 import해서 쓴다면 이제 ThemeProvider를 쓸 필요가 없는 걸까요?


export const SourceCodeViewerContainer = styled.div`
overflow: hidden;
Expand All @@ -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`
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/Toast/Toast.style.ts
Original file line number Diff line number Diff line change
@@ -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%);
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/pages/TemplatePage/TemplatePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useTheme } from '@emotion/react';
import { Link, useParams } from 'react-router-dom';

import { ClockIcon, PrivateIcon, ShareIcon } from '@/assets/images';
Expand All @@ -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';
Expand All @@ -37,7 +37,6 @@ const TemplatePage = () => {

const { infoAlert } = useToast();

const theme = useTheme();
const [isNonmemberAlerterOpen, toggleNonmemberAlerter] = useToggle();

const {
Expand Down
8 changes: 3 additions & 5 deletions frontend/src/routes/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ const router = createBrowserRouter([
{
path: ROUTE_END_POINT.MEMBERS_TEMPLATES,
element: (
<RouteGuard isLoginRequired redirectTo={ROUTE_END_POINT.LOGIN}>
<ErrorBoundary fallback={<NotFoundPage />}>
<MyTemplatePage />
</ErrorBoundary>
</RouteGuard>
<ErrorBoundary fallback={<NotFoundPage />}>
<MyTemplatePage />
</ErrorBoundary>
),
},
{
Expand Down