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

mypage css #106

Merged
merged 2 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
8 changes: 2 additions & 6 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ export default function App() {
withCredentials: true,
})
.then((res) => {
console.log(res.message);
console.log(res.data.data);
const { nickname, email, profile_image, comment, id } = res.data.data;
// !
setUserInfo({
Expand All @@ -97,10 +95,12 @@ export default function App() {
})
.then((res) => {


if (res.data.message !== 'ok') {}
const { nickname, email, profile_image, id,comment } = res.data.data.userInfo;
console.log(res.data.data.accessToken)
setAccessToken({accessToken:res.data.data.accessToken})

setUserInfo({
id : id,
nickname: nickname,
Expand All @@ -115,7 +115,6 @@ export default function App() {
setAccessToken({ accessToken: token });
accessTokenRequest(token);
history.push('/Waiting');
console.log(token);
};
//구글 로그인----------------------------------------------------------------

Expand All @@ -130,15 +129,12 @@ export default function App() {
withCredentials: true,
}
);
console.log(resp.data);
issueAccessToken(resp.data.accessToken);
};
//구글 로그인 코드 받기--------------------------------
useEffect(() => {
const url = new URL(window.location.href);
const authorizationCode = url.searchParams.get('code');
console.log('accessToken', accessToken);
console.log('userInfo:', userInfo);
if (authorizationCode) {
getAccessToken(authorizationCode);
}
Expand Down
7 changes: 6 additions & 1 deletion src/GamePages/InGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ export default function InGame({ accessToken, isLogIn, loginCheck, userInfo }) {

//! --------------------------method--------------------------



useEffect(() => {

// * 문제가 선택되면 게임스타트와 문제를 서버에 보내줌
SetAnswer(answer);
}, [answer]);
Expand Down Expand Up @@ -147,13 +150,16 @@ export default function InGame({ accessToken, isLogIn, loginCheck, userInfo }) {
setWinner([...winner, name]);
});



socket.on('renew userlist', (list) => {
console.log('d우ㅠ저소ㅓ켓');
setUserlist([...list]);
});
}, []);

useEffect(() => {

socket.on('show chat', (name, message) => {
if (chat.length > 10) {
setChat([...chat.slice(1), { name, message }]);
Expand All @@ -169,7 +175,6 @@ export default function InGame({ accessToken, isLogIn, loginCheck, userInfo }) {
let parsedUrl = window.location.href.split('/');
let roomNum = parsedUrl[parsedUrl.length - 1];
socket.emit('send roomNum', roomNum);
console.log('userlist', userlist);
}, []);

return (
Expand Down
15 changes: 6 additions & 9 deletions src/GamePages/components/Canvas3.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ export default function Canvas3() {
const current = {
color: 'black',
};
console.log(current.colors);

const onColorUpdate = (e) => {
console.log(e.target.className);
current.color = e.target.className.split(' ')[1];
};

Expand All @@ -55,13 +53,12 @@ export default function Canvas3() {
}

const drawLine = (x0, y0, x1, y1, color, emit) => {
// console.log(x0, y0, x1, y1, color, emit);
context.beginPath();
context.moveTo(x0, y0);
context.lineTo(x1, y1);
context.lineCap = 'round';

context.strokeStyle = color;
context.strokeStyle = current.color;
context.lineWidth = 8;
context.stroke();
context.closePath();
Expand Down Expand Up @@ -182,19 +179,19 @@ export default function Canvas3() {
<canvas ref={canvasRef} className="whiteBoardInGame" style={cursor} />
<div className="pallette">
<div className="colors" ref={colorsRef}>
<div className="black" onClick={handleColorClick}>
<div className="color black" onClick={handleColorClick}>
black
</div>
<div className="red" onClick={handleColorClick}>
<div className="color red" onClick={handleColorClick}>
red
</div>
<div className="blue" onClick={handleColorClick}>
<div className="color blue" onClick={handleColorClick}>
blue
</div>
<div className="green" onClick={handleColorClick}>
<div className="color green" onClick={handleColorClick}>
green
</div>
<div className="yellow" onClick={handleColorClick}>
<div className="color yellow" onClick={handleColorClick}>
yellow
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/GamePages/components/Colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

export default function Colors({ handleColorClick }) {
return (
<div className="Colors">
<div className="colors">
<div className="black" onClick={handleColorClick}>
black
</div>
Expand Down
1 change: 0 additions & 1 deletion src/MainPages/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default function Main({ loginHandler, handleGuestLogin }) {
withCredentials: true
})
.then((res) => {
console.log(res.data);
loginHandler(res.data);
history.push('/Waiting');
handleGuestLogin();
Expand Down
13 changes: 7 additions & 6 deletions src/MyPages/MyPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function MyPage({ accessToken, refreshTokenRequest, userInfo }) {
setPhotoNum(PhotoData.indexOf(nowPhoto))
console.log(PhotoNum)
if (photo !== nowPhoto) {
console.log('openModal');
openModal();
}
//MyPageSaveData()
Expand All @@ -46,7 +45,7 @@ function MyPage({ accessToken, refreshTokenRequest, userInfo }) {
setIsOpen(true);
setTimeout(() => {
setIsOpen(false);
}, 2000);
}, 1000);
};

const handlePhotoBox = () => {
Expand All @@ -55,6 +54,7 @@ function MyPage({ accessToken, refreshTokenRequest, userInfo }) {
} else {
setIsPhotoBoxOpen(true);
}
console.log('photobox', isPhotoBoxOpen);
};


Expand Down Expand Up @@ -110,14 +110,15 @@ function MyPage({ accessToken, refreshTokenRequest, userInfo }) {
</div>
<SearchUser />
</div>
{isPhotoBoxOpen ? (
{
<section className="UserProFile">
<div>
<div className="ProfilePhotos">
{PhotoData.map((photo) => (
{PhotoData.map((photo, idx) => (
<div>
<img
className="profileImg"
style={{ opacity: isPhotoBoxOpen ? '1' : '0' }}
className={`profileImg${idx}`}
src={photo}
alt="프로필사진"
onClick={() => ChangeInputPhoto(photo)}
Expand All @@ -127,7 +128,7 @@ function MyPage({ accessToken, refreshTokenRequest, userInfo }) {
</div>
</div>
</section>
) : null}
}
</content>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/MyPages/components/Complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export default function Complete({ isOpen }) {
console.log(isOpen);
return (
<span>
{isOpen ? (
{
<div style={{ opacity: isOpen ? '1' : '0' }} className="changedProfile">
<h3>사진변경이 완료되었습니다.</h3>
</div>
) : null}
}
</span>
);
}
22 changes: 2 additions & 20 deletions src/MyPages/components/SearchUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,12 @@ export default function SearchUser() {
<div className="following">
<div>팔로잉</div>
<input type="text" placeholder="유저 이메일"></input>
<ul className="followList">{<li>김재헌</li>}</ul>
<ul className="followList"></ul>
</div>
<div className="follower">
<div>팔로워</div>
<input type="text" placeholder="유저 닉네임"></input>
<ul className="followList">
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
<li>김재헌</li>
</ul>
<ul className="followList"></ul>
</div>
</div>
</div>
Expand Down
13 changes: 6 additions & 7 deletions src/WaitingPages/Waiting.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ export default function Waiting({
accessToken,
hendleLogout,
userInfo,
refreshTokenRequest
refreshTokenRequest,
}) {
const [createModal, setCreateModal] = useState(false);
const { token } = accessToken;
const { nickname } = userInfo;
useEffect(() => {
localStorage.setItem('accessToken', token);
console.log(localStorage);
});

const closeModal = () => {
Expand Down Expand Up @@ -53,11 +52,11 @@ export default function Waiting({
}, [locationKeys]);

useEffect(() => {
refreshTokenRequest()
if(accessToken.accessToken===null){
history.push('/')
}
},[]);
refreshTokenRequest();
if (accessToken.accessToken === null) {
history.push('/');
}
}, []);

return (
<div>
Expand Down
10 changes: 5 additions & 5 deletions src/WaitingPages/components/CreateGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useHistory } from 'react-router-dom';

import React, { useEffect, useState } from 'react';

export default function CreateGame({ createModal, closeModal,accessToken }) {
export default function CreateGame({ createModal, closeModal, accessToken }) {
const [roomName, setRoomName] = useState('');
const [roomPassword, setRoomPassword] = useState('');
const history = useHistory();
Expand All @@ -25,16 +25,16 @@ export default function CreateGame({ createModal, closeModal,accessToken }) {
'http://localhost:4000/room/new',
{ room_name, room_pw },
{
headers: {
headers: {
'Content-Type': 'application/json',
'authorization': accessToken
authorization: accessToken,
},
Credentials: 'include',
}
)
.then((res) => {
console.log(res.data);
history.push(`/room/${res.data.data}`)
history.push(`/room/${res.data.data}`);
})
.catch((err) => console.log(err));
};
Expand All @@ -49,7 +49,7 @@ export default function CreateGame({ createModal, closeModal,accessToken }) {
<span
type="button"
aria-label="Close"
className="signin_exit"
className="createRoom_exit"
onClick={closeModal}
>
&times;
Expand Down
Binary file removed src/images/mindcaptor_logo_ele.png
Binary file not shown.
Binary file modified src/images/mindcaptor_logo_sign.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading