Skip to content

Commit c0ff890

Browse files
committed
Feat: 알파용 작업 완료
1 parent 1a84c58 commit c0ff890

File tree

33 files changed

+634
-303
lines changed

33 files changed

+634
-303
lines changed

src/App.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,24 @@ import RegistProject from './pages/Request/RegistProject';
1010
import RequestHome from './pages/Request/RequestHome';
1111
import RequestDetail from './pages/Request/RequestDetail';
1212
import Callback from './auth/Callback';
13+
import useStore from './zustand/Store';
1314

1415
function App() {
16+
const { setIsLogin } = useStore();
17+
18+
useEffect(() => {
19+
const checkLoginStatus = () => {
20+
const token = localStorage.getItem('accessToken');
21+
setIsLogin(!!token);
22+
};
23+
24+
checkLoginStatus();
25+
window.addEventListener('storage', checkLoginStatus);
26+
27+
return () => {
28+
window.removeEventListener('storage', checkLoginStatus);
29+
};
30+
}, []);
1531
return (
1632
<BrowserRouter>
1733
<Routes>

src/api/file.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { PostAxiosInstance } from '../axios/AxiosMethod';
2+
3+
export const uploadFiles = async (file, filepath) => {
4+
const formData = new FormData();
5+
formData.append('multipartFiles', file);
6+
formData.append('filePath', filepath);
7+
try {
8+
const res = await PostAxiosInstance(
9+
'/api/files',
10+
{ 'Content-Type': 'multipart/formdata' },
11+
formData,
12+
);
13+
return res;
14+
} catch (error) {
15+
console.error(error);
16+
}
17+
};

src/api/oauth.js

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export const getToken = async () => {
4242
});
4343
localStorage.setItem('accessToken', res.data.access_token);
4444
localStorage.setItem('refreshToken', res.data.refresh_token);
45-
console.log(res);
4645
} catch (error) {
4746
console.error(error);
4847
}
@@ -99,31 +98,21 @@ export const checkIsRegisted = async () => {
9998
}
10099
};
101100

