diff --git a/src/client/index.js b/src/client/index.js index 8734558..ccc985d 100644 --- a/src/client/index.js +++ b/src/client/index.js @@ -22,10 +22,10 @@ import Routes from '../common/routes'; import RootComponent from "../common/pages/Root"; import { LocaleProvider } from 'antd'; import enUS from 'antd/lib/locale-provider/en_US'; -import {getMobileOperatingSystem} from "../common/stores/firebase"; +// import {getMobileOperatingSystem} from "../common/stores/firebase"; import cinnamonSugar from "cinnamon-sugar"; import ButterToast from "butter-toast"; -import * as firebase from "firebase"; +// import * as firebase from "firebase"; // var injectTapEventPlugin = require("react-tap-event-plugin"); // injectTapEventPlugin(); @@ -40,31 +40,31 @@ const appstate = new AppState(Object.assign({ // if (getMobileOperatingSystem() !== 'iOS') { - firebase.messaging().onMessage((payload) => { - console.log("Message received cok.", payload); - // alert(payload.notification.body); - - if(payload.data.new_message){ - appstate.message.pushNewMessage(payload.data); - } - - if(payload.data.notification_type == 'notification'){ - appstate.notification.unread_notif+=1 - } - const toast = cinnamonSugar({ - kind: 'crisp', - theme: 'info', - // picture: 'http://lorempixel.com/150/150/people', - title: {payload.notification.title}, // you can also add jsx code here! - // message: JSON.stringify(payload), // you can also add jsx code here! - message: payload.notification.body, // you can also add jsx code here! - toastTimeout: 4000, - icon: 'bell' // literally any font awesome 4.7 icon - // you may also add here regular butter-toast options, such as toastTimeout, - // name, sticky, etc.. - }); - ButterToast.raise(toast) - }); +// firebase.messaging().onMessage((payload) => { +// console.log("Message received cok.", payload); +// // alert(payload.notification.body); +// +// if(payload.data.new_message){ +// appstate.message.pushNewMessage(payload.data); +// } +// +// if(payload.data.notification_type == 'notification'){ +// appstate.notification.unread_notif+=1 +// } +// const toast = cinnamonSugar({ +// kind: 'crisp', +// theme: 'info', +// // picture: 'http://lorempixel.com/150/150/people', +// title: {payload.notification.title}, // you can also add jsx code here! +// // message: JSON.stringify(payload), // you can also add jsx code here! +// message: payload.notification.body, // you can also add jsx code here! +// toastTimeout: 4000, +// icon: 'bell' // literally any font awesome 4.7 icon +// // you may also add here regular butter-toast options, such as toastTimeout, +// // name, sticky, etc.. +// }); +// ButterToast.raise(toast) +// }); // } render( diff --git a/src/common/pages/App/index.js b/src/common/pages/App/index.js index a3bd293..3548395 100644 --- a/src/common/pages/App/index.js +++ b/src/common/pages/App/index.js @@ -28,10 +28,10 @@ import { Paper, Dialog, Snackbar, - // Toolbar, - // ToolbarGroup, - // ToolbarSeparator, - // ToolbarTitle, + // Toolbar, + // ToolbarGroup, + // ToolbarSeparator, + // ToolbarTitle, // Badge } from 'material-ui'; import IconUserCircle from 'material-ui/svg-icons/action/account-circle'; @@ -46,7 +46,7 @@ import cinnamonSugar from 'cinnamon-sugar'; import ButterToast from 'butter-toast'; import 'material-design-icons/iconfont/material-icons.css'; import { grey400, darkBlack, lightBlack } from 'material-ui/styles/colors'; -import { getMobileOperatingSystem } from '../../stores/firebase'; +// import { getMobileOperatingSystem } from '../../stores/firebase'; import Alert from "../../components/Alert"; import EmptyComponent from '../EmptyComponent'; import NumberFormat from 'react-number-format'; @@ -588,7 +588,7 @@ class App extends React.Component { ) : "" } - + @@ -653,7 +653,7 @@ class App extends React.Component { style={{marginRight: (window.innerWidth < 600) ? 2 : 10}} onClick={() => this.openNotification(null, "System Information", "This is your computer locale timezone", "environment")}> {this.user.userGeolocation.ip} - + Shop + className="menuAkun">Shop Vouchers + className="menuAkun">Vouchers + @@ -902,4 +902,4 @@ class App extends React.Component { } } -export default withStyles(styles)(App); \ No newline at end of file +export default withStyles(styles)(App); diff --git a/src/common/pages/ForgotPassword/index.js b/src/common/pages/ForgotPassword/index.js index ebbb18e..94e69c8 100644 --- a/src/common/pages/ForgotPassword/index.js +++ b/src/common/pages/ForgotPassword/index.js @@ -4,7 +4,7 @@ import {inject, observer} from 'mobx-react'; import './style.scss' import {LINKS} from "../../routes"; -import {getMobileOperatingSystem} from '../../stores/firebase'; +// import {getMobileOperatingSystem} from '../../stores/firebase'; import {Helmet} from "react-helmet"; import LoadingDialog from '../LoadingDialog/index'; diff --git a/src/common/stores/appstate.js b/src/common/stores/appstate.js index 23a05bf..8a87c0f 100644 --- a/src/common/stores/appstate.js +++ b/src/common/stores/appstate.js @@ -23,7 +23,7 @@ import DepositStore from "./deposit"; import WithdrawStore from "./withdraw"; import Task from './task'; import Transaction from './transaction'; -import {Firebase} from './firebase'; +// import {Firebase} from './firebase'; import AirlinesDomestic from "./airlines_domestic"; import Airports from "./airports"; import Categories from './categories'; @@ -102,7 +102,7 @@ export default class AppState { task = new Task(this); transaction = new Transaction(this); setting = new Setting(this); - firebase = new Firebase(this); + // firebase = new Firebase(this); userBanks = new UserBanks(this); stores = new Stores(this); storeList = new StoreList(this); diff --git a/src/common/stores/firebase.js b/src/common/stores/firebase.js index 804c29d..ada75db 100644 --- a/src/common/stores/firebase.js +++ b/src/common/stores/firebase.js @@ -1,7 +1,7 @@ /** * Created by 322 on 01/04/2017. */ -import * as firebase from "firebase"; +// import * as firebase from "firebase"; import {observable, action, computed} from 'mobx'; export function getMobileOperatingSystem() { @@ -44,8 +44,8 @@ export class Firebase { storageBucket: "cerdas-fc4a2.appspot.com", messagingSenderId: "192592024837" }; - firebase.initializeApp(config); - const messaging = firebase.messaging(); + // firebase.initializeApp(config); + // const messaging = firebase.messaging(); messaging.requestPermission() .then(function() { console.log('Notification permission granted.'); @@ -56,7 +56,7 @@ export class Firebase { console.log('Unable to get permission to notify.', err); }); - + } }