Commit 5cd5064a authored by Lee SeoYeon's avatar Lee SeoYeon
Browse files

+버튼 링크

parent 6e77fd3a
import React from "react"; import React, { FormEvent } from "react";
import { Link } from "react-router-dom"; import { useAuth } from "../auth/auth.context";
export const Home = () => ( export const Home = () => {
<div className="flex flex-col place-items-center"> const { user } = useAuth();
<div className="justify-end text-center text-3xl text-black h-16 mt-12">
가장 쉽게 설문지를 만드세요! function clickHome(e: React.MouseEvent<HTMLButtonElement>) {
</div> e.preventDefault();
<div className="flex flex-col place-items-center container"> if (!user.isLoggedIn) {
<div> console.log("버튼");
<Link location.href = "/login";
to="/create" } else {
className="flex h-14 w-28 items-center border-2 border-themeColor font-bold text-black bg-gray-200 hover:bg-themeColor rounded-lg " location.href = "/profile";
> }
<div className="text-center w-28 font-bold text-black place-items-center"> }
return (
<div className="flex flex-col place-items-center">
<div className="justify-end text-center text-3xl text-black h-16 mt-12">
가장 쉽게 설문지를 만드세요!
</div>
<div className="flex flex-col place-items-center container">
<div className="flex h-14 w-28 items-center border-2 border-themeColor font-bold text-black bg-gray-200 hover:bg-themeColor rounded-lg ">
<button
type="button"
className="text-center h-full w-28 font-bold text-black place-items-center"
onClick={clickHome}
>
+ +
</div> </button>
</Link> </div>
<p className="text-center text-xl text-black">Create now!</p>
</div>
<div className="flex justify-center">
<img
src="https://3hbgf23vu0wr11wkpae5igwe-wpengine.netdna-ssl.com/wp-content/uploads/2021/04/SurveyExample_v3.jpg"
className="object-scale-down justify-center"
/>
</div> </div>
<p className="text-center text-xl text-black">Create now!</p>
</div>
<div className="flex justify-center">
<img
src="https://3hbgf23vu0wr11wkpae5igwe-wpengine.netdna-ssl.com/wp-content/uploads/2021/04/SurveyExample_v3.jpg"
className="object-scale-down justify-center"
/>
</div> </div>
</div> );
); };
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment