Commit graph

65 commits

Author SHA1 Message Date
Thebora Kompanioni
cac503fb35
refactor: move lock/unlock requests from Wallet to Wallets (#351)
* refactor: move lock/unlock wallet api calls from child component to parent

* refactor: control Wallet component appearance from parent

* fix: prevent state update on an unmounted component on Settings page
2022-06-28 13:14:50 +02:00
Daniel
9fe84c8cda
fix: remove fidelity bond feature flag 2022-06-27 21:25:09 +02:00
Thebora Kompanioni
c68e4c5c64
feat: basic fidelity bonds (#307)
* dev: add simple fidelity bond screen in advanced mode

* dev: add link to fidelity form page in CurrentWalletAdvanced

* dev: fix build errors and remove 'as' tag of translation elements

* refactor: move FidelityBondAdvanced component to own file

* ui: highlight expiry date of fidelity bond address

* dev: display Fidelity Bond create form regardless if FBs already exist

* dev: avoid flickering when loading new fb address

* fix: rename Locktime to Lockdate

* dev: add translation strings to section 'global'

* wip: FidelityBondSimple

* review: distinct simple and dev mode Fidelity Bond screens

* review: fix dev FB view in dark mode

* refactor: rename FidelityBondAdvanced to FidelityBondDevOnly

* dev: add link to default view to FidelityBondDevOnly

* dev: sort utxo by value

* dev: reset user confirmation on data change

* dev: create fidelity bond with collaborative transaction WIP

* dev: wait for collaborative transaction to finish

* dev: unfreeze utxos after creating sweep tx

* review: render whitespace only when necessary in FB alert

* review: do not provide time related values to Date.UTC for FB

* Update src/components/FidelityBondDevOnly.tsx

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>

* review: do not duplicate 'initialLockdate' values

* dev: allow lockdates in the past in dev mode

* dev: display percentage of utxo to total value in account

* dev: style percentage bar

* dev: display percentage bar in account selector

* dev: i18n for 'time elapsed' phrase

* dev: externalize components UtxoSelector and UtxoCheckbox

* dev: externalize components AccountSelector and AccountCheckbox

* dev: externalize LockdateForm

* dev: externalize FidelityBondDetailsSetupForm

* dev: display all accounts by default in FB form

* refactor: remove unused vars and imports

* dev: fix comments and add todos

* dev: minimal i18n for FB form

* ui: remove account/utxo checkbox overlay

* dev: add checkbox-card component

* dev: show unit of funds according to settings in FB form

* dev: allow already expired lockdates in dev mode

* dev: use minimum makers to create fb

* refactor: combine FidelityBond and FidelityBondSimple

* dev: undo coin control setup on errors

* dev: perform coin control actions sequentially

* dev: use direct-send when renewing an expired fidelity bond

* review: improve code readability

* review: do not return value from function 'sweepToFidelityBond'

* dev: log timelocked address to console in dev mode

* review: remove FidelityBondDevOnly component

* review: use dropdowns in lockdate form

* Update src/components/FidelityBond.tsx

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>

* dev: add debug feature 'allowCreatingExpiredFidelityBond'

* review: fix var naming

* review: fix comment

* Update src/components/FidelityBond.tsx

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>

* Update src/components/FidelityBond.tsx

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>

* dev: unfreeze sequentially after fidelity bond tx was created

* review: remove ability to select multiple jars

* review: add tests for fb utils

* review: remove coin control

* review: reflect missing coin control in account checkbox

* review: remove time elapsed string from fb summary

* dev: add taker started alert to FB screen

* dev: reset lockdate form if date is invalid

* dev: reload after taker operation

* dev: add calculated total balance to useBalanceSummary hook

* dev: handle expired timelocked funds in useBalanceSummary hook

* dev: use isLocked to detect if freeze/unfreeze is enabled

* dev: fix build

* refactor: proper var names

* dev: show success msg only if fb has been created successfully

* dev: do not wait for collaborative tx to finish

* dev: direct-send if renewing FB

* dev: utilize 'isLocked' in CurrentWalletAdvanced and Jam view

* dev: link to FB view in Cheatsheet

* dev: utilize 'calculatedTotalBalanceInSats' where possible

* Update src/components/FidelityBond.tsx

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>

* review: adapt error handling style on FB sweep tx

sorry @dnlggr for letting this slip in _again_

* review: always show all accounts in FB form

* review: initial lockdate should be 3 month from now

* review: move YearsRange and initialLockdate to fb_utils

* review: display month names

* review: wrap rows in container

* review: remove unnecessary comment

* review: left-align confirmation toggle in FB form

* review: turn accountBalances from array to object

* Update src/i18n/locales/en/translation.json

Co-authored-by: Gigi <109058+dergigi@users.noreply.github.com>

* Update src/components/FidelityBond.tsx

Co-authored-by: Gigi <109058+dergigi@users.noreply.github.com>

* review: remove initializing flag

* review: show timelocked address in confirmation step

* test: add test for LockdateForm component

* test: add test for _minMonth

* test: add test for _selectableYears

* test: add test for _selectableMonths

* ui: fix table in light theme

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>
Co-authored-by: Gigi <109058+dergigi@users.noreply.github.com>
2022-06-15 15:17:51 +02:00
Daniel
9d0021287f
feat: improve wallet control in settings (#325)
* feat: add lock and new wallet controls
2022-06-15 13:33:01 +02:00
Daniel
216100a3b9
feat: first draft of jars on main wallet screen (#324)
* feat: add simple jar breakdown of wallet

* feat: add collapsible container for jars
2022-06-14 12:52:48 +02:00
Gigi
d5fa5413b2
chore: pre-alpha -> beta (#313)
* chore: pre-alpha -> alpha

* alpha software -> beta software

* an alpha stage -> a beta stage

* alpha -> beta

* setShowAlphaWarning -> setShowBetaWarning

* showAlphaWarning -> showBetaWarning

* Revert Trans i18nKey
2022-06-09 16:57:43 +02:00
Daniel
8f62a42302
fix: mobile layout issues (#311)
* fix: footer alignment

* fix: page titles

* fix: top padding on mobile

* fix: cheatsheet height

* linter: remove unused import
2022-06-09 15:52:03 +02:00
Thebora Kompanioni
3806613a9d
ui: less vertical padding of main container on mobile screens (#303) 2022-06-01 15:23:40 +02:00
Thebora Kompanioni
6ed301b8b3
chore: enable cheatsheet (#288)
* chore: enable cheatsheet

* fix: link to scheduled transactions in cheatsheet

* chore: cheatsheet order: fund, schedule, lock, earn, repeat

* chore: hide cheatsheet when clicked
2022-05-19 13:14:17 +02:00
Daniel
6b78b32eb3
chore: enable schedule (#284)
* feat: enable schedule

* Add debug feature flag
2022-05-19 12:31:52 +02:00
Gigi
3c886f3e05
feat(footer): show Jam version (#281)
* feat(footer): show Jam version

link will lead to GitHub releases (tags)

* Update src/components/App.jsx

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>
2022-05-18 11:30:44 +02:00
Daniel
0e1d0a8a69
feat: scheduled transactions prototype (#242)
* Use backend fork

* Add minimal schedule tab

* Add feature flag

* Update title

* Change branch in regtest setup

* Revert ts config

* Change weird formik behavior

* Fix warning

* Reset alerts

* Use loading flag when starting / stopping
2022-05-11 10:05:01 +02:00
Thebora Kompanioni
a7e95845bc
refactoir: formik validation in wallet component (#235)
* refactor: use Formik in Wallet component

* fix: handle lock attempt of currently unactive wallet

* fix: let Formik know that onSubmit handlers are async

* chore: remove unused utils function 'serialize'

* fix: remove redundant comment
2022-05-05 09:30:36 +02:00
Daniel
23cd01131c
ui: move gh link to settings and remove other footer links (#227)
* Move gh link to settings

* Add social icons to footer

* Add jm twitter to settings
2022-04-25 14:37:58 +02:00
Thebora Kompanioni
825f725053
feat: add cheatsheet (#211)
* feat: add cheatsheet

* show cheatsheet only when wallet is active

* display cheatsheat in dev mode only for now

* add close button to cheatsheet overlay (for mobile users)

* ui: visualize upcoming features in cheatsheet

* ui: show cheatsheet once after first wallet was created

* feat: add simple feature flags

Co-authored-by: Đorđe Spasić <34274884+Djo1e@users.noreply.github.com>
Co-authored-by: Gigi <109058+dergigi@users.noreply.github.com>
2022-04-14 11:50:41 +02:00
Thebora Kompanioni
68da95817c
refactor: reload wallet info (#213)
* feat: add api call to get timelock address

* refactor: reset wallet info in WalletProvider

* refactor: move wallet info loading into WalletProvider

* review: inline function in CurrentWalletAdvanced component

* review: add comment on error handling in auto-reloading wallet info
2022-04-12 14:17:59 +02:00
Thebora Kompanioni
fa131ca596
ui: small ui fixes (#201)
* ui: adapt info alert color to match figma more closely

* ui: adapt connection indicator icon to match figma more closely

* ui: better visibility of disabled input fields in dark-mode

* ui: reorder form fields on send page to match figma

* ui: default to sending as collaborative transaction

* ui: add icons to receive/withdraw buttons in CurrentWalletMagic

* review: use Send/Receive instead of Deposit/Withdraw

* fix: spacing on send screen

* fix: make collapsed accordion buttons visible in dark mode

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>
2022-04-12 10:30:53 +02:00
Đorđe Spasić
60847bd059
refactor: add route constants (#215) 2022-04-11 12:54:04 +02:00
Thebora Kompanioni
963dc49e72
fix: do not hide CreateWallet component on connection errors (#199)
* refactor: always extract api error message with Api.Helper

* refactor: port WalletContext from jsx to tsx

* fix: do not hide CreateWallet component on connection errors

* chore: remove deprecated 'exact' property of index route

'exact' has been removed in react-router v6 and is not needed anymore.
2022-04-06 12:59:07 +02:00
Thebora Kompanioni
6c5e149516
fix: Remove skip button quiz screen (#198)
* fix: show skip button on quiz screen only in dev mode

* chore: externalize styles for Seedphrase and CreateWallet components

* fix: slightly increase container width of seedword

* feat: prevent users from leaving page with seedphrase on it by mistake

* feat: prevent leaving page while wallet is being created

* test: verify 'skip' button is not present in test env
2022-04-04 09:27:54 +02:00
Thebora Kompanioni
228c92ee55
Improve lock/unlock mechanism (#175)
* feat: add ServiceInfoContext

* use ServiceInfo in Navbar component

* move updating ServiceInfo with websocket data from App to ServiceInfoProvider

* use sessionConnectionError in App component

* use taker/maker info from ServiceInfo in App component

* move resetting wallet/walletInfo from App to ServiceInfoProvider

* fix: display wallet active state according to server session state

* always sort wallet array list by name starting with active wallet

* hide wallet list when reloading wallet data

* feat: add activity indicators to wallet list screen

* externalize JoiningIndicator component

* ui: hide unlock option for inactive wallets if maker/taker service is running

* refactor: use WalletContext and ServiceInfoContext consistently

* chore: use statusText as fallbackReason in Api.Helper
2022-03-21 17:31:31 +01:00
Thebora Kompanioni
80e5da78e5
Add typescript support (#176)
* init typescript support

* chore: update dependencies

@popperjs/core              ^2.11.2  →   ^2.11.4
@testing-library/jest-dom   ^5.16.1  →   ^5.16.2
@testing-library/react      ^12.1.2  →   ^12.1.4
http-proxy-middleware        ^2.0.1  →    ^2.0.4
i18next                    ^21.6.12  →  ^21.6.14
lint-staged                 ^12.3.1  →   ^12.3.6
prettier                     ^2.5.1  →    ^2.6.0
react-bootstrap              ^2.1.1  →    ^2.2.1
react-i18next              ^11.15.5  →  ^11.15.7
react-router-bootstrap      ^0.26.0  →   ^0.26.1
react-router-dom             ^6.2.1  →    ^6.2.2
2022-03-17 12:44:01 +01:00
Daniel
63018ac96b
feat: translate screens (#174)
* Translate onboarding

* Translate navbar, app, footer

* Translate wallet card

* Translate wallet creation form

* Translate wallet confirmation

* Rename wallets.wallet key

* Translate current wallet

* Translate settings

* Translate send

* Translate receive

* Translate earn

* Fix linter warnings

* Fix tests

* Update src/components/Earn.jsx

Co-authored-by: Thebora Kompanioni <theborakompanioni@users.noreply.github.com>

* Update src/i18n/locales/en/translation.json

Co-authored-by: Thebora Kompanioni <theborakompanioni@users.noreply.github.com>

* Update src/components/CurrentWalletAdvanced.jsx

Co-authored-by: Thebora Kompanioni <theborakompanioni@users.noreply.github.com>

* Update src/components/Earn.jsx

Co-authored-by: Thebora Kompanioni <theborakompanioni@users.noreply.github.com>

* Update src/i18n/locales/en/translation.json

Co-authored-by: Thebora Kompanioni <theborakompanioni@users.noreply.github.com>

* Update src/i18n/locales/en/translation.json

Co-authored-by: Thebora Kompanioni <theborakompanioni@users.noreply.github.com>

* Remove dead code

* Parametrize num collaborators

* Added fallback for branch type

Co-authored-by: Thebora Kompanioni <theborakompanioni@users.noreply.github.com>
2022-03-15 14:01:04 +01:00
Thebora Kompanioni
13f0ac3803
fix: clear UI wallet if locking fails with status 401 (#158)
* test: verify current behaviour of Wallet component

* fix: assume websocket is healthy only if connection is stable

* test: verify successful locking/unlocking

* fix: clear UI wallet state if locking fails with state 401

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>
2022-03-09 17:34:37 +01:00
Thebora Kompanioni
78d15a1a30
fix: page reloads (#162)
* fix: prevent updated on unmounted components

* fix: initialize and set wallet immediately

* Update src/context/WalletContext.jsx

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>

* refactor: rename 'initialWalletFromSession' to 'restoreWalletFromSession'

* fix: remove obsolete wallet initialization in App component

wallet is restored from session right away before App is invoked

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>
2022-03-09 16:54:06 +01:00
Daniel
1343271c64
refactor: rename to Jam (#131)
* refactor: dry up app layout (#126)

* Rename and update readme

* Fix typos

* Run npm install

* Use html for header

* Update package name

* Add back alt texts

* Update title

* Add note about buggy raspiblitz

* Remove raspiblitz gotchas

* Update src/components/App.jsx

Co-authored-by: Max Hillebrand <30683012+MaxHillebrand@users.noreply.github.com>

* Update src/components/Onboarding.jsx

Co-authored-by: Max Hillebrand <30683012+MaxHillebrand@users.noreply.github.com>

* Run prettier

* Update CONTRIBUTING.md

Co-authored-by: d11n <mail@dennisreimann.de>

* Update README.md

Co-authored-by: d11n <mail@dennisreimann.de>

* Fix wording

* Update title

Co-authored-by: Max Hillebrand <30683012+MaxHillebrand@users.noreply.github.com>
Co-authored-by: d11n <mail@dennisreimann.de>
2022-03-03 12:07:45 +01:00
Thebora Kompanioni
7fb425fd48
fix: add bottom spacing to onboarding screen (#128)
* fix: add bottom spacing to onboarding screen

* Update src/components/App.jsx

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>
2022-02-28 18:27:21 +01:00
Thebora Kompanioni
03e58c9059
feat: readd websocket connection (#122)
* feat: readd websocket connection

* add WebsocketProvider

* feat: update taker/maker state based on websocket data

* update connection indicator based on websocket state

* reconnect with linear backoff on websocket errors

the backend is not happy with a second instance in another browser tab
that send invalid tokens (e.g. because the previously used wallet was
locked in another tab). This introduces a linear increase to a max
of 10 seconds. Seems to ease the problem in the active tab.

* send keepalive message periodically

some webservers will close connections on inactivity rather
soon by default (e.g. nginx is 60s). this commit contains
sending a keepalive message periodically every 30 seconds.

Co-authored-by: d11n <mail@dennisreimann.de>
2022-02-28 13:23:44 +01:00
Daniel
539175e096
refactor: dry up app layout (#126) 2022-02-25 12:12:28 +01:00
Thebora Kompanioni
68e7a7fab8
feat: update wallets page (#108)
* refactor: get current wallet from context on wallets page

* refactor: pass className to Wallet component

* refactor: remove row/col from Wallet layout

* ui: use PageTitle on Wallets page

* ui: increase Create Wallet button size if no wallet exists

* refactor: remove duplicate class names from wallet

* review: center 'Your wallets' heading

* fix: fix wallet list form on mobile
2022-02-17 18:32:58 +01:00
Daniel
4159fac230
fix: improve onboarding mobile layout (#109)
* fix: improve onboarding mobile layout

* fix: dom warning
2022-02-17 17:34:14 +01:00
Daniel
ab13f77285
Fix footer (#97) 2022-02-15 11:53:21 +01:00
Daniel
f359c8951b
Add disclaimer (#92) 2022-02-14 18:52:24 +01:00
Thebora Kompanioni
8c14fcbd29
fix warnings during build (#91)
* fix: prevent warning react/react-in-jsx-scope

* fix: prevent warning react/jsx-no-target-blank
2022-02-14 18:33:04 +01:00
Thebora Kompanioni
7d62a3820a
feat: update earn page (#82)
* always display yielgen report with max width

* lowercase 'sats' to be consistent with 'send' page

* display success alert when service is running

* fix: display info text if taker is running

* feat: add table footer to report and reduce lines

* review: keep feeRel state as factor

Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>
2022-02-14 17:52:59 +01:00
Thebora Kompanioni
4070d7026c
fix: display info text on send page if service is running (#86) 2022-02-14 17:45:13 +01:00
Thebora Kompanioni
6f0f515e87
fix: navigate to root on unmapped path (#89) 2022-02-14 14:20:23 +01:00
secondl1ght
3b832fc717
Merge pull request #54 from secondl1ght/onboarding
feat: onboarding screen
2022-02-09 11:51:38 -07:00
Thebora Kompanioni
94f2899e22
refactor: collect api requests in single file (#67)
* refactor: collect api requests in single file

* refactor: use JmWalletApi for all api requests

* cleanup: remove unused varin JmWalletApi

* refactor: adhere to http_method+resource naming for api methods

* cleanup: more consistent use of walletName var
2022-02-09 10:04:11 +01:00
theborakompanioni
d2173cdb89 fix: Invalid DOM property 'class' in App 2022-02-08 21:13:31 +01:00
secondl1ght
eccc21691d Remove else statement 2022-02-08 10:24:50 -07:00
secondl1ght
67bcde2ab6 Merge fixes 2022-02-07 14:08:44 -07:00
secondl1ght
b0dfe11b22
Merge branch 'master' into onboarding 2022-02-07 13:40:42 -07:00
secondl1ght
b780e9ba73 Hook up onboarding and some styling updates 2022-02-07 13:12:56 -07:00
Daniel
7546ca74d4
feat: add privacy levels (#51)
* fature: privacy shields ui

* fix: show address status in advanced wallet view

* feat: advanced wallet setting

* fix: smaller ui adjustments

* Remove todo

* Fix flickering

* Remove hardcoded accounts and fix typo
2022-02-07 15:12:16 +01:00
secondl1ght
6470ab4316
feat: add connection indicator to footer (#55)
* Add connection indicator to footer

* Update src/components/App.jsx

* Update src/components/App.jsx

* Update src/components/App.jsx

* Update src/components/App.jsx

Co-authored-by: Daniel <eggerdnl@gmail.com>
2022-02-07 10:27:59 +01:00
secondl1ght
422426f185 Initial draft of onboarding screen 2022-02-05 19:47:22 -07:00
Thebora Kompanioni
43ba1ab1e0
cleanup: remove broken websocket connection (#45) 2022-02-03 11:36:18 +01:00
Daniel
699e951fda
feat: style navbar (#29)
* Add gear icon in navbar

* feat: add basic settings screen and context

* fix: remove unneeded props chains

* Update navbar

* Add wallet preview UI

* Add border to highlight active tab

* Update icons

* Update balance font

* Fix collapsing behaviour

* Add WalletContext

* Update balance in header

* Fix spacing

* Fix dark theme

* Replace inline SVGs with sprites

* Clean up

* Fix warnings

* Clean up layout

* Make height dynamic

* Remove headings

* Add progress inidcators

* Fix balance height

* Reset wallet info when reloading

* Improve activity indicator display

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2022-02-01 23:22:32 +01:00
d11n
d7268aa70c
feat: add theming support (#10)
* Convert logo into sprite

* Add theme basics

* Extract Sprite component

* Add some more overrides

* Update src/components/App.jsx

Co-authored-by: Daniel <eggerdnl@gmail.com>

* Move switch to settings view

Co-authored-by: Daniel <eggerdnl@gmail.com>
2022-01-28 20:14:09 +01:00