) => {
+ const file = e.target.files?.[0];
if (file) {
setImgData(file);
}
};
const imgCompress = async (fileSrc: File) => {
- const options = {
+ /* const options = {
maxSizeMB: 0.1,
maxWidthOrHeight: 320,
useWebWorker: true,
- };
+ }; */
try {
- const res = await imageCompression(fileSrc, options);
+ // const res = await imageCompression(fileSrc, options);
const reader = new FileReader();
- reader.readAsDataURL(res);
+ reader.readAsDataURL(fileSrc);
reader.onloadend = () => {
- setImgPreview(reader.result);
+ setImgPreview(reader.result as string);
};
} catch (error) {
- console.log(error);
+ setError('SW00');
}
};
diff --git a/package-lock.json b/package-lock.json
index 829e8da91..bb623b333 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15,6 +15,7 @@
"@types/react-js-pagination": "^3.0.4",
"@types/react-router-dom": "^5.3.3",
"axios": "^0.27.2",
+ "browser-image-compression": "^2.0.0",
"chart.js": "^3.8.0",
"next": "^12.1.6",
"next-images": "^1.8.4",
@@ -2133,6 +2134,14 @@
"unload": "2.2.0"
}
},
+ "node_modules/browser-image-compression": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/browser-image-compression/-/browser-image-compression-2.0.0.tgz",
+ "integrity": "sha512-kBlkZo13yOOfcmrPW0M0K/UdZPogIQj2gRvXIM3FktAnfW6VRq9aY2RI+F6O0x6DMj1Xm+WLGgWcFK8Fu/ddnw==",
+ "dependencies": {
+ "uzip": "0.20201231.0"
+ }
+ },
"node_modules/browserslist": {
"version": "4.21.5",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz",
@@ -6259,6 +6268,11 @@
"uuid": "dist/bin/uuid"
}
},
+ "node_modules/uzip": {
+ "version": "0.20201231.0",
+ "resolved": "https://registry.npmjs.org/uzip/-/uzip-0.20201231.0.tgz",
+ "integrity": "sha512-OZeJfZP+R0z9D6TmBgLq2LHzSSptGMGDGigGiEe0pr8UBe/7fdflgHlHBNDASTXB5jnFuxHpNaJywSg8YFeGng=="
+ },
"node_modules/v8-compile-cache": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
@@ -8006,6 +8020,14 @@
"unload": "2.2.0"
}
},
+ "browser-image-compression": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/browser-image-compression/-/browser-image-compression-2.0.0.tgz",
+ "integrity": "sha512-kBlkZo13yOOfcmrPW0M0K/UdZPogIQj2gRvXIM3FktAnfW6VRq9aY2RI+F6O0x6DMj1Xm+WLGgWcFK8Fu/ddnw==",
+ "requires": {
+ "uzip": "0.20201231.0"
+ }
+ },
"browserslist": {
"version": "4.21.5",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz",
@@ -10924,6 +10946,11 @@
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
},
+ "uzip": {
+ "version": "0.20201231.0",
+ "resolved": "https://registry.npmjs.org/uzip/-/uzip-0.20201231.0.tgz",
+ "integrity": "sha512-OZeJfZP+R0z9D6TmBgLq2LHzSSptGMGDGigGiEe0pr8UBe/7fdflgHlHBNDASTXB5jnFuxHpNaJywSg8YFeGng=="
+ },
"v8-compile-cache": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
diff --git a/pages/admin/users.tsx b/pages/admin/users.tsx
index 667209ca5..2566fb8c3 100644
--- a/pages/admin/users.tsx
+++ b/pages/admin/users.tsx
@@ -8,9 +8,7 @@ export default function Users() {
users page
diff --git a/pages/api/admin/users/index.ts b/pages/api/admin/users/index.ts
index 9fe691daa..05fdb00ff 100644
--- a/pages/api/admin/users/index.ts
+++ b/pages/api/admin/users/index.ts
@@ -6,10 +6,10 @@ export default function handler(
) {
const user: any = [
{
- userId: 1,
- intraId: 'sungwook',
+ userId: 5,
+ intraId: 'jiyun',
userImageUri:
- 'https://42gg-public-image.s3.ap-northeast-2.amazonaws.com/images/sungwook.jpeg',
+ 'https://42gg-public-image.s3.ap-northeast-2.amazonaws.com/images/jiyun.jpeg',
racketType: 'penholder',
statusMessage: 'hello',
wins: 10,
diff --git a/styles/admin/modal/AdminProfile.module.scss b/styles/admin/modal/AdminProfile.module.scss
index 7da3f986c..28cac6159 100644
--- a/styles/admin/modal/AdminProfile.module.scss
+++ b/styles/admin/modal/AdminProfile.module.scss
@@ -1,25 +1,25 @@
.modal {
- background-color: #ffffff;
- box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.25);
- border-radius: 10px;
display: flex;
flex-direction: column;
- color: #898989;
+ box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.25);
width: 450px;
+ background-color: #ffffff;
+ border-radius: 10px;
+ color: #898989;
}
.title {
+ display: flex;
+ align-items: center;
+ line-height: 150%;
+ margin-left: 2rem;
+ height: 70px;
font-family: 'Inter';
font-style: normal;
font-weight: 500;
font-size: 28px;
- line-height: 150%;
text-transform: uppercase;
color: black;
- margin-left: 2rem;
- height: 70px;
- display: flex;
- align-items: center;
}
.topWrap {
@@ -69,8 +69,12 @@
.middle {
display: flex;
- flex-direction: column;
+ flex-wrap: wrap;
+ justify-content: space-between;
padding: 1rem 2rem;
+ :nth-child(2) {
+ color: #2678f3;
+ }
}
.middle textarea {
@@ -84,9 +88,9 @@
.bottom {
display: flex;
flex-direction: column;
- text-align: center;
- object-fit: contain;
align-items: stretch;
+ object-fit: contain;
+ text-align: center;
}
.choice {
@@ -99,19 +103,19 @@
}
.choiceName {
- width: 100px;
- height: 200px;
display: flex;
flex-direction: column;
justify-content: space-around;
+ width: 100px;
+ height: 200px;
}
.choiceBtn {
- width: 225px;
- height: 200px;
display: flex;
flex-direction: column;
justify-content: space-around;
+ width: 225px;
+ height: 200px;
}
.choiceBtn input {
@@ -124,39 +128,41 @@
}
.btns {
- padding: 1rem 0;
- border-top: 1.5px solid #e5e5e5;
display: flex;
flex-direction: column;
- align-items: center;
justify-content: space-around;
+ align-items: center;
height: 120px;
+ padding: 1rem 0;
+ border-top: 1.5px solid #e5e5e5;
}
.btnBlue {
display: flex;
flex-direction: column;
- background-color: #2678f3;
- border-radius: 8px;
+ justify-content: center;
+ align-items: center;
width: 400px;
height: 30px;
+ border: none;
+ border-radius: 8px;
+ background-color: #2678f3;
font-size: 15px;
color: white;
- align-items: center;
- justify-content: center;
}
.btnGray {
display: flex;
flex-direction: column;
- background-color: #6c757d;
- border-radius: 8px;
+ justify-content: center;
+ align-items: center;
width: 400px;
height: 30px;
+ border: none;
+ border-radius: 8px;
+ background-color: #6c757d;
font-size: 15px;
color: white;
- align-items: center;
- justify-content: center;
}
.racketTypeWrap {
@@ -164,16 +170,15 @@
flex-direction: column;
align-items: stretch;
.racketRadioButtons {
- font-size: 10px;
display: flex;
justify-content: space-between;
+ font-size: 10px;
input[type='radio'] {
- position: absolute;
- opacity: 0;
+ display: none;
}
:checked + .radioButton {
- border: solid 1px blue;
- color: blue;
+ border: solid 1px #2678f3;
+ color: #2678f3;
}
.radioButton {
display: flex;
diff --git a/types/admin/adminUserTypes.ts b/types/admin/adminUserTypes.ts
index 07df17d14..dd46beb85 100644
--- a/types/admin/adminUserTypes.ts
+++ b/types/admin/adminUserTypes.ts
@@ -1,19 +1,17 @@
export type UserInfo = {
- userId: number;
intraId: string;
- userImageUri: string | '';
+ userImageUri: string | null;
racketType: string;
statusMessage: string | '';
- wins: number | '';
- losses: number | '';
- ppp: number | '';
+ wins: number;
+ losses: number;
+ ppp: number;
eMail: string | '';
roleType: string;
};
-export type Props = {
- modalName?: 'ADMIN-PROFILE';
- value: string;
+export type AdminProfileProps = {
+ value: number;
};
export const roleTypes = [
diff --git a/types/modalTypes.ts b/types/modalTypes.ts
index 044572691..d34fdffaa 100644
--- a/types/modalTypes.ts
+++ b/types/modalTypes.ts
@@ -63,4 +63,5 @@ export interface Modal {
exp?: Exp;
gameId?: number;
intraId?: string;
+ userId?: number;
}