-
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.
add card rooms and refactor app and index
- Loading branch information
1 parent
908afe5
commit 827afca
Showing
21 changed files
with
241 additions
and
87 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
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,23 +1,26 @@ | ||
import React from 'react'; | ||
import Header from './modules/Header/Header'; | ||
import Footer from './modules/Footer/Footer'; | ||
import S from './styledApp'; | ||
import React, { useMemo } from 'react'; | ||
import { useSelector } from 'react-redux'; | ||
import { ThemeProvider } from 'styled-components/macro'; | ||
// import Footer from './modules/Footer/Footer'; | ||
import MyRoutes from './components/Routes/MyRoutes'; | ||
|
||
const App = () => ( | ||
<S.AppContainer> | ||
<Header headerName="CryptoTower" /> | ||
{/* ADD BODDY */} | ||
<div style={{ display: 'flex', flexDirection: 'column' }}> | ||
<div>FILL</div> | ||
<div>FILL</div> | ||
<div>FILL</div> | ||
<div>FILL</div> | ||
<div>FILL</div> | ||
<div>FILL</div> | ||
<div>FILL</div> | ||
</div> | ||
<Footer /> | ||
</S.AppContainer> | ||
); | ||
const App = () => { | ||
const isLogin = useSelector((state) => state.page.isLogin); | ||
const isRegister = useSelector((state) => state.page.isRegister); | ||
|
||
const theme = useMemo( | ||
() => ({ | ||
isLogin, | ||
isRegister, | ||
}), | ||
[isLogin, isRegister] | ||
); | ||
|
||
return ( | ||
<ThemeProvider theme={theme}> | ||
<MyRoutes /> | ||
</ThemeProvider> | ||
); | ||
}; | ||
|
||
export default App; |
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,21 @@ | ||
import React from 'react'; | ||
import S from './styledCard'; | ||
|
||
const Card = ( | ||
// eslint-disable-next-line react/prop-types | ||
{ roundPrice, numOfPlayers } // featureActivated | ||
) => ( | ||
<S.CardWrapper> | ||
<S.CardBody> | ||
<S.H2Title>{roundPrice}</S.H2Title> | ||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim | ||
veniam. | ||
</p> | ||
<S.H5Title>{`${numOfPlayers}/10`}</S.H5Title> | ||
</S.CardBody> | ||
</S.CardWrapper> | ||
); | ||
|
||
export default Card; |
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,64 @@ | ||
import styled from 'styled-components'; | ||
|
||
const CardWrapper = styled.div` | ||
display: flex; | ||
background: #fff; | ||
width: 24em; | ||
border-radius: 0.6em; | ||
margin: 1em; | ||
border: 1px dotted black; | ||
/* overflow: hidden; */ | ||
cursor: pointer; | ||
box-shadow: 0 13px 27px -5px hsla(240, 30.1%, 28%, 0.25), | ||
0 8px 16px -8px hsla(0, 0%, 0%, 0.3), 0 -6px 16px -6px hsla(0, 0%, 0%, 0.03); | ||
transition: all ease 200ms; | ||
p { | ||
color: #777; | ||
} | ||
:hover { | ||
transform: scale(1.03); | ||
box-shadow: 0 13px 40px -5px hsla(240, 30.1%, 28%, 0.12), | ||
0 8px 32px -8px hsla(0, 0%, 0%, 0.14), | ||
0 -6px 32px -6px hsla(0, 0%, 0%, 0.02); | ||
} | ||
`; | ||
|
||
// h2, h5 { | ||
// margin: 0; | ||
// } | ||
|
||
const H2Title = styled.h2` | ||
margin: 0; | ||
color: #222; | ||
margin-top: -0.2em; | ||
line-height: 1.4; | ||
font-size: 1.3em; | ||
font-weight: 500; | ||
font-family: 'Montserrat', sans-serif; | ||
transition: all ease-in 100ms; | ||
`; | ||
|
||
const H5Title = styled.h5` | ||
margin: 0; | ||
color: #bbb; | ||
font-weight: 700; | ||
font-size: 0.7em; | ||
letter-spacing: 0.04em; | ||
margin: 1.4em 0 0 0; | ||
text-transform: uppercase; | ||
`; | ||
|
||
const CardBody = styled.div` | ||
padding: 1.2em; | ||
`; | ||
|
||
const S = { | ||
CardWrapper, | ||
H2Title, | ||
H5Title, | ||
CardBody, | ||
}; | ||
|
||
export default S; |
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,21 +1,21 @@ | ||
import React from 'react'; | ||
import { Routes, Route } from 'react-router-dom'; | ||
import App from '../../App'; | ||
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; | ||
import Login from '../../modules/Login/Login'; | ||
import WebsocketConnection from '../../modules/websocketConnection/WebsocketConnection'; | ||
import Register from '../../modules/Register/Register'; | ||
// import S from './styledRoute'; | ||
import Header from '../../modules/Header/Header'; | ||
import Rooms from '../../modules/Rooms/Rooms'; | ||
|
||
const MyRoutes = () => ( | ||
<div> | ||
<Router> | ||
<Header /> | ||
<Routes> | ||
<Route exact path="/" element={<Login />} /> | ||
<Route exact path="/Register" element={<Register />} /> | ||
<Route exact path="/websocket" element={<WebsocketConnection />} /> | ||
<Route exact path="/home" element={<App />} /> | ||
<Route exact path="/login" element={<Login />} /> | ||
<Route exact path="/register" element={<Register />} /> | ||
<Route exact path="/rooms" element={<Rooms />} /> | ||
<Route path="*" element={<Login />} /> | ||
</Routes> | ||
</div> | ||
</Router> | ||
); | ||
|
||
export default MyRoutes; |
This file was deleted.
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
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
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,25 +1,24 @@ | ||
import React, { useState } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
// import PropTypes from 'prop-types'; | ||
import S from './styledHeader'; | ||
|
||
const Header = ({ headerName }) => { | ||
const Header = () => { | ||
// eslint-disable-next-line no-unused-vars | ||
const [test, setTest] = useState(false); | ||
|
||
return ( | ||
<S.HeaderContainer> | ||
<S.Title>{headerName}</S.Title> | ||
<S.LinksContainer> | ||
<S.StyledLink to="/login">login</S.StyledLink> | ||
{/* <S.StyledLink to="/login">login</S.StyledLink> | ||
<S.StyledLink to="/websocket">WebsocketConnection</S.StyledLink> | ||
<S.StyledLink to="/register">register</S.StyledLink> | ||
<S.StyledLink to="/register">register</S.StyledLink> */} | ||
</S.LinksContainer> | ||
</S.HeaderContainer> | ||
); | ||
}; | ||
|
||
Header.propTypes = { | ||
headerName: PropTypes.string, | ||
}; | ||
// Header.propTypes = { | ||
// headerName: PropTypes.string, | ||
// }; | ||
|
||
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
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
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
Oops, something went wrong.