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 RootComponent from "../common/pages/Root";
import { LocaleProvider } from 'antd'; import { LocaleProvider } from 'antd';
import enUS from 'antd/lib/locale-provider/en_US'; 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 cinnamonSugar from "cinnamon-sugar";
import ButterToast from "butter-toast"; import ButterToast from "butter-toast";
import * as firebase from "firebase"; // import * as firebase from "firebase";
// var injectTapEventPlugin = require("react-tap-event-plugin"); // var injectTapEventPlugin = require("react-tap-event-plugin");
// injectTapEventPlugin(); // injectTapEventPlugin();
@ -40,31 +40,31 @@ const appstate = new AppState(Object.assign({
// if (getMobileOperatingSystem() !== 'iOS') { // if (getMobileOperatingSystem() !== 'iOS') {
firebase.messaging().onMessage((payload) => { // firebase.messaging().onMessage((payload) => {
console.log("Message received cok.", payload); // console.log("Message received cok.", payload);
// alert(payload.notification.body); // // alert(payload.notification.body);
//
if(payload.data.new_message){ // if(payload.data.new_message){
appstate.message.pushNewMessage(payload.data); // appstate.message.pushNewMessage(payload.data);
} // }
//
if(payload.data.notification_type == 'notification'){ // if(payload.data.notification_type == 'notification'){
appstate.notification.unread_notif+=1 // appstate.notification.unread_notif+=1
} // }
const toast = cinnamonSugar({ // const toast = cinnamonSugar({
kind: 'crisp', // kind: 'crisp',
theme: 'info', // theme: 'info',
// picture: 'http://lorempixel.com/150/150/people', // // picture: 'http://lorempixel.com/150/150/people',
title: <a href={'inbox/'}>{payload.notification.title}</a>, // you can also add jsx code here! // 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: JSON.stringify(payload), // you can also add jsx code here!
message: payload.notification.body, // you can also add jsx code here! // message: payload.notification.body, // you can also add jsx code here!
toastTimeout: 4000, // toastTimeout: 4000,
icon: 'bell' // literally any font awesome 4.7 icon // icon: 'bell' // literally any font awesome 4.7 icon
// you may also add here regular butter-toast options, such as toastTimeout, // // you may also add here regular butter-toast options, such as toastTimeout,
// name, sticky, etc.. // // name, sticky, etc..
}); // });
ButterToast.raise(toast) // ButterToast.raise(toast)
}); // });
// } // }
render( render(

View File

@ -28,10 +28,10 @@ import {
Paper, Paper,
Dialog, Dialog,
Snackbar, Snackbar,
// Toolbar, // Toolbar,
// ToolbarGroup, // ToolbarGroup,
// ToolbarSeparator, // ToolbarSeparator,
// ToolbarTitle, // ToolbarTitle,
// Badge // Badge
} from 'material-ui'; } from 'material-ui';
import IconUserCircle from 'material-ui/svg-icons/action/account-circle'; 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 ButterToast from 'butter-toast';
import 'material-design-icons/iconfont/material-icons.css'; import 'material-design-icons/iconfont/material-icons.css';
import { grey400, darkBlack, lightBlack } from 'material-ui/styles/colors'; 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 Alert from "../../components/Alert";
import EmptyComponent from '../EmptyComponent'; import EmptyComponent from '../EmptyComponent';
import NumberFormat from 'react-number-format'; import NumberFormat from 'react-number-format';
@ -588,7 +588,7 @@ class App extends React.Component {
<CartIcon /> <CartIcon />
</Badge> </Badge>
</IconButton>) : "" } </IconButton>) : "" }
<IconButton color="action"> <IconButton color="action">
<Badge badgeContent={17} color="secondary"> <Badge badgeContent={17} color="secondary">
<NotificationsIcon /> <NotificationsIcon />
@ -653,7 +653,7 @@ class App extends React.Component {
style={{marginRight: (window.innerWidth < 600) ? 2 : 10}} style={{marginRight: (window.innerWidth < 600) ? 2 : 10}}
onClick={() => this.openNotification(null, "System Information", "This is your computer locale timezone", "environment")}> 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> <Icon type="environment"/><span className="hide-on-small-only">{this.user.userGeolocation.ip}</span>
</Button> </Button>
<Link onClick={this <Link onClick={this
.changeRoute .changeRoute
@ -683,7 +683,7 @@ class App extends React.Component {
.changeRoute .changeRoute
.bind(this, '/app/shop')} to={LINKS.ITEMS}><MenuItem .bind(this, '/app/shop')} to={LINKS.ITEMS}><MenuItem
className={(this.state.selectedMenu === '/app/shop') ? "menuAkunItem active" : 'menuAkunItem'}><span 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 <Link onClick={this
.changeRoute .changeRoute
@ -691,7 +691,7 @@ class App extends React.Component {
to={LINKS.VOUCHERS} to={LINKS.VOUCHERS}
><MenuItem ><MenuItem
className={(this.state.selectedMenu === '/app/vouchers') ? "menuAkunItem active" : 'menuAkunItem'}><span 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" <Button className="toolbar-button-sysinfo hide-on-small-only" size="small" type="dashed"
style={{marginRight: (window.innerWidth < 600) ? 2 : 10}} 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")}> onClick={() => this.openNotification(null, "System Information", "This is your computer locale timezone", "home")}>
<Icon type="home"/> <span <Icon type="home"/> <span
className="hide-on-small-only">{this.user.userGeolocation.latitude}, {this.user.userGeolocation.longitude}</span> className="hide-on-small-only">{this.user.userGeolocation.latitude}, {this.user.userGeolocation.longitude}</span>
</Button> </Button>
</ToolbarGroup> </ToolbarGroup>
<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 './style.scss'
import {LINKS} from "../../routes"; import {LINKS} from "../../routes";
import {getMobileOperatingSystem} from '../../stores/firebase'; // import {getMobileOperatingSystem} from '../../stores/firebase';
import {Helmet} from "react-helmet"; import {Helmet} from "react-helmet";
import LoadingDialog from '../LoadingDialog/index'; import LoadingDialog from '../LoadingDialog/index';

View File

@ -23,7 +23,7 @@ import DepositStore from "./deposit";
import WithdrawStore from "./withdraw"; import WithdrawStore from "./withdraw";
import Task from './task'; import Task from './task';
import Transaction from './transaction'; import Transaction from './transaction';
import {Firebase} from './firebase'; // import {Firebase} from './firebase';
import AirlinesDomestic from "./airlines_domestic"; import AirlinesDomestic from "./airlines_domestic";
import Airports from "./airports"; import Airports from "./airports";
import Categories from './categories'; import Categories from './categories';
@ -102,7 +102,7 @@ export default class AppState {
task = new Task(this); task = new Task(this);
transaction = new Transaction(this); transaction = new Transaction(this);
setting = new Setting(this); setting = new Setting(this);
firebase = new Firebase(this); // firebase = new Firebase(this);
userBanks = new UserBanks(this); userBanks = new UserBanks(this);
stores = new Stores(this); stores = new Stores(this);
storeList = new StoreList(this); storeList = new StoreList(this);

View File

@ -1,7 +1,7 @@
/** /**
* Created by 322 on 01/04/2017. * Created by 322 on 01/04/2017.
*/ */
import * as firebase from "firebase"; // import * as firebase from "firebase";
import {observable, action, computed} from 'mobx'; import {observable, action, computed} from 'mobx';
export function getMobileOperatingSystem() { export function getMobileOperatingSystem() {
@ -44,8 +44,8 @@ export class Firebase {
storageBucket: "cerdas-fc4a2.appspot.com", storageBucket: "cerdas-fc4a2.appspot.com",
messagingSenderId: "192592024837" messagingSenderId: "192592024837"
}; };
firebase.initializeApp(config); // firebase.initializeApp(config);
const messaging = firebase.messaging(); // const messaging = firebase.messaging();
messaging.requestPermission() messaging.requestPermission()
.then(function() { .then(function() {
console.log('Notification permission granted.'); console.log('Notification permission granted.');
@ -56,7 +56,7 @@ export class Firebase {
console.log('Unable to get permission to notify.', err); console.log('Unable to get permission to notify.', err);
}); });
} }
} }