Commit 487858b2 authored by Alexander Kotov's avatar Alexander Kotov

add header component

parent 29b5cf99
import React, { Component } from 'react';
import './App.css';
import Header from './components/Header'
class App extends Component {
user = {
name: 'Alexander Kotov'
}
render() {
return (
<div id="chat">
<header>
<div class="user">
<img src="" alt="" />
<span class="name">Alexander Kotov</span>
</div>
<button class="logout" onclick="logout()">Logout</button>
</header>
<Header user={this.user} />
<div id="messages">
<div class="message">
<img src="" alt="" />
......
import React from 'react'
const Header = (props) => {
return (
<header>
<div className="user">
<img src="" alt="" />
<span className="name">{props.user.name}</span>
</div>
<button className="logout" onclick="logout()">Logout</button>
</header>
)
}
export default Header
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment