Skip to content

Commit

Permalink
[ADD] #2 :: draw 페이지 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
jongeuni committed Apr 13, 2022
1 parent 055327f commit 8bb60fc
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
28 changes: 28 additions & 0 deletions rancuft/src/components/DrawGift/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { useState } from "react";
import { useMediaQuery } from "react-responsive";
import * as S from "./style.js";

function DrowGift() {
const isMobile = useMediaQuery({
query: "(max-width:767px)",
});
const isPc = useMediaQuery({
query: "(min-width:768px)",
});


return (
<>
{isMobile && (
<S.FullBackground>
<S.Background>
HI
</S.Background>
</S.FullBackground>
)}
{isPc && <h2>TEST</h2>}
</>
);
}

export default DrowGift;
17 changes: 17 additions & 0 deletions rancuft/src/components/DrawGift/style.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import styled from "@emotion/styled";

export const Background = styled.div`
top: 30px;
position: relative;
`;

export const FullBackground = styled.div`
position: absolute;
top:15%;
bottom: 20%;
right: 50%;
padding-right:30px;
padding-left:30px;
padding-bottom:200px;
transform: translateX(50%);
`;
10 changes: 10 additions & 0 deletions rancuft/src/container/Draw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Draw from "../components/DrawGift/index"

const DrawContainer = () => {
return( <>
<Draw />
</>
)
}

export default DrawContainer;
5 changes: 3 additions & 2 deletions rancuft/src/route/main_router.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { FC, Suspense, useCallback } from "react";
import { Routes, Route, useNavigate } from "react-router-dom";
import DrawContainer from "../container/Draw";
import { LoginContainer } from "../container/index";

const MainRouter = () => {
return (
<Routes>
<Route path="" element={<LoginContainer />} />
<Route path="/home" element={<LoginContainer/>}/>
<Route path="/draw" element={<DrawContainer/>}/>
</Routes>


);
};

Expand Down

0 comments on commit 8bb60fc

Please sign in to comment.