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

✨ Update v1.0.0 - 소셜로그인 & 북마크 #71

Merged
merged 76 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
9607552
💄 style : 메뉴페이지 > 포즈피커 공식 SNS
seondal Jan 30, 2024
46b5cc9
✂️ edit : 포즈톡 툴팁 내용 변경
seondal Jan 30, 2024
f548273
♻️ refactor : 메뉴 리스트 데이터
seondal Jan 30, 2024
8ee3fc5
✨ feat : 마이포즈 플로우
seondal Feb 19, 2024
53d9ec5
✨ feat : 마이포즈 등록/저장
seondal Feb 19, 2024
2635d60
💄 style : 로그인 섹션
seondal Feb 19, 2024
3a34fbc
✨ feat : 마이포즈 탭
seondal Feb 19, 2024
2402d17
♻️ refactor : 나만의 포즈를 추가해 보세요 !
seondal Feb 19, 2024
62d49fe
🗑 delete : 북마크 아이콘 삭제
seondal Feb 19, 2024
9bda00a
💄 style : 로그인 섹션
seondal Feb 19, 2024
0c1ab12
⚙️ set : strictmode off
seondal Feb 19, 2024
62aeaf5
🐛 bug : 로그인 시도중 ...
seondal Feb 19, 2024
0f00eff
💄 style : 메뉴페이지에 로그인 섹션 & 로그인 섹션 디자인
seondal Feb 19, 2024
9a4b992
🛠 fix : 기존 리다이렉트 페이지 임시 삭제
seondal Feb 19, 2024
360dffb
🛠 fix : 기존 삭제 22
seondal Feb 19, 2024
be03a7d
🛠 fix : 카카오로그인 redirect uri 복귀
seondal Feb 20, 2024
bed27fc
🐛 bug : 콘솔 좀 찍어보자
seondal Feb 20, 2024
419c52b
🐛 bug : 인가코드 좀 보내봐라 제발
seondal Feb 20, 2024
3628680
✨ feat : 카카오 로그인 성공했다아악!!
seondal Feb 20, 2024
2f62593
🛠 fix : recoil 사용 불가.. 일단 삭제
seondal Feb 20, 2024
f4f0405
🏗 folder : redirect uri 드디어 간단하게 변경!
seondal Feb 20, 2024
213b6d9
✨ feat : 로그인 정보 전역상태로 관리
seondal Feb 20, 2024
cdd0102
⚙️ set : recoil-persist
seondal Feb 20, 2024
04228fc
✨ feat : 새로고침해도 로그인 유지
seondal Feb 20, 2024
5d8c929
✨ feat : 로그인 분기 따른 메뉴페이지 변경
seondal Feb 20, 2024
08ec569
🛠 fix : 로그인 완료 후 창 닫을 때 두번눌러야 하는 현상 수정
seondal Feb 20, 2024
d5384fa
🏗 folder : menuList -> data.ts
seondal Mar 19, 2024
b8dc9bd
⚡️ improve : 포즈픽 로딩 속도 개선
seondal Mar 19, 2024
b94b128
🐛 bug : 로그아웃/회원탈퇴 api 연결
seondal Mar 19, 2024
1124bdd
♻️ refactor : Modal -> Popup
seondal Mar 19, 2024
f394079
⚡️ improve : 이미지 모달로 크게 보기 속도 개선 ( ImageModal -> PoseImage)
seondal Mar 19, 2024
60116fc
♻️ refactor : ModalWrapper 삭제
seondal Mar 19, 2024
2dfc1ca
⚡️ improve : ✨ feat : 포즈픽 로딩 분기처리 고도화 -> 이미지 렌더링 구분 필요
seondal Mar 21, 2024
f55195f
✨ feat : 로그아웃
seondal Mar 21, 2024
afe9eef
🏗 folder : 헤더 컴포넌트
seondal Mar 21, 2024
62fdf81
🐛 bug : radio form 을 사용하려 했으나..
seondal Mar 21, 2024
c59d06b
💄 style : 서비스 탈퇴 페이지
seondal Mar 21, 2024
e459ff7
✨ feat : 로그인, 로그아웃, 회원탈퇴 구현 (스크린 쌓이는거 섬세하게 조정함)
seondal Mar 21, 2024
bae4808
🛠 fix : 서브페이지에서 뒤로가기 이슈
seondal Mar 21, 2024
93fcbf9
⚡️ improve : img -> next/image & fix : 피드 로딩중일 때 북마크 버튼만 보이던 이슈
seondal Mar 21, 2024
2a56f3a
✨ feat : 포즈픽 최소로딩 900ms
seondal Mar 26, 2024
e591497
🛠 fix : 바텀시트나 모달 버튼 일대일 아닌거 수정
seondal Apr 2, 2024
80115a6
✨ feat : 북마크 !!!!
seondal Apr 2, 2024
79b4e52
♻️ refactor : 피드페이지 FeedSection 컴포넌트화
seondal Apr 2, 2024
4901d5d
🏗 folder : FeedSection 컴포넌트화
seondal Apr 2, 2024
b903ffb
🛠 fix : usePoseFeedQuery 무한로딩 이슈
seondal Apr 2, 2024
6b4accc
🛠 fix : 무한 요청의 이유를 찾았어요 AsyncBoundary
seondal Apr 2, 2024
ffb8ef2
✨ feat : 북마크 피드가 보여요!
seondal Apr 2, 2024
4afe8f9
🛠 fix : 로그인 안되던 오류
seondal Apr 2, 2024
7b241ab
🐛 bug : 🛠 fix : refetch
seondal Apr 2, 2024
ec4a423
✨ feat : 로그인 로그아웃 alert
seondal Apr 2, 2024
b566199
✨ feat : privateApi config
seondal Apr 2, 2024
bdc7398
🛠 fix : 로그인 로그아웃 바로 반영 안되는 오류
seondal Apr 2, 2024
3af896d
✨ feat : 세션만료시 자동 로그아웃
seondal Apr 12, 2024
1419fb6
🛠 fix : 마이포즈 북마크에서 상세페이지 이동 안되는 이슈
seondal Apr 12, 2024
bfbdde8
✨ feat : 마이포즈에서도 스크롤되게
seondal Apr 12, 2024
f0266d1
✨ feat : 세션만료 (415) 코드 정정
seondal Apr 12, 2024
b257fbc
🗑 delete : 탭 버튼 motion.div 삭제
seondal Apr 12, 2024
f68f79a
✨ feat : 포즈피드 이미지들 로딩중에는 스켈레톤 뜨게 변경
seondal Apr 12, 2024
2f578a4
✨ feat : axios interceptor request 오류 발생 시 자동 로그아웃, 회원탈퇴 일단 보이게
seondal Apr 12, 2024
c940bb8
💄 style : BottomDiv 높이 100으로 변경
seondal Apr 12, 2024
1ea34f6
♻️ refactor : 🏗 folder : fixed된 컴포넌트들 공간 잘 차지시켜놓기 -> 헤더 및 바텀 관련 컴포넌…
seondal Apr 12, 2024
209f998
💄 style : 탈퇴페이지 스타일링
seondal Apr 12, 2024
d070c7f
🛠 fix : return Promise.reject(error);
seondal Apr 12, 2024
67145d9
🏗 folder : 불필요한 레이아웃 삭제
seondal Apr 13, 2024
cf1794a
✨ feat : 상세페이지 이미지 로딩중일 때 스켈레톤 보여주기
seondal Apr 13, 2024
5dbcc6d
🗑 delete : 로컬 폰트
seondal Apr 13, 2024
b9cab5e
🗑 delete : request 에러 인터셉터 삭제
seondal Apr 13, 2024
3922f52
🛠 fix : 메인버튼 누르고 나면 커져있는 현상
seondal Apr 13, 2024
16a81cd
🛠 fix : 네이티브에서 레이아웃 이상하게 보이는 현상
seondal Apr 13, 2024
2576e71
🛠 fix : 포즈픽에서 이전과 같은 데이터 받아올 때 무한로딩 걸리는 이슈
seondal Apr 16, 2024
28b7151
🛠 fix : 리액트 네이티브 웹뷰 포즈픽 레이아웃 오류
seondal Apr 16, 2024
187e5f8
💄 style : 탈퇴 버튼 빨갛게
seondal Apr 17, 2024
5601b24
✂️ edit : 415 아닌 에러에 다시 로그인해주세요 멘트 삭제
seondal Apr 17, 2024
e3980ad
🛠 fix : 카카오 공유하기 안되는 이슈 수정 : 환경변수 카카오 플랫폼 키를 잘못 지정했음
seondal Apr 17, 2024
e42954d
🛠 fix : 서브페이지 뒤로가기 이슈
seondal Apr 17, 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
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const withPWA = require('next-pwa')({
});

