Skip to content

Commit

Permalink
feat: changable bee address (#9)
Browse files Browse the repository at this point in the history
* refactor: remove 'registerProtocolHandler'

* chore: add React dependency for extension pages

* build: set config for popup extension page

* style: change prettier config that had conflict with eslint

* style: remove semi

* feat: add shared store system for popup page and background script

* feat: init popup page with changeable Bee API URL functionality

* refactor: background script sctructure

* test: add utility functions

* test: bzz-api-url change

* refactor: remove unused import

Co-authored-by: Vojtech Simetka <vojtech@simetka.cz>

* refactor: StoreObserver inherits from EventEmitter

* refactor: React Hooks

* feat: add GlobalContext handling with React Hook

* refactor: remove unnecesarry fallback value

* refactor: using own state instead of direct globalState dispatch

* refactor: GlobalStateActionError custom error

* refactor: grammar mistake

Co-authored-by: Vojtech Simetka <vojtech@simetka.cz>

* refactor: grammar mistake

Co-authored-by: Vojtech Simetka <vojtech@simetka.cz>

* refactor: remove unnecessary console.log

Co-authored-by: Vojtech Simetka <vojtech@simetka.cz>

* refactor: url format regex

* refactor: GlobalStateActionError with property fields

* refactor: remove 'I' prefix from interface names

* refactor: GlobalStateActionError fields and bee api change regex

* refactor: extract localstore writes to custom state manager

* refactor: add store observer object to the global context

* refactor: use global state directly

* refactor: extract form from App to BeeApiUrlChangeForm

* revert: remove writing global state via store change because somehow registers too many listeners

* refactor: simplify comment message

Co-authored-by: Vojtech Simetka <vojtech@simetka.cz>

* refactor: context usage

* refactor: two way binding for react global context usage

* refactor: remove console.log

* refactor: change 'changeGlobalState' to 'dispatchGlobalState'

Co-authored-by: Vojtech Simetka <vojtech@simetka.cz>
  • Loading branch information
nugaon and vojtechsimetka authored Mar 12, 2021
1 parent 8cc52ca commit 8a5dc40
Show file tree
Hide file tree
Showing 20 changed files with 959 additions and 86 deletions.
3 changes: 2 additions & 1 deletion .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ module.exports = function (api) {
bugfixes: true,
targets
}
]
],
'@babel/preset-react'
],
plugins: [
'@babel/plugin-proposal-class-properties',
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ module.exports = {
},
},
],
};
}
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"quoteProps": "consistent",
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf",
"arrowParens": "avoid"
"arrowParens": "avoid",
"proseWrap": "always"
}
7 changes: 5 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"short_name": "Swarm Extension",
"version": "0.0.1",
"manifest_version": 2,
"permissions": ["webRequest", "webRequestBlocking", "*://*/*"],
"permissions": ["webRequest", "webRequestBlocking", "storage", "*://*/*"],
"author": "nugaon",
"description": "PoC for Ethereum Swarm extension",
"icons": {
Expand All @@ -13,7 +13,10 @@
"scripts": ["background.js"],
"persistent": true
},
"browser_action": {},
"browser_action": {
"default_title": "Swarm Extension",
"default_popup": "popup-page/index.html"
},
"content_scripts": [
{
"matches": ["file://*/*", "http://*/*", "https://*/*"],
Expand Down
Loading

0 comments on commit 8a5dc40

Please sign in to comment.