Skip to content

Commit 3c658e4

Browse files
author
김준서 Junseo Kim
authored
Merge pull request #918 from Moadong/develop-fe
[release] FE v1.1.7
2 parents feee8f6 + 3dcf13d commit 3c658e4

File tree

50 files changed

+1260
-828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1260
-828
lines changed
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
// import API_BASE_URL from '@/constants/api';
2-
// import { secureFetch } from '../auth/secureFetch';
1+
import API_BASE_URL from '@/constants/api';
2+
import { secureFetch } from '../auth/secureFetch';
33

4-
// const deleteApplication = async (
5-
// applicationFormId: string,
6-
// ) => {
7-
// try {
8-
// const response = await secureFetch(`${API_BASE_URL}/api/club/application/${applicationFormId}`, {
9-
// method: 'DELETE',
10-
// },
11-
// );
12-
// if (!response.ok) {
13-
// console.error(`Failed to delete: ${response.statusText}`);
14-
// throw new Error((await response.json()).message);
15-
// }
4+
const deleteApplication = async (
5+
applicationFormId: string,
6+
) => {
7+
try {
8+
const response = await secureFetch(`${API_BASE_URL}/api/club/application/${applicationFormId}`, {
9+
method: 'DELETE',
10+
},
11+
);
12+
if (!response.ok) {
13+
console.error(`Failed to delete: ${response.statusText}`);
14+
throw new Error((await response.json()).message);
15+
}
1616

17-
// const result = await response.json();
18-
// return result.data;
19-
// } catch (error) {
20-
// console.error('Error fetching delete application', error);
21-
// throw error;
22-
// }
23-
// };
17+
const result = await response.json();
18+
return result.data;
19+
} catch (error) {
20+
console.error('Error fetching delete application', error);
21+
throw error;
22+
}
23+
};
2424

25-
// export default deleteApplication;
25+
export default deleteApplication;

frontend/src/apis/application/getApplication.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import API_BASE_URL from '@/constants/api';
2+
import { ApplicationFormData } from '@/types/application';
23

3-
const getApplication = async (clubId: string, applicationFormId: string) => {
4+
const getApplication = async (
5+
clubId: string,
6+
applicationFormId: string,
7+
): Promise<ApplicationFormData> => {
48
try {
5-
const response = await fetch(`${API_BASE_URL}/api/club/${clubId}/apply/${applicationFormId}`);
9+
const response = await fetch(
10+
`${API_BASE_URL}/api/club/${clubId}/apply/${applicationFormId}`,
11+
);
612
if (!response.ok) {
713
let message = response.statusText;
814
try {

frontend/src/apis/application/updateApplication.ts

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const updateApplication = async (
1010
const response = await secureFetch(
1111
`${API_BASE_URL}/api/club/application/${applicationFormId}`,
1212
{
13-
method: 'PUT',
13+
method: 'PATCH',
1414
headers: {
1515
'Content-Type': 'application/json',
1616
},
@@ -30,4 +30,30 @@ export const updateApplication = async (
3030
}
3131
};
3232

33-
export default updateApplication;
33+
export const updateApplicationStatus = async (
34+
applicationFormId: string,
35+
currentStatus: string,
36+
) => {
37+
const newStatus = currentStatus === 'ACTIVE' ? false : true;
38+
try {
39+
const response = await secureFetch(
40+
`${API_BASE_URL}/api/club/application/${applicationFormId}`,
41+
{
42+
method: 'PATCH',
43+
headers: {
44+
'Content-Type': 'application/json',
45+
},
46+
body: JSON.stringify({ active: newStatus }),
47+
},
48+
);
49+
if (!response.ok) {
50+
throw new Error('지원서 상태 수정에 실패했습니다.');
51+
}
52+
const result = await response.json();
53+
return result.data;
54+
} catch (error) {
55+
console.error('지원서 상태 수정 중 오류 발생:', error);
56+
throw error;
57+
}
58+
};
59+
Lines changed: 3 additions & 0 deletions
Loading

frontend/src/components/ClubLogo/ClubLogo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const StyledClubLogo = styled.div<{
2929
background-color: #efefef;
3030
background-size: cover;
3131
background-position: center;
32-
background-image: ${$imageSrc ? `url(${$imageSrc})` : 'none'};
32+
background-image: ${$imageSrc ? `url("${$imageSrc}")` : 'none'};
3333
`}
3434
3535
@media (max-width: 500px) {

frontend/src/components/common/Header/Header.styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import styled from 'styled-components';
22
import { media } from '@/styles/mediaQuery';
3+
import { Z_INDEX } from '@/styles/zIndex';
34

45
export const Header = styled.header<{ isScrolled: boolean }>`
56
position: fixed;
@@ -10,7 +11,7 @@ export const Header = styled.header<{ isScrolled: boolean }>`
1011
height: 62px;
1112
padding: 10px 20px;
1213
background-color: white;
13-
z-index: 1000;
14+
z-index: ${Z_INDEX.header};
1415
1516
box-shadow: ${({ isScrolled }) =>
1617
isScrolled ? '0px 2px 12px rgba(0, 0, 0, 0.04)' : 'none'};

frontend/src/components/common/Header/Header.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const Header = () => {
2323
handleHomeClick,
2424
handleIntroduceClick,
2525
handleClubUnionClick,
26-
handlePatchNoteClick,
26+
handleAdminClick,
2727
} = useHeaderNavigation();
2828

2929
const navLinks = [
@@ -33,7 +33,8 @@ const Header = () => {
3333
handler: handleClubUnionClick,
3434
path: '/club-union',
3535
},
36-
{ label: '패치노트', handler: handlePatchNoteClick, path: '/patch-note' },
36+
{ label: '관리자 페이지', handler: handleAdminClick, path: '/admin' },
37+
// { label: '패치노트', handler: handlePatchNoteClick, path: '/patch-note' },
3738
];
3839

3940
const closeMenu = () => {

frontend/src/components/common/LazyImage/LazyImage.tsx

Lines changed: 0 additions & 51 deletions
This file was deleted.

frontend/src/components/common/Modal/Modal.styles.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import { Z_INDEX } from '@/styles/zIndex';
12
import styled from 'styled-components';
23

34
export const Overlay = styled.div<{ isOpen: boolean }>`
4-
position: fixed;
55
inset: 0;
6-
z-index: 1000;
6+
position: fixed;
7+
z-index: ${Z_INDEX.overlay};
78
background: rgba(0,0,0, ${({ isOpen }) => (isOpen ? 0.45 : 0)});
89
display: grid;
910
place-items: center;
@@ -12,6 +13,8 @@ export const Overlay = styled.div<{ isOpen: boolean }>`
1213
`;
1314

1415
export const Container = styled.div<{ isOpen: boolean }>`
16+
position: relative;
17+
z-index: ${Z_INDEX.modal};
1518
max-width: 500px;
1619
width: 100%;
1720
max-height: 90vh;

frontend/src/components/common/ScrollToTopButton/ScrollToTopButton.styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { Z_INDEX } from '@/styles/zIndex';
12
import styled from 'styled-components';
23

34
export const ScrollButton = styled.button<{ $isVisible: boolean }>`
45
position: fixed;
56
bottom: 80px;
67
right: 30px;
7-
z-index: 1000;
8+
z-index: ${Z_INDEX.floatingButton};
89
opacity: ${({ $isVisible }) => ($isVisible ? 1 : 0)};
910
visibility: ${({ $isVisible }) => ($isVisible ? 'visible' : 'hidden')};
1011
transition: opacity 0.3s, visibility 0.3s;

0 commit comments

Comments
 (0)