const nextConfig = withPWA({
reactStrictMode: true,
reactStrictMode: false,
images: {
remotePatterns: [
{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"react-lottie-player": "^1.5.4",
"react-tooltip": "^5.20.0",
"recoil": "^0.7.7",
"recoil-persist": "^5.1.0",
"svgstore": "^3.0.1",
"svgstore-cli": "^2.0.1",
"tailwind-merge": "^1.14.0",
Expand Down
Binary file removed public/fonts/Pretendard-Bold.woff2
Binary file not shown.
Binary file removed public/fonts/Pretendard-Medium.woff2
Binary file not shown.
Binary file removed public/fonts/Pretendard-Regular.woff2
Binary file not shown.
Binary file removed public/fonts/test.woff2
Binary file not shown.
8 changes: 0 additions & 8 deletions public/icons/bookmark_black_fill.svg

This file was deleted.

3 changes: 0 additions & 3 deletions public/icons/github.svg

This file was deleted.

5 changes: 0 additions & 5 deletions public/icons/instagram.svg

This file was deleted.

19 changes: 5 additions & 14 deletions public/icons/profile_default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 39 additions & 2 deletions src/apis/apis.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import {
FilterTagsResponse,
PoseDetailResponse,
PoseFeedContents,
PoseFeedResponse,
PosePickResponse,
PoseTalkResponse,
RegisterResponse,
} from '.';
import privateApi from './config/privateApi';
import publicApi from './config/publicApi';
import { KAKAO_REDIRECT_URI } from '@/constants/env';

export const getPosePick = (peopleCount: number) =>
publicApi.get<PosePickResponse>(`/pose/pick/${peopleCount}`);
Expand All @@ -22,7 +25,7 @@ export const getPoseFeed = async (
tags: string,
pageNumber: number
) =>
await publicApi.get<PoseFeedResponse>(`/pose`, {
await privateApi.get<PoseFeedResponse>(`/pose`, {
params: {
frameCount,
pageNumber,
Expand All @@ -34,4 +37,38 @@ export const getPoseFeed = async (
export const getFilterTag = () => publicApi.get<FilterTagsResponse>('/pose/tags');

export const getRegister = (code: string) =>
publicApi.get<RegisterResponse>(`/users/login/oauth/kakao?code=${code}`);
publicApi.get<RegisterResponse>(
`/users/login/oauth/kakao?code=${code}&redirectURI=${KAKAO_REDIRECT_URI}`
);

export const patchLogout = (accessToken: string, refreshToken: string) =>
publicApi.patch('/users/logout', {
accessToken: `Bearer ${accessToken}`,
refreshToken: `Bearer ${refreshToken}`,
});

export const patchDeleteAccount = (
accessToken: string,
refreshToken: string,
withdrawalReason: string
) =>
publicApi.patch('/users/deleteAccount', {
accessToken: `Bearer ${accessToken}`,
refreshToken: `Bearer ${refreshToken}`,
withdrawalReason,
});

export const postBookmark = (poseId: number) =>
privateApi.post(`/bookmark`, null, {
params: { poseId },
});

export const deleteBookmark = (poseId: number) =>
privateApi.delete(`/bookmark`, {
params: { poseId },
});

export const getBookmarkFeed = (pageNumber: number) =>
privateApi.get<PoseFeedContents>('/bookmark/feed', {
params: { pageNumber, pageSize: 10 },
});
42 changes: 29 additions & 13 deletions src/apis/config/privateApi.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
import axios, { AxiosError, InternalAxiosRequestConfig } from 'axios';
import axios from 'axios';

import { CustomInstance } from './type';
import { BASE_API_URL } from '@/constants/env';
import { getCookie } from '@/utils/cookieController';

import type { CustomInstance } from './type';
function getAccesstoken() {
if (typeof window !== 'undefined') {
const item = localStorage.getItem('accesstoken');
return item;
}
}

const privateApi: CustomInstance = axios.create({
baseURL: `${BASE_API_URL}/api`,
withCredentials: true,
});

privateApi.interceptors.response.use(
(response) => response.data,
(error) => {
if (error.response.status === 415) {
alert('세션이 만료되었어요. 다시 로그인이 필요해요!');
} else {
alert('오류가 발생했어요. 다시 시도해주세요');
}
location.href = '/auth/logout';
return Promise.reject(error);
}
);

privateApi.interceptors.request.use(
async (config: InternalAxiosRequestConfig) => {
try {
const accessToken = getCookie('accessToken');
(config) => {
const accessToken = getAccesstoken();

if (accessToken) {
config.headers.Authorization = `Bearer ${accessToken}`;
return config;
} catch (error) {
return Promise.reject(error);
}

return config;
},
(error: AxiosError) => {
Promise.reject(error);
(error) => {
console.log('request : ' + error.response);
}
);

privateApi.interceptors.response.use((response) => response.data);

export default privateApi;
2 changes: 1 addition & 1 deletion src/apis/config/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export interface CustomInstance extends AxiosInstance {
patch<T>(...params: Parameters<AxiosInstance['patch']>): Promise<T>;
}

export type ErrorStatus = 400 | 401 | 403 | 412 | 500;
export type ErrorStatus = 400 | 401 | 403 | 412 | 500 | 415;
27 changes: 20 additions & 7 deletions src/apis/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import {

import {
FilterTagsResponse,
PoseFeedContents,
PoseFeedResponse,
PosePickResponse,
PoseTalkResponse,
RegisterResponse,
getBookmarkFeed,
getFilterTag,
getPoseDetail,
getPoseFeed,
getPosePick,
getPoseTalk,
getRegister,
} from '.';
import { FilterState } from '@/hooks/useFilterState';

Expand All @@ -38,8 +38,8 @@ export const usePoseTalkQuery = (options?: UseQueryOptions<PoseTalkResponse>) =>
export const usePoseFeedQuery = (
{ peopleCount, frameCount, tags }: FilterState,
options?: UseInfiniteQueryOptions<PoseFeedResponse>
) =>
useSuspenseInfiniteQuery<PoseFeedResponse>(
) => {
return useSuspenseInfiniteQuery<PoseFeedResponse>(
['poseFeed', peopleCount, frameCount, tags],
({ pageParam = 0 }) => getPoseFeed(peopleCount, frameCount, tags.join(','), pageParam),
{
Expand All @@ -52,9 +52,22 @@ export const usePoseFeedQuery = (
...options,
}
);
};

export const useBookmarkFeedQuery = (
accesstoken: string,
options?: UseInfiniteQueryOptions<PoseFeedContents>
) =>
useSuspenseInfiniteQuery<PoseFeedContents>(
['bookmarkFeed'],
({ pageParam = 0 }) => getBookmarkFeed(pageParam),
{
getNextPageParam: (lastPage) => {
return lastPage.last ? undefined : lastPage.number + 1;
},
...options,
}
);

export const useFilterTagQuery = (options?: UseQueryOptions<FilterTagsResponse>) =>
useSuspenseQuery<FilterTagsResponse>(['filterTag'], getFilterTag, { ...options });

export const useRegisterQuery = (code: string) =>
useSuspenseQuery<RegisterResponse>(['register'], () => getRegister(code), {});
3 changes: 2 additions & 1 deletion src/apis/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface PoseInfo {
sourceUrl: string;
tagAttributes: string;
updatedAt: string;
bookmarkCheck: boolean;
}

// 포즈피드
Expand All @@ -16,7 +17,7 @@ interface PoseFeedContentsSort {
sorted: boolean;
unsorted: boolean;
}
interface PoseFeedContents {
export interface PoseFeedContents {
content: Array<{ poseInfo: PoseInfo }>;
pageable: {
sort: PoseFeedContentsSort;
Expand Down
26 changes: 26 additions & 0 deletions src/app/(Main)/feed/FeedContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import Link from 'next/link';

import { usePoseFeedQuery } from '@/apis';
import { PrimaryButton } from '@/components/Button';
import EmptyCase from '@/components/Feed/EmptyCase';
import FeedSection from '@/components/Feed/FeedSection';
import { URL } from '@/constants/url';
import useFilterState from '@/hooks/useFilterState';

export default function FeedContent() {
const { filterState } = useFilterState();
const query = usePoseFeedQuery(filterState);

return (
<FeedSection query={query}>
<EmptyCase
title={'신비한 포즈를 찾으시는군요!'}
text={'찾고 싶은 포즈를 저희에게 알려주세요.'}
>
<Link href={URL.inquiry}>
<PrimaryButton text={'문의사항 남기기'} />
</Link>
</EmptyCase>
</FeedSection>
);
}
65 changes: 0 additions & 65 deletions src/app/(Main)/feed/FeedSection.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
'use client';

import { useEffect, useState } from 'react';

import { FilterTagsResponse, useFilterTagQuery } from '@/apis';
import { BottomDiv, PrimaryButton } from '@/components/Button';
import BottomSheet from '@/components/Modal/BottomSheet';
import { SelectionBasic, SelectionTagList } from '@/components/Selection';
import { frameCountList, peopleCountList } from '@/constants/filterList';
import { frameCountList, peopleCountList } from '@/constants/data';
import useBottomSheet from '@/hooks/useBottomSheet';
import useFilterState from '@/hooks/useFilterState';

Expand Down
8 changes: 6 additions & 2 deletions src/app/(Main)/feed/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
'use client';

import { QueryAsyncBoundary } from '@suspensive/react-query';

import FeedSection from './FeedSection';
import FeedContent from './FeedContent';
import FilterSheet from './FilterSheet';
import { RejectedFallback } from '@/components/ErrorBoundary';
import { Loading } from '@/components/Loading';
import { PageAnimation } from '@/components/PageAnimation';
Expand All @@ -12,7 +15,8 @@ export default function Feed() {
pendingFallback={<Loading className="h-[calc(100dvh-178px)]" />}
>
<PageAnimation>
<FeedSection />
<FeedContent />
<FilterSheet />
</PageAnimation>
</QueryAsyncBoundary>
);
Expand Down
Loading
Loading