손수민

[ADD] ClothesRecommandPage Layout Files

......@@ -19,10 +19,10 @@
"nodemon": "^2.0.16",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-redux": "^8.0.1",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"redux": "^4.1.2",
"redux": "^4.2.0",
"redux-thunk": "^2.4.1",
"web-vitals": "^2.1.4"
},
......@@ -14201,9 +14201,9 @@
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
},
"node_modules/react-redux": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.1.tgz",
"integrity": "sha512-LMZMsPY4DYdZfLJgd7i79n5Kps5N9XVLCJJeWAaPYTV+Eah2zTuBjTxKtNEbjiyitbq80/eIkm55CYSLqAub3w==",
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.2.tgz",
"integrity": "sha512-nBwiscMw3NoP59NFCXFf02f8xdo+vSHT/uZ1ldDwF7XaTpzm+Phk97VT4urYBl5TYAPNVaFm12UHAEyzkpNzRA==",
"dependencies": {
"@babel/runtime": "^7.12.1",
"@types/hoist-non-react-statics": "^3.3.1",
......@@ -14530,9 +14530,9 @@
}
},
"node_modules/redux": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/redux/-/redux-4.1.2.tgz",
"integrity": "sha512-SH8PglcebESbd/shgf6mii6EIoRM0zrQyjcuQ+ojmfxjTtE0z9Y8pa62iA/OJ58qjP6j27uyW4kUF4jl/jd6sw==",
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/redux/-/redux-4.2.0.tgz",
"integrity": "sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA==",
"dependencies": {
"@babel/runtime": "^7.9.2"
}
......@@ -27852,9 +27852,9 @@
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
},
"react-redux": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.1.tgz",
"integrity": "sha512-LMZMsPY4DYdZfLJgd7i79n5Kps5N9XVLCJJeWAaPYTV+Eah2zTuBjTxKtNEbjiyitbq80/eIkm55CYSLqAub3w==",
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.2.tgz",
"integrity": "sha512-nBwiscMw3NoP59NFCXFf02f8xdo+vSHT/uZ1ldDwF7XaTpzm+Phk97VT4urYBl5TYAPNVaFm12UHAEyzkpNzRA==",
"requires": {
"@babel/runtime": "^7.12.1",
"@types/hoist-non-react-statics": "^3.3.1",
......@@ -28088,9 +28088,9 @@
}
},
"redux": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/redux/-/redux-4.1.2.tgz",
"integrity": "sha512-SH8PglcebESbd/shgf6mii6EIoRM0zrQyjcuQ+ojmfxjTtE0z9Y8pa62iA/OJ58qjP6j27uyW4kUF4jl/jd6sw==",
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/redux/-/redux-4.2.0.tgz",
"integrity": "sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA==",
"requires": {
"@babel/runtime": "^7.9.2"
}
......
......@@ -14,10 +14,10 @@
"nodemon": "^2.0.16",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-redux": "^8.0.1",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"redux": "^4.1.2",
"redux": "^4.2.0",
"redux-thunk": "^2.4.1",
"web-vitals": "^2.1.4"
},
......
......@@ -3,6 +3,7 @@ import RegisterPage from './component/views/RegisterPage/RegisterPage';
import LoginPage from './component/views/LoginPage/LoginPage';
import MainPage from './component/views/MainPage/MainPage';
import SelectPage from './component/views/SelectPage/SelectPage';
import RecommandPage from './component/views/RecommandPage/RecommandPage';
import { Route, Routes } from 'react-router-dom';
function App() {
......@@ -13,6 +14,7 @@ function App() {
<Route exact path = "/register" element = {<RegisterPage/>}/>
<Route exact path = "/main" element = {<MainPage/>}/>
<Route exact path = "/select" element = {<SelectPage/>}/>
<Route exact path = "/recommand" element = {<RecommandPage/>}/>
</Routes>
</div>
);
......
import React, { useCallback, useState } from "react";
import { useNavigate } from "react-router-dom";
import { useDispatch, useSelector } from "react-redux";
import "../style/RecommandPage.scss"
import { image } from "../../../modules/user";
import TopImage from '../../../../src/img/1841764_3_500.png';
import BottomImage from '../../../../src/img/1926048_1_500.png';
import HeadImage from '../../../../src/img/2479141_1_500.png';
import ShoesImage from '../../../../src/img/1439535_8_500.png';
function RecommandPage(props) {
const dispatch = useDispatch();
const navigate = useNavigate();
const mainpageResult = useSelector((state) => state.user.mainpageSuccess);
const [Time, setTime] = useState("00:00:00");
const currentTime = () => {
const date = new Date();
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
const seconds = String(date.getSeconds()).padStart(2, "0");
setTime(hours+":"+minutes+":"+seconds);
}
const startTimer = () => {
setInterval(currentTime, 1000)
}
startTimer()
const navigate_login = useCallback((event) => {
navigate('../login');
})
const navigate_register = useCallback((event) => {
navigate('../register');
})
return (
<>
<dir id = "header">
<dir className="clock">
<h1 id="clock">{Time}</h1>
</dir>
<dir className="title">
<h1>Weather_Briefing</h1>
</dir>
<dir className="Login-Register">
<button type="button" onClick={navigate_login}>Login</button>
<button type="button" onClick={navigate_register}>Register</button>
</dir>
</dir>
<div id = "recommand_body">
<dir className="fashion_recommand">
<dir className="rainOrnot">/ 예보가 없습니다. </dir>
<dir className="clothes">
<dir className="Top">
<h1>TOP</h1>
<img src={TopImage} className='Top_Image' />
</dir>
<dir className="Bottom">
<h1>BOTTOM</h1>
<img src={BottomImage} className='Bottom_Image' />
</dir>
<dir className="Head">
<h1>HEAD</h1>
<img src={HeadImage} className='Head_Image' />
</dir>
<dir className="Shoes">
<h1>SHOES</h1>
<img src={ShoesImage} className='Shoes_Image' />
</dir>
</dir>
</dir>
</div>
<dir id = "footer">
<dir className="footer_logo">
<h1>logo</h1>
</dir>
<dir className="footer_info">
<p>경희대학교</p>
<p>컴퓨터공학과 김건희ㅣ오석진ㅣ손수민</p>
</dir>
</dir>
</>
);
};
export default RecommandPage;
......@@ -112,7 +112,7 @@ function RegisterPage(props) {
if (result.registerSuccess === '1') {
alert('회원 가입 완료!');
navigate('/login');
}
}
else if (result.registerSuccess === '0') {
alert('중복된 아이디 존재ㅠㅠ');
}
......
* {
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: rgb(245, 235, 223);
}
img {
width: 300px;
height: 300px;
object-fit: cover;
}
#recommand_body {
display: flex;
justify-content: center;
align-items: center;
border-top: 2px solid;
border-bottom: 2px solid;
.fashion_recommand {
border: 2px solid;
width: 90%;
height: 200%;
margin-top: 150px;
margin-bottom: 30px;
.rainOrnot {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
margin-left: 100px;
margin-right: 100px;
font-size :30px;
font-weight: bold;
}
.clothes{
display:flex;
justify-content: space-between;
align-items: space-between;
.Top{
display:flex;
flex-wrap: wrap;
flex-direction: column;
font-size: 30px;
border: 2px solid;
color:rgb(0, 0, 0);
justify-content: center;
align-items: center;
margin-top: 50px;
margin-bottom: 50px;
margin-left: 1%;
margin-right: 1%;
}
.Bottom{
display:flex;
flex-wrap: wrap;
flex-direction: column;
font-size: 30px;
border: 2px solid;
color:rgb(0, 0, 0);
justify-content: center;
align-items: center;
margin-top: 50px;
margin-bottom: 50px;
margin-left: 1%;
margin-right: 1%;
}
.Head{
display:flex;
flex-wrap: wrap;
flex-direction: column;
font-size: 30px;
border: 2px solid;
color:rgb(0, 0, 0);
justify-content: center;
align-items: center;
margin-top: 50px;
margin-bottom: 50px;
margin-left: 1%;
margin-right: 1%;
}
.Shoes{
display:flex;
flex-wrap: wrap;
flex-direction: column;
font-size: 30px;
border: 2px solid;
color:rgb(0, 0, 0);
justify-content: center;
align-items: center;
margin-top: 50px;
margin-bottom: 50px;
margin-left: 1%;
margin-right: 1%;
}
}
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ import axios from 'axios';
const USER_REGISTER = 'user/REGISTER';
const USER_LOGIN = 'user/LOGIN';
const USER_MAINPAGE = 'user/MAINPAGE';
export function register(dataToSubmit) {
......@@ -24,6 +25,17 @@ export function login(dataToSubmit) {
}
};
export function mainpage(dataToSubmit) {
const req = axios.post('http://localhost:4000/api/mainpage', dataToSubmit)
.then(res => res.data);
return {
type: USER_MAINPAGE,
payload: req,
}
};
export default function (state = {}, action) {
switch (action.type) {
case USER_REGISTER:
......@@ -32,6 +44,9 @@ export default function (state = {}, action) {
case USER_LOGIN:
return { ...state, loginSuccess: action.payload };
break;
case USER_MAINPAGE:
return { ...state, mainpageSuccess: action.payload };
break;
default:
return state;
}
......