-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Recoil 설정 - React-query 설정 - globalStyles 설정 - Header 및 routing 구현 #2
- Loading branch information
1 parent
e9aad6f
commit 5a5ecd7
Showing
22 changed files
with
952 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="Web site created using create-react-app" | ||
/> | ||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<!-- | ||
manifest.json provides metadata used when your web app is installed on a | ||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
--> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
<!-- | ||
Notice the use of %PUBLIC_URL% in the tags above. | ||
It will be replaced with the URL of the `public` folder during the build. | ||
Only files inside the `public` folder can be referenced from the HTML. | ||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
work correctly both with client-side routing and a non-root public URL. | ||
Learn how to configure a non-root public URL by running `npm run build`. | ||
--> | ||
<title>React App</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta name="description" content="Meeting management system" /> | ||
<title>Meeting management system</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { atom } from 'recoil'; | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react'; | ||
|
||
type textProps = { | ||
children: string; | ||
fontSize?: number; | ||
fontWeight?: string | number; | ||
letterSpacing?: string | number; | ||
onClick?: (e: any) => void; | ||
}; | ||
|
||
const Text: React.FC<textProps> = ({ | ||
children, | ||
fontSize = 1.2, | ||
fontWeight = 'normal', | ||
letterSpacing = 'normal', | ||
onClick, | ||
}: textProps) => { | ||
return onClick ? ( | ||
<button | ||
type='button' | ||
style={{ | ||
fontSize: `${fontSize}rem`, | ||
fontWeight: fontWeight, | ||
letterSpacing: `${letterSpacing}rem`, | ||
fontFamily: 'inter', | ||
}} | ||
onClick={onClick} | ||
> | ||
{children} | ||
</button> | ||
) : ( | ||
<span | ||
style={{ | ||
fontSize: `${fontSize}rem`, | ||
fontWeight: fontWeight, | ||
letterSpacing: `${letterSpacing}rem`, | ||
}} | ||
> | ||
{children} | ||
</span> | ||
); | ||
}; | ||
|
||
export default Text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React, { ReactNode } from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
const Container = styled.div<{ needMargin: boolean }>` | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
flex-direction: row; | ||
margin-top: ${(props) => (props.needMargin ? '2rem' : 0)}; | ||
margin-left: ${(props) => (props.needMargin ? '5%' : 0)}; | ||
margin-right: ${(props) => (props.needMargin ? '5%' : 0)}; | ||
`; | ||
|
||
type FlexRowProps = { | ||
children: ReactNode; | ||
needMargin?: boolean; | ||
}; | ||
|
||
const FlexRow: React.FC<FlexRowProps> = ({ children, needMargin = false }: FlexRowProps) => { | ||
return <Container needMargin={needMargin}>{children}</Container>; | ||
}; | ||
|
||
export default FlexRow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import Text from '../atoms/text'; | ||
|
||
type LogoProps = { | ||
onClick?: (e: any) => void; | ||
}; | ||
|
||
const Logo: React.FC<LogoProps> = ({ onClick = () => {} }: LogoProps) => { | ||
return ( | ||
<Text fontSize={2.4} fontWeight={900} letterSpacing='0.4' onClick={onClick}> | ||
LUCENTBLOCK | ||
</Text> | ||
); | ||
}; | ||
|
||
export default Logo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import Text from '../atoms/text'; | ||
import FlexRow from './flex_row'; | ||
|
||
const Li = styled.li` | ||
margin: 0 0 0 4rem; | ||
`; | ||
|
||
const Nav: React.FC = () => { | ||
return ( | ||
<ul> | ||
<FlexRow> | ||
<Li> | ||
<Text onClick={() => console.log('login clicked')}>로그인</Text> | ||
</Li> | ||
<Li> | ||
<Text onClick={() => console.log('signup clicked')}>회원가입</Text> | ||
</Li> | ||
</FlexRow> | ||
</ul> | ||
); | ||
}; | ||
|
||
export default Nav; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import Nav from '../molecules/nav'; | ||
import Logo from '../molecules/logo'; | ||
import FlexRow from '../molecules/flex_row'; | ||
|
||
const Header: React.FC = () => { | ||
const navigate = useNavigate(); | ||
return ( | ||
<FlexRow needMargin> | ||
<Logo onClick={() => navigate('/')} /> | ||
<Nav /> | ||
</FlexRow> | ||
); | ||
}; | ||
|
||
export default Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { createGlobalStyle } from 'styled-components'; | ||
|
||
const GlobalStyle = createGlobalStyle` | ||
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400&display=swap'); | ||
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, menu, 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, | ||
main, menu, nav, output, ruby, section, summary, | ||
time, mark, audio, video { | ||
margin: 0; | ||
padding: 0; | ||
border: 0; | ||
font-size: 100%; | ||
font: inherit; | ||
vertical-align: baseline; | ||
} | ||
/* HTML5 display-role reset for older browsers */ | ||
article, aside, details, figcaption, figure, | ||
footer, header, hgroup, main, menu, nav, section { | ||
display: block; | ||
} | ||
/* HTML5 hidden-attribute fix for newer browsers */ | ||
*[hidden] { | ||
display: none; | ||
} | ||
body { | ||
line-height: 1; | ||
} | ||
menu, ol, ul { | ||
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; | ||
} | ||
* { | ||
box-sizing: border-box; | ||
} | ||
body { | ||
font-weight: 300; | ||
font-family: 'Source Sans Pro', sans-serif; | ||
color:black; | ||
line-height: 1.2; | ||
} | ||
a { | ||
text-decoration:none; | ||
color:inherit; | ||
} | ||
button { | ||
border: none; | ||
background-color: transparent; | ||
cursor: pointer; | ||
} | ||
@font-face { | ||
font-family: 'inter'; | ||
src: url('./assets/fonts/inter.ttf'); | ||
} | ||
`; | ||
|
||
export default GlobalStyle; |
Oops, something went wrong.