102-
export const registClientGroup = async ({
103-
clientType,
104-
groupName,
101+
export const registClient = async ({
102+
nickName,
103+
businessName,
104+
businessLogo,
105105
managerName,
106106
managerPhone,
107107
}) => {
108108
try {
109-
const res = await PostAxiosInstance('/api/user/group', {
110-
clientType,
111-
groupName,
112-
managerName,
113-
managerPhone,
114-
});
115-
return res;
116-
} catch (e) {
117-
console.error(e);
118-
}
119-
};
120-
121-
export const registClientIndividual = async ({ name, phone }) => {
122-
try {
123-
const res = await PostAxiosInstance('/api/user/individual', {
124-
name: name,
125-
phone: phone,
126-
});
109+
const formData = new FormData();
110+
formData.append('nickName', nickName);
111+
formData.append('businessName', businessName);
112+
formData.append('businessLogo', businessLogo);
113+
formData.append('managerName', managerName);
114+
formData.append('managerPhone', managerPhone);
115+
const res = await PostAxiosInstance('/api/epic/businesses', formData);
127116
return res;
128117
} catch (e) {
129118
console.error(e);

src/assets/svgs/filter_icon.svg

Lines changed: 1 addition & 1 deletion
Loading

src/components/common/Button/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export const CustomButton = styled.button`
88
justify-content: center;
99
align-items: center;
1010
cursor: pointer;
11-
background-color: ${(props) => props.bgcolor || '#1B75D0'};
11+
background-color: ${(props) => props.bgcolor || '#393939'};
1212
color: ${(props) => props.fontcolor || '#fff'};
13-
border-color: ${(props) => props.bordercolor || '#1B75D0'};
13+
border-color: ${(props) => props.bordercolor || '#393939'};
1414
text-align: center;
1515
font-size: 0.8125rem;
1616
font-style: normal;

src/components/common/Filter/Buttons/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export const FilterButton = styled.button`
6060
align-items: flex-end;
6161
text-align: center;
6262
border-radius: 0.375rem;
63-
border: 1px solid #1b75d0;
64-
color: #1b75d0;
63+
border: 1px solid #393939;
64+
color: #393939;
6565
text-align: center;
6666
font-family: 'Segoe UI';
6767
font-size: 0.75rem;

src/components/common/InputText/InputText.jsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ const InputText = (props) => {
99
let value = e.target.value;
1010

1111
if (props.type === 'number') {
12-
if (value === '') {
13-
setProjectInfo({ [props.keyName]: '' });
14-
} else if (/^\d*$/.test(value)) {
15-
setProjectInfo({ [props.keyName]: parseInt(value) });
12+
const unformattedValue = value.replace(/,/g, '');
13+
if (/^\d*$/.test(unformattedValue)) {
14+
setProjectInfo({
15+
[props.keyName]: unformattedValue ? parseInt(unformattedValue) : '',
16+
});
17+
18+
const formattedValue = unformattedValue.replace(
19+
/\B(?=(\d{3})+(?!\d))/g,
20+
',',
21+
);
22+
e.target.value = formattedValue;
1623
}
1724
} else if (props.type === 'date') {
1825
value = value.replace(/-/g, '');
@@ -50,7 +57,13 @@ const InputText = (props) => {
5057
) : (
5158
<InputContainer
5259
type="text"
53-
value={projectInfo[props.keyName]}
60+
value={
61+
props.type === 'number'
62+
? projectInfo[props.keyName]
63+
?.toString()
64+
.replace(/\B(?=(\d{3})+(?!\d))/g, ',') || ''
65+
: projectInfo[props.keyName]
66+
}
5467
onChange={handleChange}
5568
placeholder={props.placeHolder}
5669
height={props.height}

src/components/common/InputText/style.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,38 @@ import styled from 'styled-components';
44
export const InputContainer = styled.input`
55
width: ${(props) => (props.width ? props.width : 100)}%;
66
height: ${(props) => (props.height ? props.height : 1.875)}rem;
7-
border-radius: 0.125rem;
8-
border: 1px solid #1b75d0;
7+
border-radius: 0.3125rem;
8+
border: 3px solid #393939;
99
padding-left: 0.5rem;
10-
color: #000;
11-
font-family: 'Noto Sans KR';
12-
font-size: 0.813rem;
10+
color: #393939;
11+
font-family: Pretendard;
12+
font-size: 0.8125rem;
1313
font-style: normal;
14-
font-weight: 400;
14+
font-weight: 600;
1515
line-height: 0.9375rem;
16-
line-height: 3rem;
16+
&::placeholder {
17+
color: #cecece;
18+
}
1719
`;
1820

1921
export const TextArea = styled.textarea`
2022
width: 100%;
2123
height: 15rem;
2224
resize: none;
23-
border-radius: 0.125rem;
24-
border: 1px solid #1b75d0;
25+
border-radius: 0.3125rem;
26+
border: 3px solid #393939;
2527
padding-top: 0.3rem;
2628
padding-left: 0.5rem;
27-
color: #000;
28-
font-family: 'Noto Sans KR';
29-
font-size: 0.813rem;
29+
color: #393939;
30+
font-family: Pretendard;
31+
font-size: 0.8125rem;
3032
font-style: normal;
31-
font-weight: 400;
33+
font-weight: 600;
3234
line-height: 0.9375rem;
3335
&:focus {
3436
outline: none;
3537
}
38+
&::placeholder {
39+
color: #cecece;
40+
}
3641
`;

src/components/common/Label/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export const LabelStyle = styled.div`
1010
background: #f1f2f3;
1111
color: #000;
1212
text-align: center;
13-
font-family: 'Noto Sans KR';
13+
font-family: Pretendard;
1414
font-size: 0.75rem;
1515
font-style: normal;
16-
font-weight: 700;
16+
font-weight: 800;
1717
line-height: 1.38438rem; /* 184.583% */
1818
`;

src/components/common/PrintLabel/style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const Container = styled.div`
1717
line-height: 0.9375rem;
1818
text-align: ${(props) => (props.isTextBox ? 'left' : 'right')};
1919
border-radius: 0.125rem;
20-
border: 1px solid #1b75d0;
20+
border: 1px solid #393939;
2121
overflow-wrap: break-word;
2222
word-break: break-word;
2323
white-space: normal;

0 commit comments

Comments
 (0)