RecommandPage.js 3.08 KB
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;