@@ -3,8 +3,10 @@
"version": "0.1.0",
"private": true,
"dependencies": {
+ "antd": "^3.11.2",
"react": "^16.6.3",
"react-dom": "^16.6.3",
+ "react-router-dom": "^4.3.1",
"react-scripts": "2.1.1"
},
"scripts": {
@@ -0,0 +1,20 @@
+import React, { Component } from 'react';
+import { Link } from "react-router-dom";
+import { Avatar } from 'antd';
+class Auth extends Component {
+ render() {
+ return (
+ <div className="auth">
+ <div className="avatar">
+ <Avatar icon="user" style={{ backgroundColor: '#1890ff' }}/>
+ </div>
+ <div>
+ <Link to="/auth">Мой профиль</Link>
+
+ );
+ }
+}
+export default Auth;
@@ -0,0 +1,19 @@
+import {Switch, Route} from 'react-router-dom';
+import HeaderLogo from '../Header/logo'
+import SearchLine from '../Header/searchLine'
+import Auth from '../Header/auth'
+import 'antd/dist/antd.css';
+class Header extends Component {
+ <div className="header">
+ <HeaderLogo />
+ <SearchLine/>
+ <Auth/>
+export default Header;
@@ -0,0 +1,13 @@
+import logo from '../../img/logoBazar.png'
+class HeaderLogo extends Component {
+ <div className="logo">
+ <img src={logo} alt="Logo" />
+export default HeaderLogo;
+import { Input } from 'antd';
+const Search = Input.Search;
+class SearchLine extends Component {
+ <div className="searchLine">
+ <Search className="searchInput"
+ placeholder="input search text"
+ onSearch={value => console.log(value)}
+ enterButton
+ />
+export default SearchLine;
@@ -1,12 +1,11 @@
import React, { Component } from 'react';
-import logo from './logo.svg';
-import './App.css';
+import Header from '../components/Header'
class App extends Component {
render() {
return (
<div>
- start
+ <Header/>
</div>
);
}
@@ -12,3 +12,31 @@ code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
+.logo{
+ width: 20%;
+.header{
+ display:flex;
+.searchLine{
+ width: 60%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+.searchInput{
+ width: 80%;
+.auth{
+.avatar{
+ padding: 0 10px;
@@ -1,10 +1,18 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
-import App from './App';
+import App from '../src/container/App';
import * as serviceWorker from './serviceWorker';
+import { BrowserRouter } from "react-router-dom";
+import Router from "./router";
+ReactDOM.render(
+ <BrowserRouter>
+ <Router />
+ </BrowserRouter>
+,
+document.getElementById("root")
+);
-ReactDOM.render(<App />, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
@@ -0,0 +1,9 @@
+import React from "react";
+import { Switch, Route } from "react-router-dom";
+import App from "./container/App";
+export default () => (
+ <Switch>
+ <Route path="/" exact component={App} />
+ </Switch>