Common components refactor #1

Merged
akinwale merged 42 commits from common-components-refactor into master 2018-04-05 04:57:30 +02:00
3 changed files with 1572 additions and 901 deletions
Showing only changes of commit 89104793bb - Show all commits

File diff suppressed because it is too large Load diff

View file

@ -1,14 +1,26 @@
// common // common
import Lbry from 'lbry'; import Lbry from 'lbry';
import LbryApi from 'lbryapi';
import Lbryuri from 'lbryuri'; import Lbryuri from 'lbryuri';
export { Lbry, LbryApi, Lbryuri }; export { Lbry, Lbryuri };
// actions // actions
export { doOpenModal, doCloseModal, doShowSnackBar } from 'redux/actions/app';
export { doFetchClaimListMine, doAbandonClaim, doResolveUris, doResolveUri } from 'redux/actions/claims'; export { doFetchClaimListMine, doAbandonClaim, doResolveUris, doResolveUri } from 'redux/actions/claims';
export { doFetchCostInfoForUri } from 'redux/actions/cost_info'; export { doFetchCostInfoForUri } from 'redux/actions/cost_info';
export { doFetchFileInfo, doFileList, doFetchFileInfosAndPublishedClaims } from 'redux/actions/file_info'; export { doFetchFileInfo, doFileList, doFetchFileInfosAndPublishedClaims } from 'redux/actions/file_info';
export { doSearch } from 'redux/actions/search'; export { doSearch } from 'redux/actions/search';
export {
doUpdateBalance,
doBalanceSubscribe,
doFetchTransactions,
doFetchBlock,
doGetNewAddress,
doCheckAddressIsMine,
doSendDraftTransaction,
doSetDraftTransactionAmount,
doSetDraftTransactionAddress,
doSendSupport
} from 'redux/actions/wallet';
// reducers // reducers
export { claimsReducer } from 'redux/reducers/claims'; export { claimsReducer } from 'redux/reducers/claims';
@ -54,14 +66,14 @@ export {
} from 'redux/selectors/cost_info'; } from 'redux/selectors/cost_info';
export { export {
makeSelectFileInfoForUri,
makeSelectDownloadingForUri,
makeSelectLoadingForUri,
selectFileInfosByOutpoint, selectFileInfosByOutpoint,
selectIsFetchingFileList, selectIsFetchingFileList,
selectIsFetchingFileListDownloadedOrPublished, selectIsFetchingFileListDownloadedOrPublished,
makeSelectFileInfoForUri,
selectDownloadingByOutpoint, selectDownloadingByOutpoint,
makeSelectDownloadingForUri,
selectUrisLoading, selectUrisLoading,
makeSelectLoadingForUri,
selectFileInfosDownloaded, selectFileInfosDownloaded,
selectDownloadingFileInfos, selectDownloadingFileInfos,
selectTotalDownloadProgress selectTotalDownloadProgress
@ -75,3 +87,21 @@ export {
selectWunderBarAddress, selectWunderBarAddress,
selectWunderBarIcon selectWunderBarIcon
} from 'redux/selectors/search'; } from 'redux/selectors/search';
export {
makeSelectBlockDate,
selectBalance,
selectTransactionsById,
selectTransactionItems,
selectRecentTransactions,
selectHasTransactions,
selectIsFetchingTransactions,
selectIsSendingSupport,
selectReceiveAddress,
selectGettingNewAddress,
selectDraftTransaction,
selectDraftTransactionAmount,
selectDraftTransactionAddress,
selectDraftTransactionError,
selectBlocks
} from 'redux/selectors/wallet';

24
src/redux/actions/app.js Normal file
View file

@ -0,0 +1,24 @@
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
import * as ACTIONS from 'constants/action_types';
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
export function doOpenModal(modal, modalProps = {}) {
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
return {
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
type: ACTIONS.OPEN_MODAL,
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
data: {
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
modal,
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
modalProps,
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
},
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
};
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
}
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
export function doCloseModal() {
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
return {
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
type: ACTIONS.CLOSE_MODAL,
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
};
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
}
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
export function doShowSnackBar(data) {
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
return {
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
type: ACTIONS.SHOW_SNACKBAR,
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
data,
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
};
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?
}
kauffj commented 2018-02-02 15:51:05 +01:00 (Migrated from github.com)
Review

All of these actions should probably be outside of lbry-redux, eh?

All of these actions should probably be outside of `lbry-redux`, eh?
neb-b commented 2018-03-30 00:55:03 +02:00 (Migrated from github.com)
Review

Did we decide on something like DO_NOTIFY?

Did we decide on something like `DO_NOTIFY`?