Skip to content

Commit

Permalink
Merge pull request #185 from 100-hours-a-week/feature/lucy
Browse files Browse the repository at this point in the history
Chore : 센트리 설정 변경, 게임용 헤더적용을 위한 라우터 수정 및 게임용  헤더 생성
  • Loading branch information
lucy726j authored Sep 4, 2024
2 parents c310a73 + 4cf63f5 commit fedd051
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 10 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="kr">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/SkerrImg.png" />
Expand Down
22 changes: 22 additions & 0 deletions src/Component/Game/GameHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import styled from "styled-components";
import { Colors } from "../../Styles/Colors";
import { GameHeaderProp } from "../../constants/interface";

const Container = styled.div`
width: 100%;
height: 60px;
background-color: ${Colors.main};
color: white;
font-family: "SCDream6";
font-size: x-large;
text-align: center;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
padding-top: 15px;
`;

const GameHeader: React.FC<GameHeaderProp> = ({ text }) => {
return <Container>{text}</Container>;
};

export default GameHeader;
5 changes: 3 additions & 2 deletions src/Component/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ const Container = styled.div`
const Layout = (props: { children: React.ReactNode }) => {
const location = useLocation();
const isLoginPage = location.pathname === "/nologin";
const isGame = location.pathname.includes("/game");

return (
<Container className="Layout">
{!isLoginPage && <Header />}
{!isLoginPage && !isGame && <Header />}
<Main style={{ height: "100%" }}>{props.children}</Main>
{!isLoginPage && <NavBar />}
{!isLoginPage && !isGame && <NavBar />}
</Container>
);
};
Expand Down
35 changes: 34 additions & 1 deletion src/Pages/game/totalResult.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
import styled from "styled-components";
import GameHeader from "../../Component/Game/GameHeader";

const Say = styled.div`
position: relative;
background: #00aabb;
border-radius: 0.4em;
::after {
content: "";
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 0;
border: 20px solid transparent;
border-top-color: #00aabb;
border-bottom: 0;
border-left: 0;
margin-left: -10px;
margin-bottom: -20px;
}
`;

const TotalResult = () => {
return <div>게임 최종 결과 페이지</div>;
return (
<div>
<GameHeader text={"최 종 결 과"} />
<Say>
<h1>1등 Skrrr</h1>
<p>10년 전에 투자했으면</p>
<p>1000000원 벌었을텐데...</p>
</Say>
</div>
);
};

export default TotalResult;
12 changes: 6 additions & 6 deletions src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ const Router = () => {
<Route path="/error" element={<ErrorPage />} />

<Route path="/game" element={<SkrrrGamePage />} />
<Route path="/play/:year" element={<PlayPage />} />
<Route path="/info/:year" element={<InfoPage />} />
<Route path="/result/:year" element={<PlayResult />} />
<Route path="/result/total" element={<TotalResult />} />
<Route path="/gameStocks" element={<GameStocks />} />
<Route path="/rank" element={<Rank />} />
<Route path="/game/play/:year" element={<PlayPage />} />
<Route path="/game/info/:year" element={<InfoPage />} />
<Route path="/game/result/:year" element={<PlayResult />} />
<Route path="/game/result/total" element={<TotalResult />} />
<Route path="/game/gameStocks" element={<GameStocks />} />
<Route path="/game/rank" element={<Rank />} />
</Routes>
{/* <Routes></Routes> */}
</Layout>
Expand Down
4 changes: 4 additions & 0 deletions src/constants/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,7 @@ export interface IconWrapperProps {
$isActive: boolean;
// Type for react-icons components
}

export interface GameHeaderProp {
text: String;
}
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {

Sentry.init({
dsn: "https://9ebd886018c37c250bd7e9536b0c8157@o4507837261021184.ingest.us.sentry.io/4507837311942656",
environment: "production",
integrations: [
Sentry.reactRouterV6BrowserTracingIntegration({
useEffect,
Expand Down

0 comments on commit fedd051

Please sign in to comment.