Add user name to navigation drawer
This commit is contained in:
parent
093199d0e0
commit
051afedcc5
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 React, { Component } from 'react';
|
||||||
import './css/NavigationDrawer.css';
|
import './css/NavigationDrawer.css';
|
||||||
|
|
||||||
|
import globalData from '../GlobalData.js';
|
||||||
import DisruptionButton from "./DisruptionButton.js";
|
import DisruptionButton from "./DisruptionButton.js";
|
||||||
|
|
||||||
import userIcon from '../img/user.svg';
|
import userIcon from '../img/user.svg';
|
||||||
@ -36,7 +37,7 @@ class NavigationDrawer extends Component {
|
|||||||
<div id="navDrawer" className={`${this.state.open ? "open" : ""}`}>
|
<div id="navDrawer" className={`${this.state.open ? "open" : ""}`}>
|
||||||
<header>
|
<header>
|
||||||
<img src={userIcon} alt="" />
|
<img src={userIcon} alt="" />
|
||||||
<span>Mitt konto</span>
|
<span>{globalData.user.name}</span>
|
||||||
<span>example@gmail.com</span>
|
<span>example@gmail.com</span>
|
||||||
</header>
|
</header>
|
||||||
<div id="navList">
|
<div id="navList">
|
||||||
|
Loading…
Reference in New Issue
Block a user