Skip to content

Commit

Permalink
Remove it for now
Browse files Browse the repository at this point in the history
  • Loading branch information
hlcfan committed Jun 7, 2017
1 parent 1d38df0 commit cf52b3f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 58 deletions.
22 changes: 0 additions & 22 deletions client/app/bundles/Room/components/ActionBox/ActionBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import EventEmitter from 'libs/eventEmitter'
import update from 'immutability-helper'
import RoomActions from 'libs/roomActions'
import {defaultTourColor} from 'libs/barColors'
import floating from 'floating.js'

export default class ActionBox extends React.Component {
constructor(props){
Expand Down Expand Up @@ -83,29 +82,8 @@ export default class ActionBox extends React.Component {
EventEmitter.dispatch("showBoard")
}

handleConsensus = () => {
floating({
content: "🎉",
number: 4,
duration: 7,
repeat: 1,
direction: 'reverse',
size: [2, 4]
})

floating({
content: "🎊",
number: 3,
duration: 8,
repeat: 1,
direction: 'reverse',
size: [2, 4]
})
}

componentDidMount() {
EventEmitter.subscribe("resetActionBox", this.resetActionBox)
EventEmitter.subscribe("consensus", this.handleConsensus)
if (this.props.roomState !== "draw" && this.props.countDown > 0) {
this.intervalId = setInterval(this.timer, 1000)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ export default class ResultPanel extends React.Component {

constructor(props) {
super(props)
this.fromFlip = false
this.state = { data: [] }
}

componentDidMount = () => {
EventEmitter.subscribe("showResultPanel", (data) => {
if (data["fromFlip"]) {
this.fromFlip = true
}
this.setState({ data: data["value"] })
this.setState({ data: data })
})
}

Expand Down Expand Up @@ -61,14 +57,6 @@ export default class ResultPanel extends React.Component {
pointArray.push({ point, count, barWidth, color })
}

if (this.fromFlip &&
this.state.data.length >= 2 &&
pointArray.length === 1 &&
votedCount/this.state.data.length >= .75) {
EventEmitter.dispatch("consensus")
}
this.fromFlip = false

const pointBars = pointArray.map(
pointBar =>
<PointBar key={`${pointBar.point}-${pointBar.count}`}
Expand Down
11 changes: 2 additions & 9 deletions client/app/bundles/Room/components/PeopleListBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,14 @@ export default class PeopleListBox extends React.Component {

state = { data: [] }

loadPeopleListFromServer = (flip) => {
let newData;

loadPeopleListFromServer = () => {
$.ajax({
url: `/rooms/${this.props.roomId}/user_list.json?sync=${window.syncResult}`,
dataType: 'json',
cache: false,
success: data => {
this.setState({ data: data })
if (flip) {
newData = { value: data, fromFlip: true }
} else {
newData = { value: data }
}
EventEmitter.dispatch("showResultPanel", newData)
EventEmitter.dispatch("showResultPanel", data)
},
error: (xhr, status, err) => {
console.error("Fetching people list", status, err.toString());
Expand Down
2 changes: 1 addition & 1 deletion client/app/libs/actionCable.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
// console.dir(data)
if (data.type === 'action') {
if (data.data === 'open') {
RoomActions.flip()
RoomActions.showResultSection()
} else if (data.data === 'refresh-users') {
if ($("#u-" + data.user_id).length <= 0) {
EventEmitter.dispatch("refreshUsers")
Expand Down
6 changes: 1 addition & 5 deletions client/app/libs/roomActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export default {
showResultSection() {
window.syncResult = true
EventEmitter.dispatch("refreshUsers")
},

flip() {
window.syncResult = true
EventEmitter.dispatch("refreshUsers", true)
}

}
1 change: 0 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"expose-loader": "^0.7.3",
"extract-text-webpack-plugin": "^2.1.0",
"glob": "^7.1.1",
"floating.js": "^2.7.1",
"immutability-helper": "^2.2.0",
"imports-loader": "^0.7.1",
"purifycss-webpack": "^0.6.1",
Expand Down
10 changes: 3 additions & 7 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1369,10 +1369,6 @@ find-up@^2.0.0:
dependencies:
locate-path "^2.0.0"

floating.js@^2.7.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/floating.js/-/floating.js-2.7.1.tgz#f0c159fb0d99d8fc579732c121cda84c77c3da73"

for-in@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
Expand Down Expand Up @@ -2412,9 +2408,9 @@ react-joyride@^1.10.1:
react-autobind "^1.0"
scroll "^2.0"

react-on-rails@8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/react-on-rails/-/react-on-rails-8.0.1.tgz#92ca0e71542501c3bdd7f3ef2a315e83ba99433c"
react-on-rails@8.0.2:
version "8.0.2"
resolved "https://registry.yarnpkg.com/react-on-rails/-/react-on-rails-8.0.2.tgz#dd5b30553e4c3ee26d10fb847a6461a82362fb00"

react-transition-group@^1.1.3:
version "1.1.3"
Expand Down

0 comments on commit cf52b3f

Please sign in to comment.