Skip to content

Commit

Permalink
Merge pull request #2 from SWM-FIRE/FIRE-130-폴더-구조-설계
Browse files Browse the repository at this point in the history
FIRE-130 - FIRE-130-폴더-구조-설계
  • Loading branch information
071yoon authored Jun 22, 2022
2 parents 562edf3 + 71ab68c commit a63161f
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import React from 'react';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import styled from 'styled-components';
import Layout from './components/layout/Layout';
import MainPage from './pages/MainPage';

function Router() {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<TestContainer />} />
<Route path="/" element={<Layout />}>
<Route index element={<MainPage />} />
</Route>
<Route path="/test2" element={<TestContainer2 />} />
<Route path="/test3" element={<TestContainer3 />} />
</Routes>
</BrowserRouter>
);
}

const TestContainer = styled.div`
width: 100vw;
height: 100vh;
background-color: lightcyan;
`;
const TestContainer2 = styled.div`
width: 100vw;
height: 100vh;
Expand Down
Binary file added src/assets/img/fire6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions src/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import styled from 'styled-components';

export default function Footer() {
return (
<FooterWrapper>
<Container>
<span>&copy; {new Date().getFullYear()} by FIRE </span>
</Container>
</FooterWrapper>
);
}

const FooterWrapper = styled.footer`
width: 100%;
bottom: 0;
`;

const Container = styled.div`
display: flex;
justify-content: flex-end;
align-items: center;
padding: 2rem;
span {
font-size: 1.5rem;
}
`;
18 changes: 18 additions & 0 deletions src/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import { Outlet } from 'react-router-dom';
import styled from 'styled-components';
import Footer from './Footer';

export default function Layout() {
return (
<Container>
<Outlet />
<Footer />
</Container>
);
}

const Container = styled.div`
width: 100vw;
height: 100vh;
`;
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import GlobalStyle from './Styles/GlobalStyle';
import GlobalStyle from './styles/GlobalStyle';

ReactDOM.render(
<React.StrictMode>
Expand Down
11 changes: 11 additions & 0 deletions src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styled from 'styled-components';

export default function MainPage() {
return <Container />;
}

const Container = styled.div`
width: 100vw;
height: 100vh;
background-color: lightskyblue;
`;
79 changes: 79 additions & 0 deletions src/styles/GlobalStyle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { createGlobalStyle } from 'styled-components';

const GlobalStyle = createGlobalStyle`
* {
box-sizing: border-box;
}
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font-family: sans-serif;
vertical-align: baseline;
}
input {
font-family: sans-serif;
}
button {
font-family: sans-serif;
}
html {
font-size: 62.5%;
}
html, body, #root {
min-height: 100%;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul, li {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote::before, blockquote::after,
q::before, q::after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* a {
text-decoration: none;
color: inherit;
} */
`;

export default GlobalStyle;

0 comments on commit a63161f

Please sign in to comment.