Skip to content
This repository was archived by the owner on Feb 7, 2020. It is now read-only.

Derrick branch 2 #75

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"object-path-immutable": "^1.0.1",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-geolocated": "^2.4.0",
"react-linkify": "^0.2.2",
"react-scripts": "next",
"vuid": "^1.0.0"
Expand Down
31 changes: 18 additions & 13 deletions src/components/UserList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@ import React from 'react'
import style from './index.module.css'

export const UserList = ({ room, current, createConvo, removeUser }) => (
<ul className={style.component}>
{room.users.map(user => (
<li
key={user.id}
className={user.presence.state === 'online' ? style.online : null}
onClick={e => createConvo({ user })}
style={{ order: user.presence.state === 'online' && -1 }}
>
<img src={user.avatarURL} alt={user.name} />
<p>{user.name}</p>
</li>
))}
</ul>
<div>
Copy link
Contributor

Choose a reason for hiding this comment

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

need to correct tab indentation looks like the open and close divs do not match

<button onClick={e => removeUser(room)}>
<span>Leave Room</span>
</button>
<ul className={style.component}>
{room.users.map(user => (
<li
key={user.id}
className={user.presence.state === 'online' ? style.online : null}
onClick={e => createConvo({ user })}
style={{ order: user.presence.state === 'online' && -1 }}
>
<img src={user.avatarURL} alt={user.name} />
<p>{user.name}</p>
</li>
))}
</ul>
</div>
)
25 changes: 25 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { geolocated } from 'react-geolocated';
import { set, del } from 'object-path-immutable'
import { version } from '../package.json'
import './index.css'
Expand Down Expand Up @@ -249,6 +250,23 @@ class View extends React.Component {
/>
<TypingIndicator typing={typing[room.id]} />
<CreateMessageForm state={this.state} actions={this.actions} />
{
Copy link
Contributor

Choose a reason for hiding this comment

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

same here indentation needs to match the rest of the file. file is using 2 spaces to indent

!this.props.isGeolocationAvailable
? <div>Your browser does not support Geolocation</div>
: !this.props.isGeolocationEnabled
? <div>Geolocation is not enabled</div>
: this.props.coords
? <table>
<tbody>
<tr><td>latitude</td><td>{this.props.coords.latitude}</td></tr>
<tr><td>longitude</td><td>{this.props.coords.longitude}</td></tr>
<tr><td>altitude</td><td>{this.props.coords.altitude}</td></tr>
<tr><td>heading</td><td>{this.props.coords.heading}</td></tr>
<tr><td>speed</td><td>{this.props.coords.speed}</td></tr>
</tbody>
</table>
: <div>Getting the location data&hellip; </div>
}
</col->
{userListOpen && (
<UserList
Expand Down Expand Up @@ -293,3 +311,10 @@ const githubAuthRedirect = () => {
!existingUser && !authCode
? githubAuthRedirect()
: ReactDOM.render(<View />, document.querySelector('#root'))

export default geolocated({
positionOptions: {
enableHighAccuracy: false,
},
userDecisionTimeout: 5000,
})(View);