Skip to content

Commit

Permalink
Merge pull request #202 from SejongPeer/JunYoung
Browse files Browse the repository at this point in the history
style:메인페이지 수정
  • Loading branch information
JunYoungKr authored Mar 6, 2024
2 parents 7ef7ba3 + 1ec0ba7 commit 203f21b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 23 deletions.
Binary file modified src/Assets/peerUse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 27 additions & 5 deletions src/Components/Login/SignUp/Auth/Auth.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import style from '../Auth/Auth.module.css';
import { useState, useContext } from 'react';
import axios from 'axios';
import { useNavigate } from 'react-router-dom';
import { MyContext } from '../../../../App';

import axios from 'axios';
const Auth = () => {
const [Id, setId] = useState('');
const [passWord, setPassWord] = useState('');
Expand All @@ -14,6 +13,7 @@ const Auth = () => {
console.log(passWord);

axios
<<<<<<< Updated upstream
.post(process.env.REACT_APP_BACK_SERVER + '/auth/sejong-auth', {
id: Id,
pw: passWord,
Expand All @@ -35,10 +35,32 @@ const Auth = () => {
setGrade(response.data.data.grade);
setStudentNum(Id);
navigate("/login/signup");
=======
.post("/api?method=ClassicSession", {
id: Id,
pw: passWord,
})
.then(
(response) => {
console.log(response);
console.log(response.data);
console.log(response.data.result);
let result = response.data.result.is_auth;
if (result === false)
alert("아이디 및 비밀번호가 일치하지 않습니다")
else if (result === true) {
alert("인증 완료!");
console.log(response.data.result.body);
setName(response.data.result.body.name);
setGrade(response.data.result.body.grade);
setStudentNum(Id);
navigate("/login/signup");
}
>>>>>>> Stashed changes
}
}
)
.catch((err) => console.log(err.message));
)
.catch((err) => console.log(err.message));

};

const { name, setName } = useContext(MyContext);
Expand Down
18 changes: 10 additions & 8 deletions src/Components/main/MainPage/MainPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import MainHonbob from './MainHonbob';
import reprot from '../../../Assets/report.png';
import { useEffect, useState } from 'react';
import honbobUse from '../../../Assets/honbobUse.png';
import peerUse from '../../../Assets/peerUse.png';
import buddyUse from '../../../Assets/buddyUse.png';
import buddyButton from '../../../Assets/buddyButton.png';
import honbobButton from '../../../Assets/honbobButton.png';

const images = [honbobUse, buddyUse];
const images = [honbobUse, buddyUse, peerUse];

const MainPage = () => {
const navigate = useNavigate();
Expand Down Expand Up @@ -121,19 +122,20 @@ const MainPage = () => {

useEffect(() => {
const timer = setInterval(() => {
setSlideIn(false); // Trigger the slide out animation
setSlideIn(false);
setTimeout(() => {
setCurrentImageIndex(prevIndex => (prevIndex + 1) % images.length);
setSlideIn(true); // Reset to slide in the new image
}, 200); // This should be less than your setInterval time
}, 2000);
setSlideIn(true);
}, 200);
}, 3500);

return () => clearInterval(timer);
}, []);

const urls = [
'https://sejonghonbab.simple.ink/', // 혼밥 이용방법
'https://sejongbuddy.simple.ink/', // 세종버디 이용방법
'https://sejongpeer.simple.ink/' // FAQ
];

// 이미지 클릭 이벤트 핸들러, 인덱스에 해당하는 URL로 이동
Expand Down Expand Up @@ -171,9 +173,9 @@ const MainPage = () => {
padding: '2vh',
}}
>
<img className={style.useImg}
src={images[currentImageIndex]}
onClick={() => onImageClick(currentImageIndex)}></img>
<img className={style.useImg}
src={images[currentImageIndex]}
onClick={() => onImageClick(currentImageIndex)}></img>
<div
style={{
display: 'flex',
Expand Down
19 changes: 9 additions & 10 deletions src/Components/main/MainPage/MainPage.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10vh;
background-color: #FFF7F7;
margin-top: 8vh;
background-color: #fff7f7;
width: 100vw;
height: 112vh;
height: 90vh;
}

.useImg {
width: 50vh;
height: 18vh;
Expand Down Expand Up @@ -40,7 +39,7 @@
margin-top: 2vh;
background-color: white;
border: 1px solid #e5e5e5;
border-radius: 24px;
border-radius: 16px;
background-image: url('../../../Assets/hide.png');
background-repeat: no-repeat;
background-position: center center;
Expand Down Expand Up @@ -135,10 +134,10 @@
display: flex;
flex-direction: column;
align-items: center;
margin-top: 8vh;
background-color: #FFF7F7;
margin-top: 7vh;
background-color: #fff7f7;
width: 100vw;
height: 90vh;
height: 85vh;
}

.useImg {
Expand Down Expand Up @@ -223,7 +222,7 @@
margin-top: 2vh;
background-color: white;
border: 1px solid #e5e5e5;
border-radius: 24px;
border-radius: 16px;
background-image: url('../../../Assets/hide.png');
background-repeat: no-repeat;
background-position: center;
Expand Down Expand Up @@ -257,7 +256,7 @@
font-size: 0.8rem;
color: #333333;
font-weight: 700;
margin-top: 1vh;
margin-top: 5vh;
}

.report_user_box img {
Expand Down

0 comments on commit 203f21b

Please sign in to comment.