This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gulp from 'gulp'; | |
import gulpJsonTransform from 'gulp-json-transform'; | |
import countryList from './config/countries'; // it's an array of string | |
// omit clean, distribute etc | |
function patchManifest(done) { | |
const tasks = countryList.map((countryName) => { | |
// Right here, we return a function per country | |
return () => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////// Background Scripts Entry, index.js //////// | |
import { createBackgroundStore } from 'redux-webext'; | |
import { createSubscriber } from './universalStore'; | |
createBackgroundStore({ ... }).then((store) => { | |
// create subscriber immediately!! | |
store.subscribe(createSubscriber(store)); | |
// ... | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const tabsActivatedFactory = store => info => { | |
// You can get state here! | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createBackgroundStore } from 'redux-webext'; | |
import EventRegister from './events'; | |
createBackgroundStore({ ... }).then((store) => { | |
// ... | |
EventRegister.run(store); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { tabsActivatedFactory } from './tabs'; | |
import { DOMLoadedFactory } from './webNavigation'; | |
export default (store) => { | |
browser.tabs.onActivated.addListener(tabsActivatedFactory(store)); | |
browser.webNavigation.onDOMContentLoaded.addListener(DOMLoadedFactory(store)); | |
//... | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jobs = []; | |
const jobTypes = [ 'A', 'B', 'C', 'D' ]; | |
const cellEditProp = { | |
mode: 'click', | |
blurToSave: true | |
}; | |
export default class EditTypeReadOnlyTable extends React.Component { | |
render() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SelectBgColorDynamicTable extends React.Component { | |
render() { | |
const selectRowProp = { | |
mode: 'checkbox', | |
bgColor: function(row, isSelect) { | |
if (isSelect) { | |
const { id } = row; | |
if (id < 2) return 'blue'; | |
else if (id < 4) return 'red'; | |
else return 'yellow'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint max-len: 0 */ | |
import React from 'react'; | |
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; | |
const products = []; | |
function addProducts(quantity) { | |
const startId = products.length; | |
for (let i = 0; i < quantity; i++) { | |
const id = startId + i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint max-len: 0 */ | |
import React from 'react'; | |
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; | |
const products = []; | |
function addProducts(quantity) { | |
const startId = products.length; | |
for (let i = 0; i < quantity; i++) { | |
const id = startId + i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExpandRow extends React.Component { | |
constructor(props) { | |
super(props); | |
} | |
isExpandableRow(row) { | |
if (row.id < 3) return true; | |
else return false; | |
} |