瀏覽代碼

add toaster

itizawa 6 年之前
父節點
當前提交
c7b5c0338d
共有 1 個文件被更改,包括 10 次插入2 次删除
  1. 10 2
      src/client/js/components/Admin/Users/StatusActivateButton.jsx

+ 10 - 2
src/client/js/components/Admin/Users/StatusActivateButton.jsx

@@ -5,6 +5,7 @@ import { withTranslation } from 'react-i18next';
 import { createSubscribedElement } from '../../UnstatedUtils';
 import AppContainer from '../../../services/AppContainer';
 import AdminUsersContainer from '../../../services/AdminUsersContainer';
+import { toastSuccess, toastError } from '../../../util/apiNotification';
 
 class StatusActivateButton extends React.Component {
 
@@ -18,8 +19,15 @@ class StatusActivateButton extends React.Component {
     this.onClickAcceptBtn = this.onClickAcceptBtn.bind(this);
   }
 
-  onClickAcceptBtn() {
-    console.log('hello');
+  async onClickAcceptBtn() {
+    try {
+      // const username = await this.props.adminUsersContainer.removeUser(this.props.user._id);
+      const username = 'gest';
+      toastSuccess(`Accept ${username} success`);
+    }
+    catch (err) {
+      toastError(err);
+    }
   }
 
   render() {