Add user name to navigation drawer
This commit is contained in:
parent
69a1ea55ff
commit
6eaa79493e
17
src/classes/User.js
Normal file
17
src/classes/User.js
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
Denna klass är en modell för användare.
|
||||
|
||||
name : String (Användarnamn)
|
||||
deviceId : Int (Enhetens ID)
|
||||
location : Coordinates (Användarens koordinater)
|
||||
*/
|
||||
|
||||
class User {
|
||||
constructor(name, deviceId, location) {
|
||||
this.name = name;
|
||||
this.deviceId = deviceId;
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
|
||||
export default User;
|
@ -1,6 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import './css/NavigationDrawer.css';
|
||||
|
||||
import globalData from '../GlobalData.js';
|
||||
import DisruptionButton from "./DisruptionButton.js";
|
||||
|
||||
import userIcon from '../img/user.svg';
|
||||
@ -36,7 +37,7 @@ class NavigationDrawer extends Component {
|
||||
<div id="navDrawer" className={`${this.state.open ? "open" : ""}`}>
|
||||
<header>
|
||||
<img src={userIcon} alt="" />
|
||||
<span>Mitt konto</span>
|
||||
<span>{globalData.user.name}</span>
|
||||
<span>example@gmail.com</span>
|
||||
</header>
|
||||
<div id="navList">
|
||||
|
Loading…
Reference in New Issue
Block a user