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

사용자 프로필 편집 페이지 구현 #16

Merged
merged 63 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a8ac1e5
init: 아이콘 svg 파일 추가
Yoonkyoungme Dec 29, 2023
f66ae0a
feat: 사용자 정보 불러오는 API 요청 함수를 작성했습니다.
coggiee Dec 29, 2023
4501358
feat: 사용자 정보 API 호출 및 데이터 설정
coggiee Dec 29, 2023
f7216a5
style: 사용자 프로필 루트 레이아웃을 디자인했습니다.
coggiee Dec 29, 2023
c8da1c6
style: 사용자 프로필 헤더 컴포넌트를 추가했습니다.
coggiee Dec 29, 2023
4b0d1a0
style: 사용자 이미지 컴포넌트를 추가했습니다.
coggiee Dec 29, 2023
2bcc345
style: 사용자 프로필 정보 컴포넌트를 추가했습니다.
coggiee Dec 29, 2023
930add3
style: 사용자 프로필 상호작용 버튼을 추가했습니다.
coggiee Dec 29, 2023
c630f86
style: 임시 포스트 레이아웃을 추가했습니다.
coggiee Dec 29, 2023
e3d4bd5
refactor: 포스트 섹션 관련 컴포넌트를 PostList로 분리했습니다.
coggiee Dec 29, 2023
3e09a69
refactor: 이전으로 돌아가기 버튼을 컴포넌트로 분리했습니다.
coggiee Dec 29, 2023
add60ea
refactor: 헤더 컴포넌트를 분리했습니다.
coggiee Dec 29, 2023
0609358
refactor: API 경로를 수정했습니다.
coggiee Dec 29, 2023
9a66963
remove: 테스트 코드를 작성한 파일을 삭제했습니다.
coggiee Dec 29, 2023
3bcd701
refactor: 버튼을 담는 컴포넌트를 수정했습니다.
coggiee Dec 29, 2023
a552f9f
feat: 내 프로필인지 확인하는 기능을 추가했습니다.
coggiee Dec 29, 2023
92a4456
feat: FormData 형식의 이미지를 추가하는 함수를 추가했습니다.
coggiee Dec 30, 2023
b413898
feat: 프로필, 커버 이미지 변경 API를 호출합니다.
coggiee Dec 30, 2023
25f300d
style: 팔로우 버튼을 추가했습니다.
coggiee Dec 30, 2023
794d6a5
refactor: 컴포넌트 분리
coggiee Dec 31, 2023
a76cba6
feat: 팔로우, 팔로우 취소 기능 추가
coggiee Dec 31, 2023
04fb720
style: 팔로우 버튼의 디자인 수정
coggiee Dec 31, 2023
332b0ad
modify: 프로필 정보를 불러오는 함수에 인자를 추가했습니다.
coggiee Dec 31, 2023
227b007
remove: 사용하지 않는 코드 삭제
coggiee Dec 31, 2023
76cf627
fix: 폴더 이름 변경으로 인한 import를 할 수 없는 오류 수정
coggiee Dec 31, 2023
ae608e7
rename: 컴포넌트 위치 변경
coggiee Dec 31, 2023
b95b2fd
style: 편집 아이콘 컴포넌트 추가
coggiee Dec 31, 2023
3191c2d
style: 임시 사용자 편집 Drawer 컴포넌트 추가
coggiee Dec 31, 2023
0dfb750
refactor: 변수, 함수 이름 변경
coggiee Dec 31, 2023
0893153
refactor: input 필드를 컴포넌트로 분리
coggiee Dec 31, 2023
7d4b980
refactor: 사용자 편집 버튼의 선언 위치 변경
coggiee Dec 31, 2023
6826889
feat: Drawer 내부에 사용자 프로필 페이지를 추가
coggiee Dec 31, 2023
93ea538
feat: 사용자 프로필 정보 저장 방식 변경
coggiee Dec 31, 2023
4776f22
feat: 프로필, 커버 이미지 변경 기능 추가
coggiee Dec 31, 2023
c4f90db
modify: 초기값을 로그인 된 유저의 정보로 설정
coggiee Jan 1, 2024
135639a
modify: User에 필드 추가
coggiee Jan 1, 2024
f48b21e
style: SubmitButton 스타일 수정
coggiee Jan 1, 2024
f1a38e7
refactor: Form 컴포넌트 분리
coggiee Jan 1, 2024
be71999
style: Form 스타일 수정
coggiee Jan 1, 2024
232eb5e
feat: 비밀번호 일치 여부 로직 추가
coggiee Jan 1, 2024
210c2dd
modify: name props 추가
coggiee Jan 1, 2024
c118269
feat: useForm 커스텀 훅 추가
coggiee Jan 1, 2024
d58982a
refactor: form을 처리하는 로직을 커스텀 훅으로 변경
coggiee Jan 1, 2024
92fb4b8
modify: interface 수정
coggiee Jan 1, 2024
747a306
feat: 업데이트 된 사용자 정보 저장
coggiee Jan 1, 2024
b49fac3
feat: (임시) 사용자 이름 변경 API 요청 함수 추가
coggiee Jan 1, 2024
9025058
modify: 사용하지 않는 validate 함수 삭제
coggiee Jan 1, 2024
36d5b3d
feat: (임시) 사용자 패스워드 변경 API 요청 함수 추가
coggiee Jan 1, 2024
a6abe88
build: 사용하지 않는 import 삭제
coggiee Jan 1, 2024
9e0f4f4
modify: 콘솔 함수 삭제
coggiee Jan 1, 2024
fdda0d5
modify: zustand 적용
coggiee Jan 1, 2024
bc424e8
comment: 주석 삭제
coggiee Jan 1, 2024
a2e87c2
refactor: import 순서 수정
coggiee Jan 1, 2024
06e9e31
remove: 사용하지 않는 코드 삭제
coggiee Jan 1, 2024
6bf79a6
refactor: 컴포넌트 중복 최소화
coggiee Jan 1, 2024
e5a3481
feat: DrawerContent 렌더링 분기 처리 추가
coggiee Jan 1, 2024
ec276c8
feat: 로딩 처리를 위해 sleep 함수 추가
coggiee Jan 1, 2024
6a50c31
modify: 비밀번호를 입력하지 않을 경우 분기 추가
coggiee Jan 1, 2024
4189cf4
rename: 프로필 관련 API 요청 함수의 폴더 구조 변경
coggiee Jan 2, 2024
b26ef7b
style: 스타일 선언 위치 변경
coggiee Jan 2, 2024
b1ec0e0
fix: 인터페이스 이름 오류 수정
coggiee Jan 2, 2024
89f8ee1
refactor: 함수 선언 방식 변경
coggiee Jan 2, 2024
8e6aa7f
refactor: 폴더 구조 변경으로 인한 import문 수정
coggiee Jan 2, 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: 8 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import Profile from '@/pages/profile'

function App() {
return <></>;
return (
<>
<Profile />
</>
)
}

export default App;
export default App
18 changes: 18 additions & 0 deletions src/apis/profile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { GET_USER_PROFILE_PATH } from '@/utils/api_paths'
import axiosInstance from './api'

interface ProfileResponse extends User {}

async function getProfile(id: string): Promise<ProfileResponse> {
try {
const response = await axiosInstance.get(
`${GET_USER_PROFILE_PATH}/${id}`
)

return response.data
} catch (error) {
throw new Error('Error while fetching profile')
}
}

export default getProfile
24 changes: 24 additions & 0 deletions src/apis/updateName.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { UPDATE_MY_PROFILE_PATH } from '@/utils/api_paths'
import axiosInstance from './api'

interface Data {
[key: string]: string
}

interface UpdateResponse extends User {}

async function updateName(data: Data): Promise<UpdateResponse> {
try {
const response = await axiosInstance.put(UPDATE_MY_PROFILE_PATH, data, {
headers: {
Authorization: `Bearer ${import.meta.env.VITE_TOKEN}`
}
})

return response.data
} catch (error) {
throw new Error('Error while fetching profile')
}
}

export default updateName
24 changes: 24 additions & 0 deletions src/apis/updatePassword.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { UPDATE_MY_PASSWORD_PATH } from '@/utils/api_paths'
import axiosInstance from './api'

interface Data {
[key: string]: string
}

interface UpdateResponse extends User {}

async function updatePassword(data: Data): Promise<UpdateResponse> {
try {
const response = await axiosInstance.put(UPDATE_MY_PASSWORD_PATH, data, {
headers: {
Authorization: `Bearer ${import.meta.env.VITE_TOKEN}`
}
})

return response.data
} catch (error) {
throw new Error('Error while fetching profile')
}
}

export default updatePassword
22 changes: 22 additions & 0 deletions src/apis/uploadImage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { UPDATE_PROFILE_IMAGE_PATH } from '@/utils/api_paths'
import axiosInstance from './api'

async function uploadImage(formData: FormData) {
try {
const response = await axiosInstance.post(
UPDATE_PROFILE_IMAGE_PATH,
formData,
{
headers: {
Authorization: `Bearer ${import.meta.env.VITE_TOKEN}`,
'Content-Type': 'multipart/form-data'
}
}
)
return response.data
} catch (error) {
throw new Error('Error while uploading image')
}
}

export default uploadImage
Empty file removed src/assets/.gitkeep
Empty file.
9 changes: 9 additions & 0 deletions src/assets/icons/bookmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/comment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/commentDelete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/commentUpload.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/icons/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/icons/fileUpload.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/following.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/icons/notification.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/prev_brown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/prev_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading