feat: disable firebase temp

This commit is contained in:
Hasta Ragil Saputra 2019-01-31 13:44:38 +07:00
parent 5023788030
commit 2087b2d567
5 changed files with 45 additions and 45 deletions

View File

@ -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: <a href={'inbox/'}>{payload.notification.title}</a>, // 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: <a href={'inbox/'}>{payload.notification.title}</a>, // 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(

View File

@ -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 {
<CartIcon />
</Badge>
</IconButton>) : "" }
<IconButton color="action">
<Badge badgeContent={17} color="secondary">
<NotificationsIcon />
@ -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")}>
<Icon type="environment"/><span className="hide-on-small-only">{this.user.userGeolocation.ip}</span>
</Button>
</Button>
<Link onClick={this
.changeRoute
@ -683,7 +683,7 @@ class App extends React.Component {
.changeRoute
.bind(this, '/app/shop')} to={LINKS.ITEMS}><MenuItem
className={(this.state.selectedMenu === '/app/shop') ? "menuAkunItem active" : 'menuAkunItem'}><span
className="menuAkun">Shop</span></MenuItem></Link>
className="menuAkun">Shop</span></MenuItem></Link>
<Link onClick={this
.changeRoute
@ -691,7 +691,7 @@ class App extends React.Component {
to={LINKS.VOUCHERS}
><MenuItem
className={(this.state.selectedMenu === '/app/vouchers') ? "menuAkunItem active" : 'menuAkunItem'}><span
className="menuAkun">Vouchers</span></MenuItem></Link>
className="menuAkun">Vouchers</span></MenuItem></Link>
<Button className="toolbar-button-sysinfo hide-on-small-only" size="small" type="dashed"
style={{marginRight: (window.innerWidth < 600) ? 2 : 10}}
@ -704,7 +704,7 @@ class App extends React.Component {
onClick={() => this.openNotification(null, "System Information", "This is your computer locale timezone", "home")}>
<Icon type="home"/> <span
className="hide-on-small-only">{this.user.userGeolocation.latitude}, {this.user.userGeolocation.longitude}</span>
</Button>
</Button>
</ToolbarGroup>
<ToolbarGroup>
@ -902,4 +902,4 @@ class App extends React.Component {
}
}
export default withStyles(styles)(App);
export default withStyles(styles)(App);

View File

@ -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';

View File

@ -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);

View File

@ -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);
});
}
}