Skip to content

Commit

Permalink
feat: 식자재 무한스크롤, 리프레시토큰, 프로필 변경, 로티 변경 (#34)
Browse files Browse the repository at this point in the history
* feat: 친구 목록 EmptyBox 추가

* fix: 기타

* feat: 식자재 무한스크롤

* feat: 토큰 확인 후 로그인 이동

* feat: 마이페이지 나눔 내역

* feat: 프로필 수정

* feat: 식자재 이름 변경

* feat: 식자재 직접 추가하기

* fix: 날짜 수정

* feat: 구글 로그인 추가

에러

* fix: 디데이 조건 수정

* fix: 수정 배경 삭제

* chore: 기타

* fix: 무한스크롤 미반영으로 캐시 삭제

* feat: 리프레시 토큰으로 엑세스 토큰 받아오기

cors 에러 추정

* feat: 로티 변경

* feat: 스크롤 중 로티 아톰

* fix: 빌드 수정
  • Loading branch information
a-honey authored Feb 28, 2024
1 parent 8a634b4 commit 31107f4
Show file tree
Hide file tree
Showing 36 changed files with 532 additions and 456 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"eslint-plugin-react": "^7.33.2",
"framer-motion": "^11.0.3",
"lodash": "^4.17.21",
"lottie-react": "^2.4.0",
"next": "14.0.3",
"react": "^18",
"react-dom": "^18",
Expand Down
18 changes: 8 additions & 10 deletions src/api/axiosInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ axiosInstance.interceptors.response.use(
const originalRequest = error.config;

if (error.response?.status === 401 && !originalRequest._retry) {
/*
originalRequest._retry = true;

const refreshToken =
Expand All @@ -36,22 +35,21 @@ axiosInstance.interceptors.response.use(
: null;

try {
const refreshResponse = await axios.post('/users/kakao-login', {
refreshToken,
});
if (typeof window !== 'undefined') {
localStorage.setItem('accessToken', refreshResponse.data.accessToken);
originalRequest.headers['Refresh-Token'] = refreshToken;
const res = await axiosInstance(originalRequest);
const newAccessToken = res.headers['new-access-token'];
if (newAccessToken) {
localStorage.setItem('accessToken', newAccessToken);
}

originalRequest.headers.Authorization = `Bearer ${refreshResponse.data.accessToken}`;
originalRequest.headers.Authorization = `Bearer ${newAccessToken}`;
return await axiosInstance(originalRequest);
} catch (refreshError) {
console.error('Error refreshing token:', refreshError);
throw refreshError;
}
*/
window.location.href = '/login';

// window.location.href = '/login';
}

return await Promise.reject(error);
Expand Down
317 changes: 0 additions & 317 deletions src/assets/lottie.json

This file was deleted.

Binary file added src/assets/lottie.webp
Binary file not shown.
4 changes: 2 additions & 2 deletions src/components/atoms/IngredientDateTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const IngredientDateTag: React.FC<IngredientDateTagProps> = ({ dDay }) => {
let textDay;

// dDay에 따라서 className 설정
if (dDay <= 0) {
if (dDay < 0) {
className = 'bg-gray1 text-gray6';
backgroundColor = '';
textDay = `D+${Math.abs(dDay)}`;
Expand All @@ -31,7 +31,7 @@ const IngredientDateTag: React.FC<IngredientDateTagProps> = ({ dDay }) => {

return (
<div
className={`w-64 p-9 rounded-6 text-center body1-semibold ${className}`}
className={`min-w-[64px] p-9 rounded-6 text-center body1-semibold ${className}`}
style={{ backgroundColor }}
>
{textDay}
Expand Down
Loading

0 comments on commit 31107f4

Please sign in to comment.