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

[코드리뷰] 9주차 작업 #139

Merged
merged 68 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
b252959
Fix(call-back): 콜백 단건 조회 api 수정사항 반영
JYN523 Oct 25, 2024
1175dab
Deploy: build test용 ci 추가
Dobbymin Oct 27, 2024
cd28e1b
Refactor(main): 이미지 파일 이동
Dobbymin Oct 27, 2024
c9635c2
Remove: 서브모듈 제거
Dobbymin Oct 27, 2024
c6e6358
Deploy: 서브모듈 관련 명령어 제거
Dobbymin Oct 27, 2024
659215d
Fix(main): 이미지 파일 경로 수정
Dobbymin Oct 27, 2024
244ee5c
Refactor(main): 카카오 로그인 페이지 호출 경로 수정
Dobbymin Oct 27, 2024
a985eee
Fix: 순환참조 방지를 위해 파일 경로 수정
Dobbymin Oct 27, 2024
fe3f4fc
Fix: import order 수정
Dobbymin Oct 27, 2024
4e4786d
Chore: pnpm-lock파일 prettier 검사 제외
Dobbymin Oct 27, 2024
dd0150a
Remove: 서브모듈 관련 파일 제거
Dobbymin Oct 27, 2024
1b1b662
Fix(storage): refreshToken 옵션 추가 및 authStorage 명칭 변경
Dobbymin Oct 27, 2024
5a69d95
Fix(point): 중복되는 명칭 통일
Dobbymin Oct 27, 2024
d66d9bd
Fix(main): 카카오 로그인 icon 경로 수정
Dobbymin Oct 27, 2024
1b8f336
Refactor: authStorage 관련 사항 수정
Dobbymin Oct 27, 2024
2f8a06d
Refactor: provider 명칭 변경 및 경로 수정
Dobbymin Oct 27, 2024
dfbebcd
Refactor: guide line button 타입 수정 및 chakra ui 수정, handler 명칭 수정
Dobbymin Oct 27, 2024
1333692
deploy: ci - 설명 제거
Dobbymin Oct 27, 2024
cea950a
build 관련 ci 추가 (#121)
Dobbymin Oct 27, 2024
ae4179e
Fix(call-back): 코드리뷰 반영 (type 이름 변경)
JYN523 Oct 27, 2024
ecb4c57
Style: 가이드라인, 시니어 추가 페이지 디자인 수정
Diwoni Oct 27, 2024
57695e6
Refactor : 수정 모드에서 수정취소 추가 및 삭제 confirm 추가
Diwoni Oct 27, 2024
4779e98
Merge pull request #122 from kakao-tech-campus-2nd-step3/Style/issue-…
Diwoni Oct 28, 2024
8b4b5d5
Feat(guard-main): 보호자 홈 페이지 경로 네비게이션 기능 추가
Diwoni Oct 28, 2024
3f4413a
Refactor(custom-hook): 코드리뷰 반영(custom-hook 으로 코드 분리)
Diwoni Oct 28, 2024
986475a
Fix(call-back): 콜백 요청 가이드라인 조회 api 및 페이지 수정
JYN523 Oct 28, 2024
7a14ba1
Feat(login): 배포된 주소로 로그인 기능 구현
Dobbymin Oct 29, 2024
27a4efd
배포된 주소로 로그인 기능 구현 (#125)
Dobbymin Oct 29, 2024
d1b47e7
Fix(login): 수정사항 롤백
Dobbymin Oct 29, 2024
32d9e7c
로그인 관련 수정사항 롤백 (#126)
Dobbymin Oct 29, 2024
a2d721a
Feat(sinitto-main): 콜백 목록 페이지 이동 기능 구현
Dobbymin Oct 29, 2024
c2222e1
Feat(sinitto-main): 안부전화 목록 페이지 이동 기능 구현
Dobbymin Oct 29, 2024
708540a
Feat(sinitto-main): 시니또 이름 컴포넌트 분리 및 api 호출 기능 추가
Dobbymin Oct 29, 2024
ac32c7a
Feat(sinitto-main): 마이페이지 이동 기능 구현
Dobbymin Oct 29, 2024
ae23c2b
Feat(sinitto-main): 시니또 정보 조회 api 호출 기능 구현
Dobbymin Oct 29, 2024
03c46ee
Feat(sinitto-main): 시니또 정보 조회 api 호출 hook 구현
Dobbymin Oct 29, 2024
f99f849
Feat(sinitto-main): 시니또 정보 조회 api 호출 provider 구현
Dobbymin Oct 29, 2024
12a286c
Feat(sinitto-main): 시니또 정보 조회 api 호출 provider 적용
Dobbymin Oct 29, 2024
488ec4b
Refactor(mypage): 폴더 구조 변경
Dobbymin Oct 29, 2024
d60e550
Refactor(mypage): response type 코드 분리
Dobbymin Oct 29, 2024
102e3bc
Refactor(mypage): 내정보 조회 provider 적용 및 코드 수정
Dobbymin Oct 29, 2024
39060e6
Chore: dayjs 설치
Dobbymin Oct 29, 2024
db46eb4
Feat(call-back): 콜백 리스트 정렬 기능 추가
Dobbymin Oct 29, 2024
e4a2c7c
Feat(hello-call): 안부전화 리스트 정렬 기능 추가
Dobbymin Oct 29, 2024
988ef96
Fix(hello-call): 무한 스크롤 기능 수정을 위한 api 호출 코드 수정
Dobbymin Oct 29, 2024
1390aec
Fix(hello-call): 안부전화 리스트 2개 가져오기 기능 구현
Dobbymin Oct 29, 2024
d19a5c5
Fix(call-back): 콜백 리스트 2개 가져오기 기능 구현
Dobbymin Oct 29, 2024
1ba7d69
Fix(main): 요청시간 표시 기능 구현
Dobbymin Oct 29, 2024
38b3f56
Feat(log-out): 로그아웃 API 연동
Diwoni Oct 29, 2024
dc4da7b
Merge branch 'Weekly' into Feat/issue-#124
Diwoni Oct 29, 2024
33f04c5
Remove: 사용하지 않는 컴포넌트 삭제
Dobbymin Oct 29, 2024
ffe09c6
Fix(hello-call): 무한스크롤 기능 수정
Dobbymin Oct 29, 2024
7344598
Feat(register-redirect): 회원가입 후 유저 타입별로 홈 리다이렉트
Diwoni Oct 29, 2024
d9fd1c8
시니또 메인 페이지 기능 수정 (#128)
Dobbymin Oct 29, 2024
34a0a5b
Merge branch 'Weekly' into Feat/issue-#124
Diwoni Oct 29, 2024
ff10437
Chore: eslintrc 파일 원상복구
Diwoni Oct 29, 2024
49c525d
Merge branch 'Feat/issue-#124' of https://github.com/kakao-tech-campu…
Diwoni Oct 29, 2024
3ab7156
Fix(register): 회원가입 유저 타입별 리다이렉트 오류 수정
Diwoni Oct 30, 2024
ec8fe5d
Style: 마이페이지 UI 부분 수정
Diwoni Oct 30, 2024
ccc2437
Style: 에러 처리 시 UI 수정
Diwoni Oct 30, 2024
cde90cc
Merge pull request #129 from kakao-tech-campus-2nd-step3/Feat/issue-#124
Diwoni Oct 30, 2024
3f7c1a6
Merge branch 'Weekly' into Feat/issue-#101
JYN523 Oct 30, 2024
67ea9f2
Fix: eslint 오류 수정
JYN523 Oct 30, 2024
c9e6012
Feat(router): dummy 로그인 페이지 경로 추가
Dobbymin Oct 31, 2024
46cbf65
Feat(dummy-redirect): dummy 로그인 리다이렉트 페이지 구현
Dobbymin Oct 31, 2024
4a1c383
더미 로그인 리다이렉트 페이지 (#132)
Dobbymin Oct 31, 2024
df9a6eb
!Hotfix: console 제거
Dobbymin Oct 31, 2024
c381661
시니또용 콜백 조회 API 및 기능 수정 (#130)
Dobbymin Nov 1, 2024
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
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ESLint test
name: ESLint & Build Test

on:
pull_request:
Expand All @@ -16,6 +16,11 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name: Install NodeJs
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install Pnpm package manager
run: |
npm install -g pnpm
Comment on lines +19 to 26

Choose a reason for hiding this comment

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

      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: 'pnpm'

이렇게 하면 pnpm 따로 설치하지 않아도 된답니다!

Expand All @@ -25,3 +30,6 @@ jobs:

- name: Lint Code
run: pnpm lint

- name: Build Test
run: pnpm run build
5 changes: 1 addition & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ jobs:
steps:
- name: Checkout source code.
uses: actions/checkout@master
with:
submodules: true
token: ${{ secrets.ACTION_TOKEN }}

- name: Cache node modules
uses: actions/cache@v4
Expand Down Expand Up @@ -47,7 +44,7 @@ jobs:
run: pnpm lint

- name: Build
run: CI='' pnpm run build
run: pnpm run build

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules
.vscode
.github
dist

pnpm-lock.yaml
13 changes: 2 additions & 11 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,9 @@

"<THIRD_PARTY_MODULES>",

"^@components/(.*)$",
"^@app/(.*)$",
"^@pages/(.*)$",
"^@hooks/(.*)$",
"^@assets/(.*)$",

"^@constants/(.*)$",
"^@utils/(.*)$",
"^@api/(.*)$",
"^@types/(.*)$",
"^@store/(.*)$",

"^@styles/(.*)$",
"^@shared/(.*)$",

"^(.*)/(.*)$"
],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@tanstack/react-query": "^5.51.11",
"axios": "^1.7.5",
"date-fns": "^4.1.0",
"dayjs": "^1.11.13",
"msw": "^2.3.5",

Choose a reason for hiding this comment

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

이제보니까 msw가 dependencies에 있네요..!
이건 devDependencies에 있어야할 것 같아요~

"react": "^18.3.1",
"react-datepicker": "^7.4.0",
Expand Down
14 changes: 11 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { Routes } from '@/app/routes';
import {
AllSeniorInfoProvider,
queryClient,
AuthProvider,
UserEmailProvider,
globalStyle,
SinittoInfoProvider,
} from '@/shared';
import { ChakraProvider } from '@chakra-ui/react';
import { Global } from '@emotion/react';
Expand All @@ -14,10 +15,12 @@ const App = () => {
<ChakraProvider>
<QueryClientProvider client={queryClient}>
<AllSeniorInfoProvider>
<AuthProvider>
<Global styles={globalStyle} />
<Routes />
</AuthProvider>
<SinittoInfoProvider>
<UserEmailProvider>
<Global styles={globalStyle} />
<Routes />
</UserEmailProvider>
</SinittoInfoProvider>
</AllSeniorInfoProvider>
</QueryClientProvider>
</ChakraProvider>
Comment on lines 15 to 26

Choose a reason for hiding this comment

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

ApplicationProvider 라는걸 하나 만들어서 전체 Provider를 모아두는 방법도 있을 것 같네요..!
아니면 이런식으로 쓰일 수 있도록 한다거나!?

const Providers = createProviders([
  ChakraProvider,
  [QueryClientProvider, { client: queryClient }],
  AllSeniorInfoProvider,
  SinittoInfoProvider,
  UserEmailProvider,
])

const App = () => {
  <Providers>
    <Global styles={globalStyle} />
    <Routes />
  </Providers>
}

Expand Down
2 changes: 2 additions & 0 deletions src/app/routes/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ export const RouterPath = {
CALL_BACK_GUID_LINE: `:guideLineId`,
SENIOR_REGISTER: `/senior-register`,
SINITTO_REVIEW: `review`,

DUMMY_LOGIN: `/dummy`,
};
35 changes: 31 additions & 4 deletions src/app/routes/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ import {
HelloCallReportPage,
SeniorRegisterPage,
CallBackListPage,
CallBackDetailPage, // SinittoGuideLinePage,
CallBackDetailPage,
SinittoGuideLinePage,
SinittoReviewPage,
HelloCallApplyPage,
GuardMainPage,
SinittoMainPage,
DummyRedirectPage,
} from '@/pages';
import { Layout } from '@/shared/components';

Expand Down Expand Up @@ -46,6 +48,16 @@ export const router = createBrowserRouter([
},
],
},
{
path: RouterPath.DUMMY_LOGIN,
element: <Layout title='더미 로그인 Redirect' />,
children: [
{
index: true,
element: <DummyRedirectPage />,
},
],
},
{
path: RouterPath.GUARD,
children: [
Expand Down Expand Up @@ -147,11 +159,26 @@ export const router = createBrowserRouter([
},
{
path: RouterPath.CALL_BACK_DETAIL,
element: <Layout title='요청 상세페이지' />,
children: [
{
index: true,
element: <CallBackDetailPage />,
path: '',
element: <Layout title='요청 상세페이지' />,
children: [
{
index: true,
element: <CallBackDetailPage />,
},
],
},
{
path: RouterPath.CALL_BACK_GUID_LINE,
element: <Layout title='요청 상세페이지' />,
children: [
{
index: true,
element: <SinittoGuideLinePage />,
},
],
},
],
},
Expand Down
57 changes: 57 additions & 0 deletions src/pages/common/dummy-redirect/DummyRedirectPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';

import { RouterPath } from '@/app/routes';
import { Box, Text, Spinner, Heading } from '@chakra-ui/react';

export const DummyRedirectPage = () => {
const [statusMessage, setStatusMessage] = useState(
'유저 정보를 기다리고 있습니다...'
);
const [isLoading, setIsLoading] = useState(true);
const navigate = useNavigate();

useEffect(() => {
const params = new URLSearchParams(window.location.search);

const accessToken = params.get('accessToken');
const refreshToken = params.get('refreshToken');
const isSinitto = params.get('isSinitto');

if (accessToken && refreshToken && isSinitto) {
// 로컬 스토리지에 토큰 저장
localStorage.setItem('accessToken', accessToken);
localStorage.setItem('refreshToken', refreshToken);
localStorage.setItem('isSinitto', isSinitto);
Comment on lines +22 to +25

Choose a reason for hiding this comment

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

로컬 스토리지를 다룬 로직은 추상화해주면 좋을 것 같아요!
tokenStorage.set({ accessToken, refreshToken })
이런식으로 쓰일 수 있도록..!


// isSinitto 상태에 따른 메시지 설정
setStatusMessage(
isSinitto === 'true'
? '시니또 더미데이터로 로그인 중입니다. 페이지 이동 중...'
: '보호자 더미데이터로 로그인 중입니다. 페이지 이동 중...'
);

setTimeout(() => {
setIsLoading(false); // 로딩 완료
navigate(isSinitto === 'true' ? RouterPath.SINITTO : RouterPath.GUARD);
}, 2000);
} else {
console.error('Access or Refresh token not found in query parameters.');
setStatusMessage('[ERROR] 토큰이 존재하지 않습니다.');

setIsLoading(false);
}
}, [navigate]);

return (
<Box textAlign='center' mt='50px'>
<Heading as='h1' size='lg' mb='1rem'>
더미데이터 로그인
</Heading>
<Text fontSize='lg'>{statusMessage}</Text>
{(isLoading || statusMessage === '유저 정보를 기다리고 있습니다...') && (
<Spinner size='lg' mt='1rem' />
)}
</Box>
);
};
1 change: 1 addition & 0 deletions src/pages/common/dummy-redirect/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DummyRedirectPage } from './DummyRedirectPage';
1 change: 1 addition & 0 deletions src/pages/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './dummy-redirect';
export * from './main';
export * from './redirect';
export * from './register';
8 changes: 5 additions & 3 deletions src/pages/common/main/components/login-button/LoginButton.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { Link } from 'react-router-dom';

import Logo from '../../assets/kakao.svg';
import { KAKAO_AUTH_URL } from '@/shared/utils/env/config';
import Logo from '@/pages/assets/main/kakao.svg';

Choose a reason for hiding this comment

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

pages에서 pages에 있는걸 가져오게 되면 순환참조가 될 수 있답니다..!
같은 계층에 있는 것들은 상대경로로 가져와야 안전해요.

import { BASE_URI } from '@/shared/api';
import { Image, Text } from '@chakra-ui/react';
import styled from '@emotion/styled';

const LoginButton = () => {
const KAKAO_LOGIN = `${BASE_URI}/api/auth/oauth/kakao`;

return (
<Link to={KAKAO_AUTH_URL}>
<Link to={KAKAO_LOGIN}>
<KakaoLoginButton>
<Image src={Logo} alt='kakao-icon' />
<Text fontWeight='500'>카카오톡 로그인</Text>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/common/main/components/review-box/ReviewBox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import StarIcon from '../../assets/star-icon.svg';
import StarIcon from '@/pages/assets/main/star-icon.svg';
import { Box, Image, Text } from '@chakra-ui/react';
import styled from '@emotion/styled';

Expand Down
1 change: 1 addition & 0 deletions src/pages/common/redirect/RedirectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const RedirectPage = () => {
const location = useLocation();

const code = new URLSearchParams(location.search).get('code');

if (!code) {
return <div>로그인을 다시 진행해주세요.</div>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useNavigate } from 'react-router-dom';

import { RouterPath } from '@/app/routes/path';
import { useGetKakaoCallback } from '@/pages';
import { useAuth } from '@/shared';
import { useUserEmail } from '@/shared';
import { Flex, Spinner, Text } from '@chakra-ui/react';

type Props = {
Expand All @@ -13,7 +13,7 @@ type Props = {
const RedirectSection = ({ code }: Props) => {
const navigate = useNavigate();

const { setEmail } = useAuth();
const { setEmail } = useUserEmail();

const { data } = useGetKakaoCallback(code);

Expand Down
6 changes: 2 additions & 4 deletions src/pages/common/register/RegisterPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { useForm } from 'react-hook-form';
import { RegisterFields, RegisterType, Tos } from './components';
import { useRegister } from './store/hooks';
import { FormValues } from './types';
import { parsePhoneNumber } from '@/shared';
import { BasicButton } from '@/shared/components';
import { useAuth } from '@/shared/provider/auth/Auth';
import { BasicButton, parsePhoneNumber, useUserEmail } from '@/shared';
import { Divider } from '@chakra-ui/react';
import styled from '@emotion/styled';

Expand All @@ -22,7 +20,7 @@ const RegisterPage = () => {
// 회원가입 처리
const mutation = useRegister();

const { email } = useAuth();
const { email } = useUserEmail();

const handleUserType = (id: string) => {
setUserType(id);
Expand Down
8 changes: 4 additions & 4 deletions src/pages/common/register/store/hooks/useRegister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AxiosError } from 'axios';

import { registerUser, SignupApiResponse } from '../api';
import { RouterPath } from '@/app/routes/path';
import { authLocalStorage } from '@/shared/utils/storage';
import { authStorage } from '@/shared/utils/storage';
import { useMutation } from '@tanstack/react-query';

const useRegister = () => {
Expand All @@ -16,10 +16,10 @@ const useRegister = () => {
} else {
console.log(data);
if ('accessToken' in data) {
authLocalStorage.set(data.accessToken);
authLocalStorage.set(data.refreshToken);
authStorage.accessToken.set(data.accessToken);
authStorage.refreshToken.set(data.refreshToken);
Comment on lines +19 to +20

Choose a reason for hiding this comment

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

여기서는 스토리지를 추상화해서 사용하고 있네요..!?

alert('회원가입이 완료되었습니다.');
navigate(data.isSinitto === 'true' ? RouterPath.ROOT : RouterPath.ROOT);
navigate(data.isSinitto ? RouterPath.SINITTO : RouterPath.GUARD);
}
}
};
Expand Down
Loading