Skip to content

Commit

Permalink
feat: 모바일뷰 세팅
Browse files Browse the repository at this point in the history
  • Loading branch information
imddoy committed Jul 3, 2024
1 parent d8f9450 commit deca5c9
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 41 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!doctype html>
<html lang="en">
<html lang="ko">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>비트</title>
</head>
<body>
<div id="root"></div>
Expand Down
34 changes: 9 additions & 25 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
import { useState } from "react";
import "./App.css";
import reactLogo from "./assets/react.svg";
import viteLogo from "/vite.svg";
import router from "./routes/Router";
import { RouterProvider } from "react-router-dom";
import theme from "./styles/theme";
import GlobalStyle from "./styles/global";
import { ThemeProvider } from "styled-components";

function App() {
const [count, setCount] = useState(0);
const [hi, setHi] = useState([]);

return (
<>
<div>
<a href="https://vitejs.dev" target="_blank">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>count is {count}</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">Click on the Vite and React logos to learn more</p>
</>
<ThemeProvider theme={theme}>
<GlobalStyle />
<RouterProvider router={router} />
</ThemeProvider>
);
}

Expand Down
1 change: 0 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "./index.css";

ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
Expand Down
3 changes: 2 additions & 1 deletion src/routes/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createBrowserRouter } from "react-router-dom";

export const router = createBrowserRouter([
const router = createBrowserRouter([
// {
// path: "/A",
// element: <APage />,
Expand All @@ -15,3 +15,4 @@ export const router = createBrowserRouter([
// },
// ...
]);
export default router;
Empty file removed src/styles/.gitkeep
Empty file.
4 changes: 2 additions & 2 deletions src/styles/generator.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { css } from "styled-components";

export const Generators = {
flexGenerator: (flexDirection = "row", justifyContent = "center", alignItems = "center") => css`
flexGenerator: (flexDirection = "row", alignItems = "center", justifyContent = "center") => css`
display: flex;
flex-direction: ${flexDirection};
justify-content: ${justifyContent};
align-items: ${alignItems};
justify-content: ${justifyContent};
`,
fontGenerator: (
fontSize = "1.6rem",
Expand Down
33 changes: 23 additions & 10 deletions src/styles/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,41 @@ const global = createGlobalStyle`
* {
box-sizing: border-box;
}
html {
font-size: 62.5%;
background-color: ${({ theme }) => theme.colors.black};
user-select: none;
-webkit-touch-callout: none;
-webkit-tap-highlight-color:rgb(0 0 0 / 0%);
scroll-behavior: smooth;
scroll-behavior: smooth;
}
font-size: 62.5%;
user-select: none;
}
ul, li {
padding-left: 0;
list-style: none;
}
a {
color: inherit;
text-decoration: none;
}
input, button {
background-color: transparent;
outline: none;
border: none;
background-color: transparent;
}
button {
cursor: pointer;
padding: 0;
cursor: pointer;
}
input {
Expand All @@ -51,6 +53,17 @@ const global = createGlobalStyle`
}
}
/* 모바일뷰 세팅 */
body {
width: 375px;
min-height: 100%;
margin: 0 auto;
overflow-x: hidden;
background-color: ${({ theme }) => theme.colors.pink_400};
}
`;

export default global;

0 comments on commit deca5c9

Please sign in to comment.