Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions artifacts/assorted-jaeger.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Working on UI and a few pieces of functionality.

## Project Specs
- [ ] [Issue #90:](https://github.com/GuildCrafts/noob/issues/90) Tasks should be sorted according to title
- [ ] [Issue #86:](https://github.com/GuildCrafts/noob/issues/86) Add a link to file an issue in the footer
- [x] [Issue #90:](https://github.com/GuildCrafts/noob/issues/90) Tasks should be sorted according to title
- [x] [Issue #86:](https://github.com/GuildCrafts/noob/issues/86) Add a link to file an issue in the footer
- [ ] [Issue #85:](https://github.com/GuildCrafts/noob/issues/85) Add an estimated completion time to template tasks and tasks
- [ ] [Issue #78:](https://github.com/GuildCrafts/noob/issues/78) Create a header for Newbie

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"json-loader": "^0.5.4",
"knex": "^0.12.6",
"lodash": "^4.17.4",
"md5": "^2.2.1",
"mocha": "^3.2.0",
"moment": "^2.17.1",
"morgan": "~1.7.0",
Expand Down
20 changes: 20 additions & 0 deletions src/browser/components/atoms/Userimage/userImage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React, { Component } from 'react'
import styles from './userimage.css'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where are you using the styles variable? If not just do import './userimage.css'

import md5 from 'md5'

export default class UserImage extends Component {
emailHash(){

if(this.props.user !== undefined) {
return md5(this.props.user.email)
} else {
return ''
}
}

render() {
return (
<img className='user-image' src={`https://gravatar.com/avatar/${this.emailHash()}`} />
)
}
}
4 changes: 4 additions & 0 deletions src/browser/components/atoms/Userimage/userimage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.user-image {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you move the classname as I suggested above you could change this to .user-image > img {

width: 50px;
height: 50px;
}
2 changes: 2 additions & 0 deletions src/browser/components/molecules/Navbar/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.Navbar {
font-family: inherit;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these styles are indented 4 instead of 2 spaces.

font-size: 30px;
display: flex;
flex-direction: row;
justify-content: space-between;
Expand Down
10 changes: 7 additions & 3 deletions src/browser/components/molecules/Navbar/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React, { Component } from 'react'
import styles from './index.css'
import UserImage from '../../atoms/Userimage/userimage'

export default class Navbar extends Component {
render() {
return (<div className={styles.Navbar}>
This is the navbar
</div>)
const {user} = this.props

return <div className={styles.Navbar}>
Newbie
<UserImage user={user} />
</div>
}
}
7 changes: 5 additions & 2 deletions src/browser/components/pages/Dashboard/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react'
import Layout from '../../molecules/Layout/index'
import styles from './index.css'
import Navbar from '../../molecules/Navbar/index'
import GenericDashboard from '../GenericDashboard/index'
import MentorDashboard from '../MentorDashboard/index'
import NewbieDashboard from '../NewbieDashboard/index'
Expand All @@ -23,13 +24,14 @@ export default class Dashboard extends Component {
}),
credentials: 'same-origin'
}

fetch('/api/users/current_user', options)
.then( response => {
return response.json()
})
.then( user => {
this.setState({user: user})
});
this.setState({ user })
})
}

chooseDashboardJSX(user){
Expand All @@ -55,6 +57,7 @@ export default class Dashboard extends Component {
console.log('state:', this.state)
return (
<Layout>
<Navbar user={this.state.user} />
{this.chooseDashboardJSX(this.state.user)}
</Layout>
)
Expand Down