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

[FE] refactor after merge #643, #642 #649

Merged
merged 3 commits into from
Feb 5, 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
36 changes: 0 additions & 36 deletions frontend/src/apis/Patrick/http.ts

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/src/apis/Patrick/index.ts

This file was deleted.

3 changes: 3 additions & 0 deletions frontend/src/apis/new/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ import { TopicCardProps } from '../../types/Topic';
import { http } from './http';

export const getTopics = (url: string) => http.get<TopicCardProps[]>(url);

export const getProfile = () =>
http.get<TopicCardProps[] | null>('/members/my/topics');
Copy link
Collaborator

Choose a reason for hiding this comment

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

오호.. 북마크 작업할 때 null일수도 있다는걸 제가 간과한거 같은데 이 부분 수정해야겠군요..

Copy link
Collaborator

Choose a reason for hiding this comment

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

구우웃~!

2 changes: 1 addition & 1 deletion frontend/src/components/TopicCardList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ReactNode } from 'react';

import useGetTopics from '../../apiHooks/new/useGetTopics';
import Button from '../common/Button';
import Flex from '../common/Flex';
import Grid from '../common/Grid';
import Space from '../common/Space';
import Text from '../common/Text';
import TopicCard from '../TopicCard';
import useProfileList from '../../hooks/queries/useProfileList';

interface TopicCardListProps {
url: string;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export const SIDEBAR = '372px';
export const LAYOUT_PADDING = '40px';

export const DEFAULT_TOPIC_IMAGE =
'https://dr702blqc4x5d.cloudfront.net/2023-map-be-fine/icon/topic_defaultImage.svg';
'https://velog.velcdn.com/images/semnil5202/post/37f3bcb9-0b07-4100-85f6-f1d5ad037c14/image.svg';
export const DEFAULT_PROFILE_IMAGE =
'https://dr702blqc4x5d.cloudfront.net/2023-map-be-fine/icon/profile_defaultImage.svg';
'https://avatars.githubusercontent.com/u/103165859?v=4';
Comment on lines -8 to +10
Copy link
Collaborator

Choose a reason for hiding this comment

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

차라리 이미지 호스팅 서비스를 이용하는게 나을려나요?

Copy link
Collaborator

Choose a reason for hiding this comment

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

기본 이지미라 저는 괜찮다고 생각하기는 하는데 흠... 호스팅 서비스를 이용하면 더 안정적인 걸까요?!


export const DEFAULT_PROD_URL =
process.env.APP_URL || 'https://mapbefine.com/api';
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/hooks/queries/useProfileList.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useSuspenseQuery } from '@tanstack/react-query';
import { getProfile } from '../../apis/Patrick';

import { getProfile } from '../../apis/new';

const useProfileList = () => {
const { data, refetch } = useSuspenseQuery({
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import ReactDOM from 'react-dom/client';
import ReactGA from 'react-ga4';
import { ThemeProvider } from 'styled-components';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

import App from './App';
import ErrorBoundary from './components/ErrorBoundary';
Expand All @@ -25,8 +24,6 @@ const rootElement = document.getElementById('root');
if (!rootElement) throw new Error('Failed to find the root element');
const root = ReactDOM.createRoot(rootElement);

const queryClient = new QueryClient();

Comment on lines -28 to -29
Copy link
Collaborator

Choose a reason for hiding this comment

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

그 제가 적용한 기본옵션 자동 refetch 옵션 대부분 false 처리해두었는데 이 부분 추후에 정책적으로 회의 한 번 해보시죠~

Copy link
Collaborator

Choose a reason for hiding this comment

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

네넹!

// if (process.env.NODE_ENV === 'development') {
// const { worker } = require('./mocks/browser');
// worker.start({ quiet: true });
Expand Down
11 changes: 3 additions & 8 deletions frontend/src/pages/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ import useSetNavbarHighlight from '../hooks/useSetNavbarHighlight';
const TopicCardList = lazy(() => import('../components/TopicCardList'));

function Profile() {
const { routePage } = useNavigator();
const { routingHandlers } = useNavigator();
useSetLayoutWidth(FULLSCREEN);
useSetNavbarHighlight('profile');

const goToNewTopic = () => {
routePage('/new-topic');
};

return (
<Wrapper>
<MyInfoWrapper $justifyContent="center" $alignItems="center">
Expand Down Expand Up @@ -56,10 +52,9 @@ function Profile() {
<Suspense fallback={<TopicListSkeleton />}>
<TopicCardList
url="/members/my/topics"
errorMessage="로그인 후 이용해주세요."
commentWhenEmpty="추가하기 버튼을 눌러 지도를 추가해보세요."
pageCommentWhenEmpty="지도 만들러 가기"
routePage={goToNewTopic}
routePageName="메인 페이지로 가기"
routePage={routingHandlers.home}
/>
</Suspense>

Expand Down
1 change: 0 additions & 1 deletion frontend/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Home from './pages/Home';
import NotFound from './pages/NotFound';
import RootPage from './pages/RootPage';
import Search from './pages/Search';
import TopicListSkeleton from './components/Skeletons/TopicListSkeleton';

const SelectedTopic = lazy(() => import('./pages/SelectedTopic'));
const NewPin = lazy(() => import('./pages/NewPin'));
Expand Down
Loading