diff --git a/public/react/src/modules/page/main/LeftViewContainer.js b/public/react/src/modules/page/main/LeftViewContainer.js index 6b657f28..91fd28bf 100644 --- a/public/react/src/modules/page/main/LeftViewContainer.js +++ b/public/react/src/modules/page/main/LeftViewContainer.js @@ -2,8 +2,6 @@ import React, { Component } from 'react'; import LeftView from './LeftView' -import Snackbar from 'material-ui/Snackbar'; - import axios from 'axios' import update from 'immutability-helper' @@ -45,7 +43,7 @@ class LeftViewContainer extends Component { tabIndex: 0, dialogOpen: false, gameAnswer: '', - snackbarOpen: false, + is_teacher: false, // 评论 @@ -253,11 +251,6 @@ class LeftViewContainer extends Component { dialogOpen: false }) } - handleRequestClose = () => { - this.setState({ - snackbarOpen: false, - }); - }; fetchIfCouldGetAnswerWithoutGold() { // 查看是否有权限直接查看,true可以直接查看,false需要扣金币查看 var getAnswerUrl = `/api/v1/games/${this.props.game.identifier}/answer`; @@ -268,10 +261,7 @@ class LeftViewContainer extends Component { .then((response) => { if (response.data.status == 0) { - this.setState({ - snackbarOpen: true, - snackbarText: response.data.message - }) + this.props.showSnackbar(response.data.message) return; } /* @@ -372,10 +362,7 @@ class LeftViewContainer extends Component { // {message: "您没有足够的金币", status: -1} if (response.data.status == 0) { - this.setState({ - snackbarOpen: true, - snackbarText: response.data.message - }) + this.props.showSnackbar(response.data.message) return; } if (response.data.status == -1) { @@ -411,12 +398,6 @@ class LeftViewContainer extends Component { -