mirror of
				https://github.com/elyby/accounts-frontend.git
				synced 2025-05-31 14:11:58 +05:30 
			
		
		
		
	Базовый лейаут
This commit is contained in:
		
							
								
								
									
										20
									
								
								src/components/auth/AppInfo.jsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								src/components/auth/AppInfo.jsx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| import React, { Component } from 'react'; | ||||
|  | ||||
| export default class SignIn extends Component { | ||||
|     render() { | ||||
|         var { name, desc } = this.props; | ||||
|  | ||||
|         return ( | ||||
|             <div> | ||||
|                 <div> | ||||
|                     <h2>{name}</h2> | ||||
|                 </div> | ||||
|                 <div> | ||||
|                     <p> | ||||
|                         {desc} | ||||
|                     </p> | ||||
|                 </div> | ||||
|             </div> | ||||
|         ); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										13
									
								
								src/components/auth/SignIn.jsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/components/auth/SignIn.jsx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| import React, { Component } from 'react'; | ||||
|  | ||||
| // 0.5s cubic-bezier(0.075, 0.82, 0.165, 1) | ||||
|  | ||||
| export default class SignIn extends Component { | ||||
|     render() { | ||||
|         return ( | ||||
|             <div> | ||||
|                 Hello World | ||||
|             </div> | ||||
|         ); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										18
									
								
								src/components/userBar/UserBar.jsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/components/userBar/UserBar.jsx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| import React, { Component } from 'react'; | ||||
|  | ||||
| import { Link } from 'react-router'; | ||||
| import { FormattedMessage as Message } from 'react-intl'; | ||||
|  | ||||
| import messages from './UserBar.messages.js'; | ||||
|  | ||||
| export default class UserBar extends Component { | ||||
|     render() { | ||||
|         return ( | ||||
|             <div> | ||||
|                 <Link to="/register"> | ||||
|                     <Message {...messages.register} /> | ||||
|                 </Link> | ||||
|             </div> | ||||
|         ); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										8
									
								
								src/components/userBar/UserBar.messages.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/components/userBar/UserBar.messages.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| import { defineMessages } from 'react-intl'; | ||||
|  | ||||
| export default defineMessages({ | ||||
|     register: { | ||||
|         id: 'register', | ||||
|         defaultMessage: 'Join' | ||||
|     } | ||||
| }); | ||||
| @@ -9,7 +9,7 @@ | ||||
| </head> | ||||
| <body> | ||||
|  | ||||
| <div id="app"></div> | ||||
| <div id="app" class="app"></div> | ||||
|  | ||||
| </body> | ||||
| </html> | ||||
|   | ||||
| @@ -20,6 +20,8 @@ import { IntlProvider } from 'react-intl'; | ||||
| import reducers from 'reducers'; | ||||
| import routes from 'routes'; | ||||
|  | ||||
| import 'index.scss'; | ||||
|  | ||||
| const reducer = combineReducers({ | ||||
|     ...reducers, | ||||
|     routing: routeReducer | ||||
|   | ||||
| @@ -1,3 +1,7 @@ | ||||
| .testClass { | ||||
|     background: #f00; | ||||
| html, | ||||
| body, | ||||
| :global(.app) { | ||||
|     height: 100%; | ||||
|     margin: 0; | ||||
|     padding: 0; | ||||
| } | ||||
|   | ||||
							
								
								
									
										26
									
								
								src/pages/auth/SignInPage.jsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/pages/auth/SignInPage.jsx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| import React, { Component } from 'react'; | ||||
|  | ||||
| import SignIn from 'components/auth/SignIn'; | ||||
| import AppInfo from 'components/auth/AppInfo'; | ||||
|  | ||||
| import styles from './auth.scss'; | ||||
|  | ||||
| export default class SignInPage extends Component { | ||||
|     render() { | ||||
|         var appInfo = { | ||||
|             name: 'TLauncher', | ||||
|             desc: `Лучший альтернативный лаунчер для Minecraft с большим количеством версий и их модификаций, а также возмоностью входа как с лицензионным аккаунтом, так и без него.` | ||||
|         }; | ||||
|  | ||||
|         return ( | ||||
|             <div> | ||||
|                 <div className={styles.sidebar}> | ||||
|                     <AppInfo {...appInfo} /> | ||||
|                 </div> | ||||
|                 <div className={styles.content}> | ||||
|                     <SignIn /> | ||||
|                 </div> | ||||
|             </div> | ||||
|         ); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										13
									
								
								src/pages/auth/auth.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/pages/auth/auth.scss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| .sidebar { | ||||
|     position: absolute; | ||||
|     top: 0; | ||||
|     bottom: 0; | ||||
|     left: 0; | ||||
|     width: 300px; | ||||
|  | ||||
|     background: #232323; | ||||
| } | ||||
|  | ||||
| .content { | ||||
|     margin-left: 300px; | ||||
| } | ||||
							
								
								
									
										11
									
								
								src/pages/index/IndexPage.jsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/pages/index/IndexPage.jsx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| import React, { Component } from 'react'; | ||||
|  | ||||
| import SignInPage from 'pages/auth/SignInPage'; | ||||
|  | ||||
| export default class IndexPage extends Component { | ||||
|     render() { | ||||
|         return ( | ||||
|             <SignInPage /> | ||||
|         ); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										29
									
								
								src/pages/root/RootPage.jsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								src/pages/root/RootPage.jsx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| import React from 'react'; | ||||
|  | ||||
| import { Link } from 'react-router'; | ||||
|  | ||||
| import UserBar from 'components/userBar/UserBar'; | ||||
|  | ||||
| import styles from './root.scss'; | ||||
|  | ||||
| export default function RootPage(props) { | ||||
|     return ( | ||||
|         <div className={styles.root}> | ||||
|             <div className={styles.header}> | ||||
|                 <div className={styles.headerContent}> | ||||
|                     <div className={styles.logo}> | ||||
|                         <Link to="/"> | ||||
|                             Ely.by | ||||
|                         </Link> | ||||
|                     </div> | ||||
|                     <div className={styles.userbar}> | ||||
|                         <UserBar /> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|             <div className={styles.body}> | ||||
|                 {props.children} | ||||
|             </div> | ||||
|         </div> | ||||
|     ); | ||||
| } | ||||
							
								
								
									
										52
									
								
								src/pages/root/root.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								src/pages/root/root.scss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,52 @@ | ||||
| .root { | ||||
|     background: #ebe8e1; | ||||
|     min-height: 100%; | ||||
| } | ||||
|  | ||||
| .wrapper { | ||||
|     width: 736px; | ||||
|     margin: 0 auto; | ||||
| } | ||||
|  | ||||
| .header { | ||||
|     height: 50px; | ||||
|     background: #207e5c; | ||||
| } | ||||
|  | ||||
| .headerContent { | ||||
|     composes: wrapper; | ||||
| } | ||||
|  | ||||
| .logo { | ||||
|     line-height: 50px; | ||||
|     padding: 0 20px; | ||||
|     display: inline-block; | ||||
|     background: #1a6449; | ||||
| } | ||||
|  | ||||
| .body { | ||||
|     composes: wrapper; | ||||
|     position: absolute; | ||||
|     top: 50px; | ||||
|     left: 0; | ||||
|     right: 0; | ||||
|     bottom: 0; | ||||
| } | ||||
|  | ||||
| .sidebar { | ||||
|     position: absolute; | ||||
|     top: 0; | ||||
|     bottom: 0; | ||||
|     left: 0; | ||||
|     width: 300px; | ||||
|  | ||||
|     background: #232323; | ||||
| } | ||||
|  | ||||
| .content { | ||||
|     margin-left: 300px; | ||||
| } | ||||
|  | ||||
| .userbar { | ||||
|     float: right; | ||||
| } | ||||
| @@ -1,47 +1,13 @@ | ||||
| import React from 'react'; | ||||
| import { Route, IndexRoute } from 'react-router'; | ||||
| import { Link } from 'react-router'; | ||||
|  | ||||
| import { FormattedMessage } from 'react-intl'; | ||||
|  | ||||
| import styles from 'index.scss'; | ||||
|  | ||||
| function CoreLayout(props) { | ||||
|     return ( | ||||
|         <div> | ||||
|             <FormattedMessage | ||||
|                 id="greeting" | ||||
|                 description="Welcome greeting to the user" | ||||
|                 defaultMessage="Hello, {name}! How are you today?" | ||||
|                 values={{name: 'World'}} | ||||
|             /> | ||||
|  | ||||
|             {props.children} | ||||
|         </div> | ||||
|     ); | ||||
| } | ||||
|  | ||||
| function HomeView() { | ||||
|     return ( | ||||
|         <div> | ||||
|             Home! | ||||
|             <Link className={styles.testClass} to="/auth">Auth</Link> | ||||
|         </div> | ||||
|     ); | ||||
| } | ||||
|  | ||||
| function AuthView() { | ||||
|     return ( | ||||
|         <div> | ||||
|             Auth! | ||||
|             <Link to="/">Home</Link> | ||||
|         </div> | ||||
|     ); | ||||
| } | ||||
| import RootPage from 'pages/root/RootPage'; | ||||
| import IndexPage from 'pages/index/IndexPage'; | ||||
| import SignInPage from 'pages/auth/SignInPage'; | ||||
|  | ||||
| export default ( | ||||
|   <Route path="/" component={CoreLayout}> | ||||
|     <IndexRoute component={HomeView} /> | ||||
|     <Route path="/auth" component={AuthView} /> | ||||
|   <Route path="/" component={RootPage}> | ||||
|     <IndexRoute component={IndexPage} /> | ||||
|     <Route path="/signin" component={SignInPage} /> | ||||
|   </Route> | ||||
| ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user