-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from KayBeSee/next
v1.1 Test Release
- Loading branch information
Showing
192 changed files
with
105,682 additions
and
10,165 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ LilyWallet-darwin-x64 | |
.DS_Store | ||
dist/ | ||
LilyWallet-* | ||
.env | ||
compiled-ts/ |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// babel.config.js | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: 'current', | ||
}, | ||
}, | ||
], | ||
], | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { createContext, useReducer, useCallback, useState } from 'react'; | ||
|
||
import { | ||
accountMapReducer, | ||
ACCOUNTMAP_UPDATE, | ||
ACCOUNTMAP_SET | ||
} from './reducers/accountMap'; | ||
|
||
import { AccountMap, LilyAccount } from './types' | ||
|
||
export const AccountMapContext = createContext({ | ||
setAccountMap: (accountMap: AccountMap) => { }, | ||
updateAccountMap: (account: LilyAccount) => { }, | ||
setCurrentAccountId: (id: string) => { }, | ||
accountMap: {} as AccountMap, | ||
currentAccount: {} as LilyAccount | ||
}); | ||
|
||
export const AccountMapProvider = ({ children }: { children: React.ReactChild }) => { | ||
const [accountMap, dispatch] = useReducer(accountMapReducer, {}); | ||
const [currentAccountId, setCurrentAccountId] = useState('satoshi'); | ||
|
||
const currentAccount = accountMap[currentAccountId!] || { name: 'Loading...', loading: true, transactions: [], unusedAddresses: [], currentBalance: 0, config: {} }; | ||
|
||
const updateAccountMap = useCallback((account: LilyAccount) => { | ||
dispatch({ | ||
type: ACCOUNTMAP_UPDATE, | ||
payload: { | ||
account | ||
} | ||
}) | ||
}, [dispatch]) | ||
|
||
const setAccountMap = useCallback((accountMap: AccountMap) => { | ||
dispatch({ | ||
type: ACCOUNTMAP_SET, | ||
payload: accountMap | ||
}) | ||
}, [dispatch]) | ||
|
||
const value = { accountMap, updateAccountMap, setAccountMap, currentAccount, setCurrentAccountId } | ||
|
||
return <AccountMapContext.Provider value={value}>{children}</AccountMapContext.Provider> | ||
} |
Oops, something went wrong.