From de3639f29c40a044eec74d40a173dfbc42affd33 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 4 Mar 2019 23:46:57 -0500 Subject: [PATCH] new build setup for web/electron --- .babelrc | 9 + .eslintrc.json | 12 +- .gitignore | 2 +- build/downloadDaemon.js | 6 +- build/extractLocals.js | 49 - electron-builder.json | 4 + electron-webpack.json | 5 - package.json | 63 +- src/common/.gitkeep | 0 src/main/startSandbox.js | 28 - src/{main => platforms/electron}/Daemon.js | 2 +- .../electron}/createTray.js | 6 +- .../electron}/createWindow.js | 7 +- src/{main => platforms/electron}/index.js | 38 +- .../electron}/menu/setupBarMenu.js | 0 src/platforms/electron/startSandbox.js | 28 + .../electron}/unpackByOutpoint.js | 0 src/platforms/web/electron.js | 11 + src/platforms/web/stubs.js | 23 + .../viewers/threeViewer/internal/loader.js | 33 - .../viewers/threeViewer/internal/three.js | 11 - src/renderer/redux/selectors/content.js | 74 - src/renderer/redux/selectors/file_info.js | 199 - src/{renderer => ui}/analytics.js | 0 src/ui/app.js | 20 + src/{renderer => ui}/component/app/index.js | 0 src/{renderer => ui}/component/app/view.jsx | 10 +- .../component/button/index.js | 0 .../component/button/view.jsx | 0 .../component/cardMedia/index.js | 0 .../ui/component/cardMedia}/placeholder.png | Bin .../component/cardMedia/view.jsx | 4 +- .../component/cardVerify/index.js | 0 .../component/cardVerify/view.jsx | 2 +- .../component/categoryList/index.js | 0 .../component/categoryList/view.jsx | 0 .../component/channelTile/index.js | 0 .../component/channelTile/view.jsx | 0 .../component/common/busy-indicator.jsx | 0 .../component/common/credit-amount.jsx | 0 .../component/common/file-exporter.jsx | 7 +- .../component/common/file-selector.jsx | 1 + .../form-components/form-field-price.jsx | 0 .../common/form-components/form-field.jsx | 0 .../common/form-components/form-row.jsx | 38 + .../component/common/form-components/form.jsx | 0 .../common/form-components/submit.jsx | 0 .../component/common/form.jsx | 0 .../component/common/icon-custom.jsx | 0 .../component/common/icon.jsx | 0 .../component/common/lbc-symbol.jsx | 0 .../component/common/loading-screen.jsx | 0 .../component/common/markdown-preview.jsx | 0 .../component/common/qr-code.jsx | 0 .../component/common/thumbnail.jsx | 0 .../component/common/tooltip.jsx | 0 .../component/common/transaction-link.jsx | 0 .../component/common/truncated-text.jsx | 0 .../component/common/yrbl.jsx | 0 .../component/copyableText/index.js | 0 .../component/copyableText/view.jsx | 0 .../component/dateTime/index.js | 0 .../component/dateTime/view.jsx | 4 +- .../component/emailCollection/index.js | 0 .../component/emailCollection/view.jsx | 0 .../component/expandable/index.js | 0 .../component/expandable/view.jsx | 0 .../component/externalLink/index.js | 0 .../component/externalLink/view.jsx | 0 .../component/fileActions/index.js | 0 .../component/fileActions/view.jsx | 0 .../component/fileCard/index.js | 0 .../component/fileCard/view.jsx | 0 .../component/fileDetails/index.js | 0 .../component/fileDetails/view.jsx | 2 +- .../component/fileDownloadLink/index.js | 0 .../component/fileDownloadLink/view.jsx | 0 .../component/fileList/index.js | 0 .../component/fileList/view.jsx | 0 .../component/fileListSearch/index.js | 0 .../component/fileListSearch/view.jsx | 13 +- .../component/filePrice/index.js | 0 .../component/filePrice/view.jsx | 0 .../component/fileRender/index.js | 0 .../component/fileRender/view.jsx | 0 .../component/fileTile/index.js | 0 .../component/fileTile/view.jsx | 0 .../component/fileViewer/index.js | 0 .../fileViewer/internal/play-button.jsx | 0 .../component/fileViewer/internal/player.jsx | 4 +- .../component/fileViewer/view.jsx | 0 .../component/firstRun/index.js | 0 .../component/firstRun/view.jsx | 8 +- .../component/formFieldPrice/index.js | 0 .../component/formFieldPrice/view.jsx | 0 .../component/header/index.js | 0 .../component/header/view.jsx | 0 .../component/hiddenNsfwClaims/index.js | 0 .../component/hiddenNsfwClaims/view.jsx | 0 .../component/inviteList/index.js | 0 .../component/inviteList/view.jsx | 17 +- .../component/inviteNew/index.js | 0 .../component/inviteNew/view.jsx | 0 .../component/nsfwOverlay/index.js | 0 .../component/nsfwOverlay/view.jsx | 0 src/{renderer => ui}/component/page/index.js | 0 src/{renderer => ui}/component/page/view.jsx | 0 .../component/publishForm/index.js | 0 .../publishForm/internal/bid-help-text.jsx | 0 .../publishForm/internal/license-type.jsx | 0 .../publishForm/internal/name-help-text.jsx | 0 .../component/publishForm/view.jsx | 21 +- .../component/recommendedContent/index.js | 0 .../component/recommendedContent/view.jsx | 6 +- .../component/rewardLink/index.js | 0 .../component/rewardLink/view.jsx | 0 .../component/rewardListClaimed/index.js | 0 .../component/rewardListClaimed/view.jsx | 3 +- .../component/rewardSummary/index.js | 0 .../component/rewardSummary/view.jsx | 0 .../component/rewardTile/index.js | 0 .../component/rewardTile/view.jsx | 0 .../component/router/index.js | 0 .../component/router/view.jsx | 0 .../component/searchOptions/index.js | 0 .../component/searchOptions/view.jsx | 0 .../component/selectChannel/index.js | 5 +- .../component/selectChannel/view.jsx | 0 .../component/selectThumbnail/index.js | 0 .../selectThumbnail/thumbnail-broken.png | Bin .../selectThumbnail/thumbnail-missing.png | Bin .../component/selectThumbnail/view.jsx | 77 +- .../component/shapeShift/index.js | 17 +- .../shapeShift/internal/active-shift.jsx | 13 +- .../component/shapeShift/internal/form.jsx | 0 .../shapeShift/internal/market_info.jsx | 0 .../component/shapeShift/view.jsx | 5 +- .../component/sideBar/index.js | 0 .../component/sideBar/view.jsx | 33 +- .../component/snackBar/index.js | 0 .../component/snackBar/view.jsx | 7 +- .../component/socialShare/index.js | 0 .../component/socialShare/view.jsx | 0 .../component/spinner/index.js | 0 .../component/spinner/view.jsx | 0 .../component/splash/index.js | 0 .../component/splash/internal/load-screen.jsx | 0 .../component/splash/view.jsx | 21 +- .../component/subscribeButton/index.js | 0 .../component/subscribeButton/view.jsx | 0 .../component/subscribeMarkAsRead/index.js | 0 .../component/subscribeMarkAsRead/view.jsx | 0 .../component/subscribeSuggested/index.js | 0 .../component/subscribeSuggested/view.jsx | 0 src/{renderer => ui}/component/theme/index.js | 0 src/{renderer => ui}/component/theme/view.jsx | 0 .../component/transactionList/index.js | 0 .../internal/transaction-list-item.jsx | 21 +- .../component/transactionList/view.jsx | 69 +- .../component/transactionListRecent/index.js | 0 .../component/transactionListRecent/view.jsx | 11 +- .../transactionRefreshButton/index.js | 0 .../transactionRefreshButton/view.jsx | 0 .../component/uriIndicator/index.js | 0 .../component/uriIndicator/view.jsx | 0 .../component/userEmailNew/index.js | 0 .../component/userEmailNew/view.jsx | 0 .../component/userEmailVerify/index.js | 0 .../component/userEmailVerify/view.jsx | 0 .../component/userHistory/index.js | 0 .../component/userHistory/view.jsx | 0 .../component/userHistoryItem/index.js | 0 .../component/userHistoryItem/view.jsx | 0 .../component/userPhoneNew/index.js | 0 .../component/userPhoneNew/view.jsx | 0 .../component/userPhoneVerify/index.js | 0 .../component/userPhoneVerify/view.jsx | 0 .../component/userVerify/index.js | 0 .../component/userVerify/view.jsx | 0 .../component/viewers/audioVideoViewer.jsx | 0 .../component/viewers/codeViewer.jsx | 0 .../component/viewers/documentViewer.jsx | 0 .../component/viewers/docxViewer.jsx | 11 +- .../component/viewers/htmlViewer.jsx | 0 .../component/viewers/pdfViewer.jsx | 0 .../component/viewers/threeViewer/index.jsx | 33 +- .../viewers/threeViewer/internal/detector.js | 0 .../viewers/threeViewer/internal/grid.js | 2 +- .../viewers/threeViewer/internal/renderer.js | 2 +- .../viewers/threeViewer/internal/scene.js | 2 +- .../component/walletAddress/index.js | 0 .../component/walletAddress/view.jsx | 0 .../walletBalance/balance-background.png | Bin .../component/walletBalance/index.js | 0 .../component/walletBalance/view.jsx | 1 + .../component/walletSend/index.js | 0 .../component/walletSend/view.jsx | 0 .../component/walletSendTip/index.js | 0 .../component/walletSendTip/view.jsx | 0 .../component/wunderbar/index.js | 0 .../wunderbar/internal/autocomplete.jsx | 0 .../component/wunderbar/view.jsx | 0 .../ui/component/yrbl}/gerbil-happy.png | Bin .../ui/component/yrbl}/gerbil-sad.png | Bin src/ui/component/yrbl/index.jsx | 41 + .../constants/action_types.js | 5 + src/{renderer => ui}/constants/claim.js | 0 src/{renderer => ui}/constants/content.js | 0 src/{renderer => ui}/constants/icons.js | 2 + src/{renderer => ui}/constants/languages.js | 0 src/{renderer => ui}/constants/licenses.js | 0 src/{renderer => ui}/constants/modal_types.js | 0 src/{renderer => ui}/constants/pages.js | 0 src/{renderer => ui}/constants/search.js | 0 src/{renderer => ui}/constants/settings.js | 0 src/{renderer => ui}/constants/shape_shift.js | 0 .../constants/subscriptions.js | 0 src/{renderer => ui}/constants/themes.js | 0 .../constants/thumbnail_upload_statuses.js | 0 .../constants/transaction_types.js | 0 src/ui/i18n/__.js | 3 + src/ui/i18n/__n.js | 3 + src/ui/i18n/index.js | 17 + src/{renderer => ui}/index.js | 3 +- src/{renderer => ui}/lbryio.js | 0 .../logWarningConsoleMessage.js | 0 src/{renderer => ui}/modal/modal.jsx | 14 +- .../modal/modalAffirmPurchase/index.js | 0 .../modal/modalAffirmPurchase/view.jsx | 0 .../modal/modalAuthFailure/index.js | 0 .../modal/modalAuthFailure/view.jsx | 0 .../modal/modalAutoUpdateConfirm/index.js | 0 .../modal/modalAutoUpdateConfirm/view.jsx | 3 +- .../modal/modalAutoUpdateDownloaded/index.js | 0 .../modal/modalAutoUpdateDownloaded/view.jsx | 11 +- .../modalConfirmThumbnailUpload/index.js | 0 .../modalConfirmThumbnailUpload/view.jsx | 0 .../modal/modalConfirmTransaction/index.js | 0 .../modal/modalConfirmTransaction/view.jsx | 0 .../modal/modalCreditIntro/index.js | 0 .../modal/modalCreditIntro/view.jsx | 0 .../modal/modalDownloading/index.js | 0 .../modal/modalDownloading/view.jsx | 0 .../modal/modalError/index.js | 0 .../modal/modalError/view.jsx | 12 +- .../modal/modalFileTimeout/index.js | 0 .../modal/modalFileTimeout/view.jsx | 0 .../modal/modalFirstReward/index.js | 0 .../modal/modalFirstReward/view.jsx | 0 .../modal/modalFirstSubscription/index.js | 0 .../modal/modalFirstSubscription/view.jsx | 0 .../modal/modalIncompatibleDaemon/index.js | 0 .../modal/modalIncompatibleDaemon/view.jsx | 3 +- .../modal/modalOpenExternalLink/index.js | 0 .../modal/modalOpenExternalLink/view.jsx | 2 + .../modal/modalPhoneCollection/index.js | 0 .../modal/modalPhoneCollection/view.jsx | 0 .../modal/modalPublish/index.js | 0 .../modal/modalPublish/view.jsx | 0 .../modal/modalRemoveFile/index.js | 0 .../modal/modalRemoveFile/view.jsx | 0 .../modal/modalRevokeClaim/index.js | 0 .../modal/modalRevokeClaim/view.jsx | 0 .../modalRewardApprovalRequired/index.js | 0 .../modalRewardApprovalRequired/view.jsx | 0 .../modal/modalRewardCode/index.js | 0 .../modal/modalRewardCode/view.jsx | 3 +- .../modal/modalRouter/index.js | 0 .../modal/modalRouter/view.jsx | 0 .../modal/modalSendTip/index.js | 0 .../modal/modalSendTip/view.jsx | 0 .../modal/modalSocialShare/index.js | 0 .../modal/modalSocialShare/view.jsx | 0 .../modal/modalTransactionFailed/index.js | 0 .../modal/modalTransactionFailed/view.jsx | 0 .../modal/modalUpgrade/index.js | 0 .../modal/modalUpgrade/view.jsx | 3 +- .../modal/modalWalletDecrypt/index.js | 0 .../modal/modalWalletDecrypt/view.jsx | 3 +- .../modal/modalWalletEncrypt/index.js | 0 .../modal/modalWalletEncrypt/view.jsx | 3 +- .../modal/modalWalletUnlock/index.js | 0 .../modal/modalWalletUnlock/view.jsx | 3 +- .../modal/modalWelcome/index.js | 0 .../modal/modalWelcome/view.jsx | 0 src/{renderer => ui}/native.js | 6 +- src/{renderer => ui}/page/auth/index.js | 0 src/{renderer => ui}/page/auth/view.jsx | 0 src/{renderer => ui}/page/backup/index.js | 0 src/{renderer => ui}/page/backup/view.jsx | 0 src/{renderer => ui}/page/channel/index.js | 0 src/{renderer => ui}/page/channel/view.jsx | 63 +- src/{renderer => ui}/page/discover/index.js | 0 src/{renderer => ui}/page/discover/view.jsx | 0 src/{renderer => ui}/page/file/index.js | 0 src/{renderer => ui}/page/file/view.jsx | 0 .../page/fileListDownloaded/index.js | 0 .../page/fileListDownloaded/view.jsx | 0 .../page/fileListPublished/index.js | 0 .../page/fileListPublished/view.jsx | 0 src/{renderer => ui}/page/getCredits/index.js | 0 src/{renderer => ui}/page/getCredits/view.jsx | 0 src/{renderer => ui}/page/help/index.js | 0 src/{renderer => ui}/page/help/view.jsx | 17 +- src/{renderer => ui}/page/invite/index.js | 0 src/{renderer => ui}/page/invite/view.jsx | 18 +- src/{renderer => ui}/page/publish/index.js | 0 src/{renderer => ui}/page/publish/view.jsx | 0 src/{renderer => ui}/page/report/index.js | 0 src/{renderer => ui}/page/report/view.jsx | 0 src/{renderer => ui}/page/rewards/index.js | 0 src/{renderer => ui}/page/rewards/view.jsx | 4 +- src/{renderer => ui}/page/search/index.js | 0 src/{renderer => ui}/page/search/view.jsx | 39 +- .../page/sendCredits/index.js | 0 .../page/sendCredits/view.jsx | 0 src/{renderer => ui}/page/settings/index.js | 0 src/{renderer => ui}/page/settings/view.jsx | 0 src/{renderer => ui}/page/show/index.js | 0 src/{renderer => ui}/page/show/view.jsx | 0 .../page/subscriptions/index.js | 0 .../page/subscriptions/internal/first-run.jsx | 27 +- .../internal/user-subscriptions.jsx | 6 +- .../page/subscriptions/view.jsx | 0 .../page/transactionHistory/index.js | 0 .../page/transactionHistory/view.jsx | 0 .../page/userHistory/index.js | 0 .../page/userHistory/view.jsx | 0 src/{renderer => ui}/page/wallet/index.js | 0 src/{renderer => ui}/page/wallet/view.jsx | 0 src/{renderer => ui}/redux/actions/app.js | 3 +- .../redux/actions/availability.js | 0 src/{renderer => ui}/redux/actions/content.js | 5 + src/{renderer => ui}/redux/actions/file.js | 2 + .../redux/actions/navigation.js | 0 src/{renderer => ui}/redux/actions/publish.js | 25 +- .../redux/actions/settings.js | 25 +- .../redux/actions/shape_shift.js | 0 .../redux/actions/subscriptions.js | 0 src/{renderer => ui}/redux/reducers/app.js | 0 .../redux/reducers/availability.js | 0 .../redux/reducers/content.js | 0 .../redux/reducers/navigation.js | 0 .../redux/reducers/publish.js | 0 .../redux/reducers/settings.js | 0 .../redux/reducers/shape_shift.js | 4 +- .../redux/reducers/subscriptions.js | 0 src/{renderer => ui}/redux/selectors/app.js | 103 +- .../redux/selectors/availability.js | 5 +- src/ui/redux/selectors/content.js | 95 + src/ui/redux/selectors/file_info.js | 223 + .../redux/selectors/publish.js | 67 +- .../redux/selectors/settings.js | 20 +- .../redux/selectors/shape_shift.js | 9 +- .../redux/selectors/subscriptions.js | 55 +- src/{renderer => ui}/scss/all.scss | 0 .../scss/component/_animation.scss | 0 .../scss/component/_badge.scss | 0 .../scss/component/_banner.scss | 0 .../scss/component/_button.scss | 0 .../scss/component/_card.scss | 1 - .../scss/component/_channel.scss | 0 .../scss/component/_content.scss | 0 .../scss/component/_credit.scss | 0 .../scss/component/_dat-gui.scss | 0 .../scss/component/_expandable.scss | 0 .../scss/component/_file-download.scss | 0 .../scss/component/_file-list.scss | 0 .../scss/component/_file-render.scss | 0 .../scss/component/_form-field.scss | 0 src/ui/scss/component/_form-row.scss | 51 + .../scss/component/_header.scss | 0 .../scss/component/_item-list.scss | 0 .../scss/component/_load-screen.scss | 0 .../scss/component/_main.scss | 0 .../scss/component/_markdown-editor.scss | 0 .../scss/component/_markdown-preview.scss | 0 .../scss/component/_media.scss | 0 .../scss/component/_menu.scss | 0 .../scss/component/_modal.scss | 0 .../scss/component/_navigation.scss | 0 .../scss/component/_notice.scss | 0 .../scss/component/_page.scss | 0 .../scss/component/_pagination.scss | 0 .../scss/component/_placeholder.scss | 0 .../scss/component/_scrollbar.scss | 0 .../scss/component/_search.scss | 0 .../scss/component/_snack-bar.scss | 0 .../scss/component/_spinner.scss | 0 .../scss/component/_subscriptions.scss | 0 .../scss/component/_syntax-highlighter.scss | 0 .../scss/component/_table.scss | 0 .../scss/component/_time.scss | 0 .../scss/component/_toggle.scss | 0 .../scss/component/_tooltip.scss | 0 .../scss/component/_wunderbar.scss | 0 .../scss/component/_yrbl.scss | 0 src/{renderer => ui}/scss/init/_gui.scss | 0 src/{renderer => ui}/scss/init/_mixins.scss | 0 src/ui/scss/init/_reset.scss | 170 + src/{renderer => ui}/scss/init/_type.scss | 0 src/{renderer => ui}/scss/init/_vars.scss | 0 src/{renderer => ui}/store.js | 1 - src/ui/test.jsx | 1 + src/{renderer => ui}/types/claim.js | 0 src/{renderer => ui}/types/common.js | 0 src/{renderer => ui}/types/file_info.js | 0 src/{renderer => ui}/types/redux.js | 0 src/{renderer => ui}/types/reward.js | 0 src/{renderer => ui}/types/status.js | 0 src/{renderer => ui}/types/subscription.js | 0 src/{renderer => ui}/types/transaction.js | 0 src/{renderer => ui}/util/context-menu.js | 0 src/{renderer => ui}/util/debounce.js | 0 src/{renderer => ui}/util/enhanced-layout.js | 0 src/{renderer => ui}/util/form-validation.js | 0 src/{renderer => ui}/util/format-credits.js | 0 src/{renderer => ui}/util/get-media-type.js | 0 src/{renderer => ui}/util/handle-fetch.js | 0 src/{renderer => ui}/util/parse-data.js | 0 src/{renderer => ui}/util/query-params.js | 0 src/{renderer => ui}/util/redux-utils.js | 0 src/{renderer => ui}/util/set-badge.js | 0 src/ui/util/set-progress-bar.js | 15 + src/{renderer => ui}/util/shape_shift.js | 0 src/{renderer => ui}/util/swap-json.js | 0 src/{renderer => ui}/util/throttle.js | 0 static/favicon.ico | Bin 15086 -> 0 bytes static/img/Free-speech-flag.svg | 9 - static/img/default-thumb.svg | 9 - static/img/untitled folder/trayTemplate.png | Bin 1408 -> 0 bytes .../img/untitled folder/trayTemplate@2x.png | Bin 1784 -> 0 bytes static/img/warning.png | Bin 1640 -> 0 bytes static/index.html | 15 + webpack.base.config.js | 87 + webpack.config.js | 126 - webpack.electron.config.js | 61 + webpack.renderer.additions.js | 51 - webpack.web.config.js | 57 + yarn.lock | 7141 ++++++++++------- 440 files changed, 5859 insertions(+), 3991 deletions(-) create mode 100644 .babelrc delete mode 100644 build/extractLocals.js delete mode 100644 electron-webpack.json delete mode 100644 src/common/.gitkeep delete mode 100644 src/main/startSandbox.js rename src/{main => platforms/electron}/Daemon.js (98%) rename src/{main => platforms/electron}/createTray.js (75%) rename src/{main => platforms/electron}/createWindow.js (94%) rename src/{main => platforms/electron}/index.js (91%) rename src/{main => platforms/electron}/menu/setupBarMenu.js (100%) create mode 100644 src/platforms/electron/startSandbox.js rename src/{main => platforms/electron}/unpackByOutpoint.js (100%) create mode 100644 src/platforms/web/electron.js create mode 100644 src/platforms/web/stubs.js delete mode 100644 src/renderer/component/viewers/threeViewer/internal/loader.js delete mode 100644 src/renderer/component/viewers/threeViewer/internal/three.js delete mode 100644 src/renderer/redux/selectors/content.js delete mode 100644 src/renderer/redux/selectors/file_info.js rename src/{renderer => ui}/analytics.js (100%) create mode 100644 src/ui/app.js rename src/{renderer => ui}/component/app/index.js (100%) rename src/{renderer => ui}/component/app/view.jsx (93%) rename src/{renderer => ui}/component/button/index.js (100%) rename src/{renderer => ui}/component/button/view.jsx (100%) rename src/{renderer => ui}/component/cardMedia/index.js (100%) rename {static/img => src/ui/component/cardMedia}/placeholder.png (100%) rename src/{renderer => ui}/component/cardMedia/view.jsx (78%) rename src/{renderer => ui}/component/cardVerify/index.js (100%) rename src/{renderer => ui}/component/cardVerify/view.jsx (99%) rename src/{renderer => ui}/component/categoryList/index.js (100%) rename src/{renderer => ui}/component/categoryList/view.jsx (100%) rename src/{renderer => ui}/component/channelTile/index.js (100%) rename src/{renderer => ui}/component/channelTile/view.jsx (100%) rename src/{renderer => ui}/component/common/busy-indicator.jsx (100%) rename src/{renderer => ui}/component/common/credit-amount.jsx (100%) rename src/{renderer => ui}/component/common/file-exporter.jsx (96%) rename src/{renderer => ui}/component/common/file-selector.jsx (99%) rename src/{renderer => ui}/component/common/form-components/form-field-price.jsx (100%) rename src/{renderer => ui}/component/common/form-components/form-field.jsx (100%) create mode 100644 src/ui/component/common/form-components/form-row.jsx rename src/{renderer => ui}/component/common/form-components/form.jsx (100%) rename src/{renderer => ui}/component/common/form-components/submit.jsx (100%) rename src/{renderer => ui}/component/common/form.jsx (100%) rename src/{renderer => ui}/component/common/icon-custom.jsx (100%) rename src/{renderer => ui}/component/common/icon.jsx (100%) rename src/{renderer => ui}/component/common/lbc-symbol.jsx (100%) rename src/{renderer => ui}/component/common/loading-screen.jsx (100%) rename src/{renderer => ui}/component/common/markdown-preview.jsx (100%) rename src/{renderer => ui}/component/common/qr-code.jsx (100%) rename src/{renderer => ui}/component/common/thumbnail.jsx (100%) rename src/{renderer => ui}/component/common/tooltip.jsx (100%) rename src/{renderer => ui}/component/common/transaction-link.jsx (100%) rename src/{renderer => ui}/component/common/truncated-text.jsx (100%) rename src/{renderer => ui}/component/common/yrbl.jsx (100%) rename src/{renderer => ui}/component/copyableText/index.js (100%) rename src/{renderer => ui}/component/copyableText/view.jsx (100%) rename src/{renderer => ui}/component/dateTime/index.js (100%) rename src/{renderer => ui}/component/dateTime/view.jsx (96%) rename src/{renderer => ui}/component/emailCollection/index.js (100%) rename src/{renderer => ui}/component/emailCollection/view.jsx (100%) rename src/{renderer => ui}/component/expandable/index.js (100%) rename src/{renderer => ui}/component/expandable/view.jsx (100%) rename src/{renderer => ui}/component/externalLink/index.js (100%) rename src/{renderer => ui}/component/externalLink/view.jsx (100%) rename src/{renderer => ui}/component/fileActions/index.js (100%) rename src/{renderer => ui}/component/fileActions/view.jsx (100%) rename src/{renderer => ui}/component/fileCard/index.js (100%) rename src/{renderer => ui}/component/fileCard/view.jsx (100%) rename src/{renderer => ui}/component/fileDetails/index.js (100%) rename src/{renderer => ui}/component/fileDetails/view.jsx (100%) rename src/{renderer => ui}/component/fileDownloadLink/index.js (100%) rename src/{renderer => ui}/component/fileDownloadLink/view.jsx (100%) rename src/{renderer => ui}/component/fileList/index.js (100%) rename src/{renderer => ui}/component/fileList/view.jsx (100%) rename src/{renderer => ui}/component/fileListSearch/index.js (100%) rename src/{renderer => ui}/component/fileListSearch/view.jsx (79%) rename src/{renderer => ui}/component/filePrice/index.js (100%) rename src/{renderer => ui}/component/filePrice/view.jsx (100%) rename src/{renderer => ui}/component/fileRender/index.js (100%) rename src/{renderer => ui}/component/fileRender/view.jsx (100%) rename src/{renderer => ui}/component/fileTile/index.js (100%) rename src/{renderer => ui}/component/fileTile/view.jsx (100%) rename src/{renderer => ui}/component/fileViewer/index.js (100%) rename src/{renderer => ui}/component/fileViewer/internal/play-button.jsx (100%) rename src/{renderer => ui}/component/fileViewer/internal/player.jsx (99%) rename src/{renderer => ui}/component/fileViewer/view.jsx (100%) rename src/{renderer => ui}/component/firstRun/index.js (100%) rename src/{renderer => ui}/component/firstRun/view.jsx (94%) rename src/{renderer => ui}/component/formFieldPrice/index.js (100%) rename src/{renderer => ui}/component/formFieldPrice/view.jsx (100%) rename src/{renderer => ui}/component/header/index.js (100%) rename src/{renderer => ui}/component/header/view.jsx (100%) rename src/{renderer => ui}/component/hiddenNsfwClaims/index.js (100%) rename src/{renderer => ui}/component/hiddenNsfwClaims/view.jsx (100%) rename src/{renderer => ui}/component/inviteList/index.js (100%) rename src/{renderer => ui}/component/inviteList/view.jsx (90%) rename src/{renderer => ui}/component/inviteNew/index.js (100%) rename src/{renderer => ui}/component/inviteNew/view.jsx (100%) rename src/{renderer => ui}/component/nsfwOverlay/index.js (100%) rename src/{renderer => ui}/component/nsfwOverlay/view.jsx (100%) rename src/{renderer => ui}/component/page/index.js (100%) rename src/{renderer => ui}/component/page/view.jsx (100%) rename src/{renderer => ui}/component/publishForm/index.js (100%) rename src/{renderer => ui}/component/publishForm/internal/bid-help-text.jsx (100%) rename src/{renderer => ui}/component/publishForm/internal/license-type.jsx (100%) rename src/{renderer => ui}/component/publishForm/internal/name-help-text.jsx (100%) rename src/{renderer => ui}/component/publishForm/view.jsx (97%) rename src/{renderer => ui}/component/recommendedContent/index.js (100%) rename src/{renderer => ui}/component/recommendedContent/view.jsx (89%) rename src/{renderer => ui}/component/rewardLink/index.js (100%) rename src/{renderer => ui}/component/rewardLink/view.jsx (100%) rename src/{renderer => ui}/component/rewardListClaimed/index.js (100%) rename src/{renderer => ui}/component/rewardListClaimed/view.jsx (98%) rename src/{renderer => ui}/component/rewardSummary/index.js (100%) rename src/{renderer => ui}/component/rewardSummary/view.jsx (100%) rename src/{renderer => ui}/component/rewardTile/index.js (100%) rename src/{renderer => ui}/component/rewardTile/view.jsx (100%) rename src/{renderer => ui}/component/router/index.js (100%) rename src/{renderer => ui}/component/router/view.jsx (100%) rename src/{renderer => ui}/component/searchOptions/index.js (100%) rename src/{renderer => ui}/component/searchOptions/view.jsx (100%) rename src/{renderer => ui}/component/selectChannel/index.js (90%) rename src/{renderer => ui}/component/selectChannel/view.jsx (100%) rename src/{renderer => ui}/component/selectThumbnail/index.js (100%) rename static/img/broken.png => src/ui/component/selectThumbnail/thumbnail-broken.png (100%) rename static/img/no-thumbnail.png => src/ui/component/selectThumbnail/thumbnail-missing.png (100%) rename src/{renderer => ui}/component/selectThumbnail/view.jsx (71%) rename src/{renderer => ui}/component/shapeShift/index.js (73%) rename src/{renderer => ui}/component/shapeShift/internal/active-shift.jsx (92%) rename src/{renderer => ui}/component/shapeShift/internal/form.jsx (100%) rename src/{renderer => ui}/component/shapeShift/internal/market_info.jsx (100%) rename src/{renderer => ui}/component/shapeShift/view.jsx (96%) rename src/{renderer => ui}/component/sideBar/index.js (100%) rename src/{renderer => ui}/component/sideBar/view.jsx (76%) rename src/{renderer => ui}/component/snackBar/index.js (100%) rename src/{renderer => ui}/component/snackBar/view.jsx (88%) rename src/{renderer => ui}/component/socialShare/index.js (100%) rename src/{renderer => ui}/component/socialShare/view.jsx (100%) rename src/{renderer => ui}/component/spinner/index.js (100%) rename src/{renderer => ui}/component/spinner/view.jsx (100%) rename src/{renderer => ui}/component/splash/index.js (100%) rename src/{renderer => ui}/component/splash/internal/load-screen.jsx (100%) rename src/{renderer => ui}/component/splash/view.jsx (96%) rename src/{renderer => ui}/component/subscribeButton/index.js (100%) rename src/{renderer => ui}/component/subscribeButton/view.jsx (100%) rename src/{renderer => ui}/component/subscribeMarkAsRead/index.js (100%) rename src/{renderer => ui}/component/subscribeMarkAsRead/view.jsx (100%) rename src/{renderer => ui}/component/subscribeSuggested/index.js (100%) rename src/{renderer => ui}/component/subscribeSuggested/view.jsx (100%) rename src/{renderer => ui}/component/theme/index.js (100%) rename src/{renderer => ui}/component/theme/view.jsx (100%) rename src/{renderer => ui}/component/transactionList/index.js (100%) rename src/{renderer => ui}/component/transactionList/internal/transaction-list-item.jsx (89%) rename src/{renderer => ui}/component/transactionList/view.jsx (72%) rename src/{renderer => ui}/component/transactionListRecent/index.js (100%) rename src/{renderer => ui}/component/transactionListRecent/view.jsx (90%) rename src/{renderer => ui}/component/transactionRefreshButton/index.js (100%) rename src/{renderer => ui}/component/transactionRefreshButton/view.jsx (100%) rename src/{renderer => ui}/component/uriIndicator/index.js (100%) rename src/{renderer => ui}/component/uriIndicator/view.jsx (100%) rename src/{renderer => ui}/component/userEmailNew/index.js (100%) rename src/{renderer => ui}/component/userEmailNew/view.jsx (100%) rename src/{renderer => ui}/component/userEmailVerify/index.js (100%) rename src/{renderer => ui}/component/userEmailVerify/view.jsx (100%) rename src/{renderer => ui}/component/userHistory/index.js (100%) rename src/{renderer => ui}/component/userHistory/view.jsx (100%) rename src/{renderer => ui}/component/userHistoryItem/index.js (100%) rename src/{renderer => ui}/component/userHistoryItem/view.jsx (100%) rename src/{renderer => ui}/component/userPhoneNew/index.js (100%) rename src/{renderer => ui}/component/userPhoneNew/view.jsx (100%) rename src/{renderer => ui}/component/userPhoneVerify/index.js (100%) rename src/{renderer => ui}/component/userPhoneVerify/view.jsx (100%) rename src/{renderer => ui}/component/userVerify/index.js (100%) rename src/{renderer => ui}/component/userVerify/view.jsx (100%) rename src/{renderer => ui}/component/viewers/audioVideoViewer.jsx (100%) rename src/{renderer => ui}/component/viewers/codeViewer.jsx (100%) rename src/{renderer => ui}/component/viewers/documentViewer.jsx (100%) rename src/{renderer => ui}/component/viewers/docxViewer.jsx (80%) rename src/{renderer => ui}/component/viewers/htmlViewer.jsx (100%) rename src/{renderer => ui}/component/viewers/pdfViewer.jsx (100%) rename src/{renderer => ui}/component/viewers/threeViewer/index.jsx (94%) rename src/{renderer => ui}/component/viewers/threeViewer/internal/detector.js (100%) rename src/{renderer => ui}/component/viewers/threeViewer/internal/grid.js (86%) rename src/{renderer => ui}/component/viewers/threeViewer/internal/renderer.js (91%) rename src/{renderer => ui}/component/viewers/threeViewer/internal/scene.js (96%) rename src/{renderer => ui}/component/walletAddress/index.js (100%) rename src/{renderer => ui}/component/walletAddress/view.jsx (100%) rename static/img/stripe-background.png => src/ui/component/walletBalance/balance-background.png (100%) rename src/{renderer => ui}/component/walletBalance/index.js (100%) rename src/{renderer => ui}/component/walletBalance/view.jsx (91%) rename src/{renderer => ui}/component/walletSend/index.js (100%) rename src/{renderer => ui}/component/walletSend/view.jsx (100%) rename src/{renderer => ui}/component/walletSendTip/index.js (100%) rename src/{renderer => ui}/component/walletSendTip/view.jsx (100%) rename src/{renderer => ui}/component/wunderbar/index.js (100%) rename src/{renderer => ui}/component/wunderbar/internal/autocomplete.jsx (100%) rename src/{renderer => ui}/component/wunderbar/view.jsx (100%) rename {static/img => src/ui/component/yrbl}/gerbil-happy.png (100%) rename {static/img => src/ui/component/yrbl}/gerbil-sad.png (100%) create mode 100644 src/ui/component/yrbl/index.jsx rename src/{renderer => ui}/constants/action_types.js (98%) rename src/{renderer => ui}/constants/claim.js (100%) rename src/{renderer => ui}/constants/content.js (100%) rename src/{renderer => ui}/constants/icons.js (96%) rename src/{renderer => ui}/constants/languages.js (100%) rename src/{renderer => ui}/constants/licenses.js (100%) rename src/{renderer => ui}/constants/modal_types.js (100%) rename src/{renderer => ui}/constants/pages.js (100%) rename src/{renderer => ui}/constants/search.js (100%) rename src/{renderer => ui}/constants/settings.js (100%) rename src/{renderer => ui}/constants/shape_shift.js (100%) rename src/{renderer => ui}/constants/subscriptions.js (100%) rename src/{renderer => ui}/constants/themes.js (100%) rename src/{renderer => ui}/constants/thumbnail_upload_statuses.js (100%) rename src/{renderer => ui}/constants/transaction_types.js (100%) create mode 100644 src/ui/i18n/__.js create mode 100644 src/ui/i18n/__n.js create mode 100644 src/ui/i18n/index.js rename src/{renderer => ui}/index.js (99%) rename src/{renderer => ui}/lbryio.js (100%) rename src/{renderer => ui}/logWarningConsoleMessage.js (100%) rename src/{renderer => ui}/modal/modal.jsx (89%) rename src/{renderer => ui}/modal/modalAffirmPurchase/index.js (100%) rename src/{renderer => ui}/modal/modalAffirmPurchase/view.jsx (100%) rename src/{renderer => ui}/modal/modalAuthFailure/index.js (100%) rename src/{renderer => ui}/modal/modalAuthFailure/view.jsx (100%) rename src/{renderer => ui}/modal/modalAutoUpdateConfirm/index.js (100%) rename src/{renderer => ui}/modal/modalAutoUpdateConfirm/view.jsx (97%) rename src/{renderer => ui}/modal/modalAutoUpdateDownloaded/index.js (100%) rename src/{renderer => ui}/modal/modalAutoUpdateDownloaded/view.jsx (91%) rename src/{renderer => ui}/modal/modalConfirmThumbnailUpload/index.js (100%) rename src/{renderer => ui}/modal/modalConfirmThumbnailUpload/view.jsx (100%) rename src/{renderer => ui}/modal/modalConfirmTransaction/index.js (100%) rename src/{renderer => ui}/modal/modalConfirmTransaction/view.jsx (100%) rename src/{renderer => ui}/modal/modalCreditIntro/index.js (100%) rename src/{renderer => ui}/modal/modalCreditIntro/view.jsx (100%) rename src/{renderer => ui}/modal/modalDownloading/index.js (100%) rename src/{renderer => ui}/modal/modalDownloading/view.jsx (100%) rename src/{renderer => ui}/modal/modalError/index.js (100%) rename src/{renderer => ui}/modal/modalError/view.jsx (83%) rename src/{renderer => ui}/modal/modalFileTimeout/index.js (100%) rename src/{renderer => ui}/modal/modalFileTimeout/view.jsx (100%) rename src/{renderer => ui}/modal/modalFirstReward/index.js (100%) rename src/{renderer => ui}/modal/modalFirstReward/view.jsx (100%) rename src/{renderer => ui}/modal/modalFirstSubscription/index.js (100%) rename src/{renderer => ui}/modal/modalFirstSubscription/view.jsx (100%) rename src/{renderer => ui}/modal/modalIncompatibleDaemon/index.js (100%) rename src/{renderer => ui}/modal/modalIncompatibleDaemon/view.jsx (97%) rename src/{renderer => ui}/modal/modalOpenExternalLink/index.js (100%) rename src/{renderer => ui}/modal/modalOpenExternalLink/view.jsx (97%) rename src/{renderer => ui}/modal/modalPhoneCollection/index.js (100%) rename src/{renderer => ui}/modal/modalPhoneCollection/view.jsx (100%) rename src/{renderer => ui}/modal/modalPublish/index.js (100%) rename src/{renderer => ui}/modal/modalPublish/view.jsx (100%) rename src/{renderer => ui}/modal/modalRemoveFile/index.js (100%) rename src/{renderer => ui}/modal/modalRemoveFile/view.jsx (100%) rename src/{renderer => ui}/modal/modalRevokeClaim/index.js (100%) rename src/{renderer => ui}/modal/modalRevokeClaim/view.jsx (100%) rename src/{renderer => ui}/modal/modalRewardApprovalRequired/index.js (100%) rename src/{renderer => ui}/modal/modalRewardApprovalRequired/view.jsx (100%) rename src/{renderer => ui}/modal/modalRewardCode/index.js (100%) rename src/{renderer => ui}/modal/modalRewardCode/view.jsx (98%) rename src/{renderer => ui}/modal/modalRouter/index.js (100%) rename src/{renderer => ui}/modal/modalRouter/view.jsx (100%) rename src/{renderer => ui}/modal/modalSendTip/index.js (100%) rename src/{renderer => ui}/modal/modalSendTip/view.jsx (100%) rename src/{renderer => ui}/modal/modalSocialShare/index.js (100%) rename src/{renderer => ui}/modal/modalSocialShare/view.jsx (100%) rename src/{renderer => ui}/modal/modalTransactionFailed/index.js (100%) rename src/{renderer => ui}/modal/modalTransactionFailed/view.jsx (100%) rename src/{renderer => ui}/modal/modalUpgrade/index.js (100%) rename src/{renderer => ui}/modal/modalUpgrade/view.jsx (97%) rename src/{renderer => ui}/modal/modalWalletDecrypt/index.js (100%) rename src/{renderer => ui}/modal/modalWalletDecrypt/view.jsx (98%) rename src/{renderer => ui}/modal/modalWalletEncrypt/index.js (100%) rename src/{renderer => ui}/modal/modalWalletEncrypt/view.jsx (99%) rename src/{renderer => ui}/modal/modalWalletUnlock/index.js (100%) rename src/{renderer => ui}/modal/modalWalletUnlock/view.jsx (98%) rename src/{renderer => ui}/modal/modalWelcome/index.js (100%) rename src/{renderer => ui}/modal/modalWelcome/view.jsx (100%) rename src/{renderer => ui}/native.js (94%) rename src/{renderer => ui}/page/auth/index.js (100%) rename src/{renderer => ui}/page/auth/view.jsx (100%) rename src/{renderer => ui}/page/backup/index.js (100%) rename src/{renderer => ui}/page/backup/view.jsx (100%) rename src/{renderer => ui}/page/channel/index.js (100%) rename src/{renderer => ui}/page/channel/view.jsx (71%) rename src/{renderer => ui}/page/discover/index.js (100%) rename src/{renderer => ui}/page/discover/view.jsx (100%) rename src/{renderer => ui}/page/file/index.js (100%) rename src/{renderer => ui}/page/file/view.jsx (100%) rename src/{renderer => ui}/page/fileListDownloaded/index.js (100%) rename src/{renderer => ui}/page/fileListDownloaded/view.jsx (100%) rename src/{renderer => ui}/page/fileListPublished/index.js (100%) rename src/{renderer => ui}/page/fileListPublished/view.jsx (100%) rename src/{renderer => ui}/page/getCredits/index.js (100%) rename src/{renderer => ui}/page/getCredits/view.jsx (100%) rename src/{renderer => ui}/page/help/index.js (100%) rename src/{renderer => ui}/page/help/view.jsx (95%) rename src/{renderer => ui}/page/invite/index.js (100%) rename src/{renderer => ui}/page/invite/view.jsx (74%) rename src/{renderer => ui}/page/publish/index.js (100%) rename src/{renderer => ui}/page/publish/view.jsx (100%) rename src/{renderer => ui}/page/report/index.js (100%) rename src/{renderer => ui}/page/report/view.jsx (100%) rename src/{renderer => ui}/page/rewards/index.js (100%) rename src/{renderer => ui}/page/rewards/view.jsx (98%) rename src/{renderer => ui}/page/search/index.js (100%) rename src/{renderer => ui}/page/search/view.jsx (60%) rename src/{renderer => ui}/page/sendCredits/index.js (100%) rename src/{renderer => ui}/page/sendCredits/view.jsx (100%) rename src/{renderer => ui}/page/settings/index.js (100%) rename src/{renderer => ui}/page/settings/view.jsx (100%) rename src/{renderer => ui}/page/show/index.js (100%) rename src/{renderer => ui}/page/show/view.jsx (100%) rename src/{renderer => ui}/page/subscriptions/index.js (100%) rename src/{renderer => ui}/page/subscriptions/internal/first-run.jsx (68%) rename src/{renderer => ui}/page/subscriptions/internal/user-subscriptions.jsx (96%) rename src/{renderer => ui}/page/subscriptions/view.jsx (100%) rename src/{renderer => ui}/page/transactionHistory/index.js (100%) rename src/{renderer => ui}/page/transactionHistory/view.jsx (100%) rename src/{renderer => ui}/page/userHistory/index.js (100%) rename src/{renderer => ui}/page/userHistory/view.jsx (100%) rename src/{renderer => ui}/page/wallet/index.js (100%) rename src/{renderer => ui}/page/wallet/view.jsx (100%) rename src/{renderer => ui}/redux/actions/app.js (99%) rename src/{renderer => ui}/redux/actions/availability.js (100%) rename src/{renderer => ui}/redux/actions/content.js (99%) rename src/{renderer => ui}/redux/actions/file.js (98%) rename src/{renderer => ui}/redux/actions/navigation.js (100%) rename src/{renderer => ui}/redux/actions/publish.js (96%) rename src/{renderer => ui}/redux/actions/settings.js (88%) rename src/{renderer => ui}/redux/actions/shape_shift.js (100%) rename src/{renderer => ui}/redux/actions/subscriptions.js (100%) rename src/{renderer => ui}/redux/reducers/app.js (100%) rename src/{renderer => ui}/redux/reducers/availability.js (100%) rename src/{renderer => ui}/redux/reducers/content.js (100%) rename src/{renderer => ui}/redux/reducers/navigation.js (100%) rename src/{renderer => ui}/redux/reducers/publish.js (100%) rename src/{renderer => ui}/redux/reducers/settings.js (100%) rename src/{renderer => ui}/redux/reducers/shape_shift.js (97%) rename src/{renderer => ui}/redux/reducers/subscriptions.js (100%) rename src/{renderer => ui}/redux/selectors/app.js (77%) rename src/{renderer => ui}/redux/selectors/availability.js (58%) create mode 100644 src/ui/redux/selectors/content.js create mode 100644 src/ui/redux/selectors/file_info.js rename src/{renderer => ui}/redux/selectors/publish.js (67%) rename src/{renderer => ui}/redux/selectors/settings.js (71%) rename src/{renderer => ui}/redux/selectors/shape_shift.js (57%) rename src/{renderer => ui}/redux/selectors/subscriptions.js (90%) rename src/{renderer => ui}/scss/all.scss (100%) rename src/{renderer => ui}/scss/component/_animation.scss (100%) rename src/{renderer => ui}/scss/component/_badge.scss (100%) rename src/{renderer => ui}/scss/component/_banner.scss (100%) rename src/{renderer => ui}/scss/component/_button.scss (100%) rename src/{renderer => ui}/scss/component/_card.scss (98%) rename src/{renderer => ui}/scss/component/_channel.scss (100%) rename src/{renderer => ui}/scss/component/_content.scss (100%) rename src/{renderer => ui}/scss/component/_credit.scss (100%) rename src/{renderer => ui}/scss/component/_dat-gui.scss (100%) rename src/{renderer => ui}/scss/component/_expandable.scss (100%) rename src/{renderer => ui}/scss/component/_file-download.scss (100%) rename src/{renderer => ui}/scss/component/_file-list.scss (100%) rename src/{renderer => ui}/scss/component/_file-render.scss (100%) rename src/{renderer => ui}/scss/component/_form-field.scss (100%) create mode 100644 src/ui/scss/component/_form-row.scss rename src/{renderer => ui}/scss/component/_header.scss (100%) rename src/{renderer => ui}/scss/component/_item-list.scss (100%) rename src/{renderer => ui}/scss/component/_load-screen.scss (100%) rename src/{renderer => ui}/scss/component/_main.scss (100%) rename src/{renderer => ui}/scss/component/_markdown-editor.scss (100%) rename src/{renderer => ui}/scss/component/_markdown-preview.scss (100%) rename src/{renderer => ui}/scss/component/_media.scss (100%) rename src/{renderer => ui}/scss/component/_menu.scss (100%) rename src/{renderer => ui}/scss/component/_modal.scss (100%) rename src/{renderer => ui}/scss/component/_navigation.scss (100%) rename src/{renderer => ui}/scss/component/_notice.scss (100%) rename src/{renderer => ui}/scss/component/_page.scss (100%) rename src/{renderer => ui}/scss/component/_pagination.scss (100%) rename src/{renderer => ui}/scss/component/_placeholder.scss (100%) rename src/{renderer => ui}/scss/component/_scrollbar.scss (100%) rename src/{renderer => ui}/scss/component/_search.scss (100%) rename src/{renderer => ui}/scss/component/_snack-bar.scss (100%) rename src/{renderer => ui}/scss/component/_spinner.scss (100%) rename src/{renderer => ui}/scss/component/_subscriptions.scss (100%) rename src/{renderer => ui}/scss/component/_syntax-highlighter.scss (100%) rename src/{renderer => ui}/scss/component/_table.scss (100%) rename src/{renderer => ui}/scss/component/_time.scss (100%) rename src/{renderer => ui}/scss/component/_toggle.scss (100%) rename src/{renderer => ui}/scss/component/_tooltip.scss (100%) rename src/{renderer => ui}/scss/component/_wunderbar.scss (100%) rename src/{renderer => ui}/scss/component/_yrbl.scss (100%) rename src/{renderer => ui}/scss/init/_gui.scss (100%) rename src/{renderer => ui}/scss/init/_mixins.scss (100%) create mode 100644 src/ui/scss/init/_reset.scss rename src/{renderer => ui}/scss/init/_type.scss (100%) rename src/{renderer => ui}/scss/init/_vars.scss (100%) rename src/{renderer => ui}/store.js (98%) create mode 100644 src/ui/test.jsx rename src/{renderer => ui}/types/claim.js (100%) rename src/{renderer => ui}/types/common.js (100%) rename src/{renderer => ui}/types/file_info.js (100%) rename src/{renderer => ui}/types/redux.js (100%) rename src/{renderer => ui}/types/reward.js (100%) rename src/{renderer => ui}/types/status.js (100%) rename src/{renderer => ui}/types/subscription.js (100%) rename src/{renderer => ui}/types/transaction.js (100%) rename src/{renderer => ui}/util/context-menu.js (100%) rename src/{renderer => ui}/util/debounce.js (100%) rename src/{renderer => ui}/util/enhanced-layout.js (100%) rename src/{renderer => ui}/util/form-validation.js (100%) rename src/{renderer => ui}/util/format-credits.js (100%) rename src/{renderer => ui}/util/get-media-type.js (100%) rename src/{renderer => ui}/util/handle-fetch.js (100%) rename src/{renderer => ui}/util/parse-data.js (100%) rename src/{renderer => ui}/util/query-params.js (100%) rename src/{renderer => ui}/util/redux-utils.js (100%) rename src/{renderer => ui}/util/set-badge.js (100%) create mode 100644 src/ui/util/set-progress-bar.js rename src/{renderer => ui}/util/shape_shift.js (100%) rename src/{renderer => ui}/util/swap-json.js (100%) rename src/{renderer => ui}/util/throttle.js (100%) delete mode 100644 static/favicon.ico delete mode 100644 static/img/Free-speech-flag.svg delete mode 100644 static/img/default-thumb.svg delete mode 100644 static/img/untitled folder/trayTemplate.png delete mode 100644 static/img/untitled folder/trayTemplate@2x.png delete mode 100644 static/img/warning.png create mode 100644 static/index.html create mode 100644 webpack.base.config.js delete mode 100644 webpack.config.js create mode 100644 webpack.electron.config.js delete mode 100644 webpack.renderer.additions.js create mode 100644 webpack.web.config.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 000000000..bdb6f4690 --- /dev/null +++ b/.babelrc @@ -0,0 +1,9 @@ +{ + "presets": ["@babel/react", "@babel/flow"], + "plugins": [ + ["@babel/plugin-proposal-decorators", { "decoratorsBeforeExport": true }], + "@babel/plugin-transform-flow-strip-types", + "@babel/plugin-proposal-class-properties", + "babel-plugin-add-module-exports" + ] +} diff --git a/.eslintrc.json b/.eslintrc.json index da6314749..f4c871a6e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,13 +6,6 @@ "plugin:flowtype/recommended", "plugin:prettier/recommended" ], - "settings": { - "import/resolver": { - "webpack": { - "config": "webpack.renderer.additions.js" - } - } - }, "parser": "babel-eslint", "env": { "browser": true, @@ -20,7 +13,7 @@ }, "globals": { "__static": true, - "staticResourcesPath": true, + "i18n": true, "__": true, "__n": true, "app": true @@ -59,6 +52,7 @@ "no-empty": 0, "react/prefer-stateless-function": 0, "react/sort-comp": 0, - "jsx-a11y/media-has-caption": 0 + "jsx-a11y/media-has-caption": 0, + "no-underscore-dangle": 0 } } diff --git a/.gitignore b/.gitignore index 66302821f..f2c9a9677 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .DS_Store /node_modules /dist -/static/daemon/lbrynet* +/static/lbrynet /static/locales yarn-error.log package-lock.json diff --git a/build/downloadDaemon.js b/build/downloadDaemon.js index 3423686f1..9de61283c 100644 --- a/build/downloadDaemon.js +++ b/build/downloadDaemon.js @@ -89,8 +89,4 @@ const downloadDaemon = targetPlatform => } }); -module.exports = downloadDaemon; - -require('make-runnable/custom')({ - printOutputFrame: false, -}); +downloadDaemon(); diff --git a/build/extractLocals.js b/build/extractLocals.js deleted file mode 100644 index 8f48b1492..000000000 --- a/build/extractLocals.js +++ /dev/null @@ -1,49 +0,0 @@ -const extract = require("i18n-extract"); -const fs = require("fs"); -const path = require("path"); - -const outputDir = `${__dirname}/../static/locales`; -const outputPath = `${outputDir}/en.json`; - -if (!fs.existsSync(outputDir)) { - fs.mkdirSync(outputDir); -} - -fs.writeFile(outputPath, "{}", "utf8", err => { - if (err) { - return console.log(err); - } - const enLocale = require(outputPath); - - const keys = extract.extractFromFiles("src/**/*.{js,jsx}", { - marker: "__", - }); - - let reports = []; - reports = reports.concat(extract.findMissing(enLocale, keys)); - - if (reports.length > 0) { - fs.readFile(outputPath, "utf8", (err, data) => { - if (err) { - console.log(err); - } else { - localeObj = JSON.parse(data); - - for (let i = 0; i < reports.length; i++) { - // no need to care for other types than MISSING because starting file will always be empty - if (reports[i].type === "MISSING") { - localeObj[reports[i].key] = reports[i].key; - } - } - - const json = JSON.stringify(localeObj, null, "\t"); // convert it back to json-string - fs.writeFile(outputPath, json, "utf8", err => { - if (err) { - throw err; - } - console.log("Extracted all strings!"); - }); - } - }); - } -}); diff --git a/electron-builder.json b/electron-builder.json index abdd40022..c6cff35e8 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -1,6 +1,9 @@ { "appId": "io.lbry.LBRY", "productName": "LBRY", + "directories": { + "output": "dist/electron" + }, "publish": [ { "provider": "s3", @@ -44,6 +47,7 @@ ], "linux": { "target": "deb", + "executableName": "LBRY", "category": "AudioVideo;Video", "desktop": { "MimeType": "x-scheme-handler/lbry", diff --git a/electron-webpack.json b/electron-webpack.json deleted file mode 100644 index 8ba1c275c..000000000 --- a/electron-webpack.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "renderer": { - "webpackConfig": "webpack.renderer.additions.js" - } -} diff --git a/package.json b/package.json index 25aadf41f..bccd3b226 100644 --- a/package.json +++ b/package.json @@ -18,16 +18,15 @@ "name": "LBRY Inc.", "email": "hello@lbry.io" }, - "main": "src/main/index.js", + "main": "./dist/main/main.js", "scripts": { - "extract-langs": "node build/extractLocals.js", - "compile": "electron-webpack && yarn extract-langs", + "compile:electron": "webpack --progress --config webpack.electron.config.js", + "compile:web": "webpack --progress --config webpack.web.config.js", + "compile": "yarn compile:electron && yarn compile:web", "build": "yarn compile && electron-builder build", "build:dir": "yarn build -- --dir -c.compression=store -c.mac.identity=null", - "build:web": "webpack", - "dev": "electron-webpack dev", - "dev:internal-apis": "LBRY_API_URL='http://localhost:8080' yarn dev", - "dev:web": "webpack --watch", + "dev:electron": "yarn compile:electron && electron ./dist/electron/main/bundle.js", + "dev:internal-apis": "LBRY_API_URL='http://localhost:8080' yarn dev:electron", "lint": "eslint 'src/**/*.{js,jsx}' --fix && flow", "format": "prettier 'src/**/*.{js,jsx,scss,json}' --write", "flow-defs": "flow-typed install", @@ -36,10 +35,9 @@ "postinstall": "electron-builder install-app-deps && node build/downloadDaemon.js" }, "dependencies": { - "@lbry/components": "^2.2.4", + "@babel/polyfill": "^7.2.5", "@types/three": "^0.93.1", "bluebird": "^3.5.1", - "breakdance": "^3.0.1", "classnames": "^2.2.5", "codemirror": "^5.39.2", "country-data": "^0.0.31", @@ -48,12 +46,12 @@ "electron-dl": "^1.11.0", "electron-is-dev": "^0.3.0", "electron-log": "^2.2.12", - "electron-updater": "^2.23.3", + "electron-updater": "^4.0.0", "electron-window-state": "^4.1.1", "express": "^4.16.4", "formik": "^0.10.4", "hast-util-sanitize": "^1.1.2", - "keytar": "^4.2.1", + "keytar": "^4.3.0", "lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-redux": "lbryio/lbry-redux#406e1970b9d5594faf0407100c9bbed45d904cdf", "lbryinc": "lbryio/lbryinc#2334ad53e82c22d6291899785d5292347008f2a9", @@ -62,8 +60,10 @@ "mime": "^2.3.1", "mixpanel-browser": "^2.17.1", "moment": "^2.22.0", + "node-abi": "^2.5.1", "node-fetch": "^2.3.0", "preprocess-loader": "^0.3.0", + "prop-types": "^15.6.2", "qrcode.react": "^0.8.0", "rc-progress": "^2.0.6", "react": "^16.8.2", @@ -86,28 +86,37 @@ "render-media": "^3.1.0", "reselect": "^3.0.0", "semver": "^5.3.0", - "source-map-support": "^0.5.4", + "source-map-support": "^0.5.10", + "stream-to-blob-url": "^2.1.1", "three": "^0.93.0", + "three-full": "^11.3.2", "tree-kill": "^1.1.0", "video.js": "^7.2.2", "y18n": "^4.0.0" }, "devDependencies": { - "babel-eslint": "^8.2.2", - "babel-plugin-module-resolver": "^3.1.1", - "babel-polyfill": "^6.26.0", - "babel-preset-env": "^1.6.1", - "babel-preset-react": "^6.24.1", - "babel-preset-stage-2": "^6.18.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-decorators": "^7.3.0", + "@babel/plugin-transform-flow-strip-types": "^7.2.3", + "@babel/preset-flow": "^7.0.0", + "@babel/preset-react": "^7.0.0", + "@lbry/color": "^1.0.2", + "@lbry/components": "^2.2.4", + "async-exit-hook": "^2.0.1", + "babel-eslint": "^10.0.1", + "babel-loader": "^8.0.5", + "babel-plugin-add-module-exports": "^1.0.0", "copy-webpack-plugin": "^4.6.0", + "css-loader": "^2.1.0", "decompress": "^4.2.0", "del": "^3.0.0", "devtron": "^1.4.0", - "electron": "^2.0.14", - "electron-builder": "^20.22.0", + "electron": "^4.0.4", + "electron-builder": "^20.38.4", "electron-devtools-installer": "^2.2.3", "electron-publisher-s3": "^20.8.1", - "electron-webpack": "^1.13.0", + "electron-webpack": "^2.6.2", "eslint": "^4.19.0", "eslint-config-airbnb": "^16.1.0", "eslint-config-prettier": "^2.9.0", @@ -121,17 +130,21 @@ "flow-bin": "^0.89.0", "flow-typed": "^2.3.0", "husky": "^0.14.3", - "i18n-extract": "^0.5.1", "json-loader": "^0.5.4", "lint-staged": "^7.0.2", "make-runnable": "^1.3.6", "node-libs-browser": "^2.1.0", "node-loader": "^0.6.0", "node-sass": "^4.11.0", + "preprocess-loader": "^0.3.0", "prettier": "^1.11.1", - "sass-loader": "^6.0.7", - "webpack": "^3.10.0", + "sass-loader": "^7.1.0", + "style-loader": "^0.23.1", + "webpack": "^4.28.4", "webpack-build-notifier": "^0.1.23", + "webpack-dev-server": "^3.1.14", + "webpack-merge": "^4.2.1", + "webpack-node-externals": "^1.7.2", "yarnhook": "^0.2.0" }, "engines": { @@ -141,7 +154,7 @@ "lbrySettings": { "lbrynetDaemonVersion": "0.32.4", "lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip", - "lbrynetDaemonDir": "static/daemon", + "lbrynetDaemonDir": "static", "lbrynetDaemonFileName": "lbrynet" } } diff --git a/src/common/.gitkeep b/src/common/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/main/startSandbox.js b/src/main/startSandbox.js deleted file mode 100644 index 48b9b2043..000000000 --- a/src/main/startSandbox.js +++ /dev/null @@ -1,28 +0,0 @@ -import express from 'express'; -import unpackByOutpoint from './unpackByOutpoint'; - -// Polyfills and `lbry-redux` -global.fetch = require('node-fetch'); - -global.window = global; -// eslint-disable-next-line import/no-commonjs,global-require -const { Lbry } = require('lbry-redux'); - -delete global.window; - -export default async function startSandbox() { - const sandbox = express(); - const port = 5278; - - sandbox.get('/set/:outpoint', async (req, res) => { - const { outpoint } = req.params; - const resolvedPath = await unpackByOutpoint(Lbry, outpoint); - - sandbox.use(`/sandbox/${outpoint}/`, express.static(resolvedPath)); - - res.send(`/sandbox/${outpoint}/`); - }); - - // eslint-disable-next-line no-console - sandbox.listen(port, 'localhost', () => console.log(`Sandbox listening on port ${port}.`)); -} diff --git a/src/main/Daemon.js b/src/platforms/electron/Daemon.js similarity index 98% rename from src/main/Daemon.js rename to src/platforms/electron/Daemon.js index 8525eb8fc..43e0573d9 100644 --- a/src/main/Daemon.js +++ b/src/platforms/electron/Daemon.js @@ -4,7 +4,7 @@ import { spawn, execSync } from 'child_process'; import { Lbry } from 'lbry-redux'; export default class Daemon { - static path = process.env.LBRY_DAEMON || path.join(__static, 'daemon/lbrynet'); + static path = process.env.LBRY_DAEMON || path.join(__static, 'lbrynet'); subprocess; handlers; diff --git a/src/main/createTray.js b/src/platforms/electron/createTray.js similarity index 75% rename from src/main/createTray.js rename to src/platforms/electron/createTray.js index c8ed9ba95..55d9586ac 100644 --- a/src/main/createTray.js +++ b/src/platforms/electron/createTray.js @@ -5,15 +5,15 @@ export default window => { let iconPath; switch (process.platform) { case 'darwin': { - iconPath = path.join(__static, '/img/tray/mac/trayTemplate.png'); + iconPath = 'static/img/tray/mac/trayTemplate.png'; break; } case 'win32': { - iconPath = path.join(__static, '/img/tray/windows/tray.ico'); + iconPath = 'static/img/tray/windows/tray.ico'; break; } default: { - iconPath = path.join(__static, '/img/tray/default/tray.png'); + iconPath = 'static/img/tray/default/tray.png'; } } diff --git a/src/main/createWindow.js b/src/platforms/electron/createWindow.js similarity index 94% rename from src/main/createWindow.js rename to src/platforms/electron/createWindow.js index ff4f5e76b..5612ecf21 100644 --- a/src/main/createWindow.js +++ b/src/platforms/electron/createWindow.js @@ -1,3 +1,4 @@ +import path from 'path'; import { app, BrowserWindow, dialog, shell, screen } from 'electron'; import isDev from 'electron-is-dev'; import windowStateKeeper from 'electron-window-state'; @@ -34,8 +35,8 @@ export default appState => { }, }; - const rendererURL = isDev - ? `http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}` + const rendererURL = isDev // ? `http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}` + ? `file://${path.resolve(__dirname, '../index.html')}` : `file://${__dirname}/index.html`; let window = new BrowserWindow(windowConfiguration); @@ -45,6 +46,8 @@ export default appState => { // and restore the maximized or full screen state. windowState.manage(window); + console.log('url', rendererURL); + console.log('window', window); window.loadURL(rendererURL); let deepLinkingURI; diff --git a/src/main/index.js b/src/platforms/electron/index.js similarity index 91% rename from src/main/index.js rename to src/platforms/electron/index.js index e31642e6c..4bfc2db64 100644 --- a/src/main/index.js +++ b/src/platforms/electron/index.js @@ -1,6 +1,6 @@ /* eslint-disable no-console */ // Module imports -// @if TARGET='app' +import '@babel/polyfill'; import keytar from 'keytar'; import SemVer from 'semver'; import url from 'url'; @@ -12,8 +12,8 @@ import { Lbry } from 'lbry-redux'; import Daemon from './Daemon'; import createTray from './createTray'; import createWindow from './createWindow'; -import pjson from '../../package.json'; -import startSandbox from './startSandbox'; +import pjson from '../../../package.json'; +// import startSandbox from './startSandbox'; autoUpdater.autoDownload = true; @@ -29,26 +29,20 @@ let showingAutoUpdateCloseAlert = false; // Keep a global reference, if you don't, they will be closed automatically when the JavaScript // object is garbage collected. let rendererWindow; -// eslint-disable-next-line no-unused-vars + let tray; let daemon; const appState = {}; const installExtensions = async () => { - // eslint-disable-next-line import/no-extraneous-dependencies,global-require - const installer = require('electron-devtools-installer'); - // eslint-disable-next-line import/no-extraneous-dependencies,global-require - const devtronExtension = require('devtron'); - const forceDownload = !!process.env.UPGRADE_EXTENSIONS; - const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS']; - - return Promise.all( - extensions.map( - name => installer.default(installer[name], forceDownload), - devtronExtension.install() - ) - ).catch(console.log); + // // eslint-disable-next-line import/no-extraneous-dependencies,global-require + // const installer = require('electron-devtools-installer'); + // // eslint-disable-next-line import/no-extraneous-dependencies,global-require + // const devtronExtension = require('devtron'); + // const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS']; + // await devtronExtension.install(); + // return Promise.all(extensions.map(name => installer.default(installer[name]))).catch(console.log); }; app.setAsDefaultProtocolClient('lbry'); @@ -95,7 +89,7 @@ app.on('ready', async () => { daemon.launch(); } - startSandbox(); + // startSandbox(); if (isDev) { await installExtensions(); @@ -295,7 +289,8 @@ process.on('uncaughtException', error => { }); // Force single instance application -const isSecondInstance = app.makeSingleInstance(argv => { +app.requestSingleInstanceLock(); +app.on('second-instance', (event, argv) => { if (rendererWindow) { if ( (process.platform === 'win32' || process.platform === 'linux') && @@ -323,8 +318,3 @@ const isSecondInstance = app.makeSingleInstance(argv => { rendererWindow.show(); } }); - -if (isSecondInstance) { - app.exit(); -} -// @endif diff --git a/src/main/menu/setupBarMenu.js b/src/platforms/electron/menu/setupBarMenu.js similarity index 100% rename from src/main/menu/setupBarMenu.js rename to src/platforms/electron/menu/setupBarMenu.js diff --git a/src/platforms/electron/startSandbox.js b/src/platforms/electron/startSandbox.js new file mode 100644 index 000000000..3b0de06ae --- /dev/null +++ b/src/platforms/electron/startSandbox.js @@ -0,0 +1,28 @@ +// import express from 'express'; +// import unpackByOutpoint from './unpackByOutpoint'; + +// // Polyfills and `lbry-redux` +// global.fetch = require('node-fetch'); + +// global.window = global; +// // eslint-disable-next-line import/no-commonjs,global-require +// const { Lbry } = require('lbry-redux'); + +// delete global.window; + +// export default async function startSandbox() { +// const sandbox = express(); +// const port = 5278; + +// sandbox.get('/set/:outpoint', async (req, res) => { +// const { outpoint } = req.params; +// const resolvedPath = await unpackByOutpoint(Lbry, outpoint); + +// sandbox.use(`/sandbox/${outpoint}/`, express.static(resolvedPath)); + +// res.send(`/sandbox/${outpoint}/`); +// }); + +// // eslint-disable-next-line no-console +// sandbox.listen(port, 'localhost', () => console.log(`Sandbox listening on port ${port}.`)); +// } diff --git a/src/main/unpackByOutpoint.js b/src/platforms/electron/unpackByOutpoint.js similarity index 100% rename from src/main/unpackByOutpoint.js rename to src/platforms/electron/unpackByOutpoint.js diff --git a/src/platforms/web/electron.js b/src/platforms/web/electron.js new file mode 100644 index 000000000..7988d4971 --- /dev/null +++ b/src/platforms/web/electron.js @@ -0,0 +1,11 @@ +export const clipboard = () => { + throw 'Fix me!'; +}; + +export const ipcRenderer = () => { + throw 'Fix me!'; +}; + +export const remote = () => { + throw 'Fix me!'; +}; diff --git a/src/platforms/web/stubs.js b/src/platforms/web/stubs.js new file mode 100644 index 000000000..fc2a22f96 --- /dev/null +++ b/src/platforms/web/stubs.js @@ -0,0 +1,23 @@ +const callable = () => { + throw Error('Need to fix this stub'); +}; +const returningCallable = value => () => value; + +export const remote = { + dialog: { + showOpenDialog: callable, + }, + getCurrentWindow: callable, + app: { + getAppPath: callable, + }, + BrowserWindow: { + getFocusedWindow: callable, + }, + Menu: { + getApplicationMenu: callable, + }, + require: callable, +}; + +export const isDev = false; diff --git a/src/renderer/component/viewers/threeViewer/internal/loader.js b/src/renderer/component/viewers/threeViewer/internal/loader.js deleted file mode 100644 index b2ca37f8d..000000000 --- a/src/renderer/component/viewers/threeViewer/internal/loader.js +++ /dev/null @@ -1,33 +0,0 @@ -import { LoadingManager, STLLoader, OBJLoader2 } from './three'; - -const Manager = ({ onLoad, onStart, onError }) => { - const manager = new LoadingManager(); - manager.onLoad = onLoad; - manager.onStart = onStart; - manager.onError = onError; - - return manager; -}; - -const Loader = (fileType, manager) => { - const fileTypes = { - stl: () => new STLLoader(manager), - obj: () => new OBJLoader2(manager), - }; - return fileTypes[fileType] ? fileTypes[fileType]() : null; -}; - -const ThreeLoader = ({ fileType = null, downloadPath = null }, renderModel, managerEvents) => { - if (fileType) { - const manager = Manager(managerEvents); - const loader = Loader(fileType, manager); - - if (loader) { - loader.load(`file://${downloadPath}`, data => { - renderModel(fileType, data); - }); - } - } -}; - -export default ThreeLoader; diff --git a/src/renderer/component/viewers/threeViewer/internal/three.js b/src/renderer/component/viewers/threeViewer/internal/three.js deleted file mode 100644 index 4e9f9bdb1..000000000 --- a/src/renderer/component/viewers/threeViewer/internal/three.js +++ /dev/null @@ -1,11 +0,0 @@ -import * as THREE from 'three'; - -// Currently it's not possible to import the files within the "examples/js" directory. -// Fix: https://github.com/mrdoob/three.js/issues/9562#issuecomment-383390251 -global.THREE = THREE; -require('three/examples/js/controls/OrbitControls'); -require('three/examples/js/loaders/LoaderSupport'); -require('three/examples/js/loaders/OBJLoader2'); -require('three/examples/js/loaders/STLLoader'); - -module.exports = global.THREE; diff --git a/src/renderer/redux/selectors/content.js b/src/renderer/redux/selectors/content.js deleted file mode 100644 index c43469121..000000000 --- a/src/renderer/redux/selectors/content.js +++ /dev/null @@ -1,74 +0,0 @@ -// @flow -import { createSelector } from 'reselect'; -import { - makeSelectClaimForUri, - selectClaimsByUri, - makeSelectClaimsInChannelForCurrentPage, -} from 'lbry-redux'; -import { HISTORY_ITEMS_PER_PAGE } from 'constants/content'; - -export const selectState = (state: any) => state.content || {}; - -export const selectPlayingUri = createSelector(selectState, state => state.playingUri); - -export const selectChannelClaimCounts = createSelector( - selectState, - state => state.channelClaimCounts || {} -); - -export const makeSelectTotalItemsForChannel = (uri: string) => - createSelector(selectChannelClaimCounts, byUri => byUri && byUri[uri]); - -export const selectRewardContentClaimIds = createSelector( - selectState, - state => state.rewardedContentClaimIds -); - -export const makeSelectContentPositionForUri = (uri: string) => - createSelector(selectState, makeSelectClaimForUri(uri), (state, claim) => { - if (!claim) { - return null; - } - const outpoint = `${claim.txid}:${claim.nout}`; - const id = claim.claim_id; - return state.positions[id] ? state.positions[id][outpoint] : null; - }); - -export const selectHistoryPageCount = createSelector(selectState, state => - Math.ceil(state.history.length / HISTORY_ITEMS_PER_PAGE) -); - -export const makeSelectHistoryForPage = (page: number) => - createSelector(selectState, selectClaimsByUri, (state, claimsByUri) => { - const left = page * HISTORY_ITEMS_PER_PAGE; - const historyItems = state.history.slice(left, left + HISTORY_ITEMS_PER_PAGE); - - // See if we have the claim info for the uris in your history - // If not, it will need to be fetched in the component - return historyItems.map(historyItem => { - const { uri, lastViewed } = historyItem; - const claimAtUri = claimsByUri[uri]; - - if (claimAtUri) { - return { lastViewed, uri, ...claimAtUri }; - } - return historyItem; - }); - }); - -export const makeSelectHistoryForUri = (uri: string) => - createSelector(selectState, state => state.history.find(i => i.uri === uri)); - -export const makeSelectCategoryListUris = (uris: ?Array, channel: string) => - createSelector(makeSelectClaimsInChannelForCurrentPage(channel), channelClaims => { - if (uris) return uris; - - if (channelClaims) { - const CATEGORY_LIST_SIZE = 10; - return channelClaims - .slice(0, CATEGORY_LIST_SIZE) - .map(({ name, claim_id: claimId }) => `${name}#${claimId}`); - } - - return null; - }); diff --git a/src/renderer/redux/selectors/file_info.js b/src/renderer/redux/selectors/file_info.js deleted file mode 100644 index d49f2e9a2..000000000 --- a/src/renderer/redux/selectors/file_info.js +++ /dev/null @@ -1,199 +0,0 @@ -import { - selectClaimsByUri, - selectIsFetchingClaimListMine, - selectMyClaims, - selectClaimsById, - buildURI, -} from 'lbry-redux'; -import { createSelector } from 'reselect'; - -export const selectState = state => state.fileInfo || {}; - -export const selectFileInfosByOutpoint = createSelector( - selectState, - state => state.byOutpoint || {} -); - -export const selectIsFetchingFileList = createSelector( - selectState, - state => state.isFetchingFileList -); - -export const selectIsFetchingFileListDownloadedOrPublished = createSelector( - selectIsFetchingFileList, - selectIsFetchingClaimListMine, - (isFetchingFileList, isFetchingClaimListMine) => isFetchingFileList || isFetchingClaimListMine -); - -export const makeSelectFileInfoForUri = uri => - createSelector(selectClaimsByUri, selectFileInfosByOutpoint, (claims, byOutpoint) => { - const claim = claims[uri]; - const outpoint = claim ? `${claim.txid}:${claim.nout}` : undefined; - return outpoint ? byOutpoint[outpoint] : undefined; - }); - -export const selectDownloadingByOutpoint = createSelector( - selectState, - state => state.downloadingByOutpoint || {} -); - -export const makeSelectDownloadingForUri = uri => - createSelector( - selectDownloadingByOutpoint, - makeSelectFileInfoForUri(uri), - (byOutpoint, fileInfo) => { - if (!fileInfo) return false; - return byOutpoint[fileInfo.outpoint]; - } - ); - -export const selectUrisLoading = createSelector(selectState, state => state.urisLoading || {}); - -export const makeSelectLoadingForUri = uri => - createSelector(selectUrisLoading, byUri => byUri && byUri[uri]); - -export const selectFileInfosDownloaded = createSelector( - selectFileInfosByOutpoint, - selectMyClaims, - (byOutpoint, myClaims) => - Object.values(byOutpoint).filter(fileInfo => { - const myClaimIds = myClaims.map(claim => claim.claim_id); - - return ( - fileInfo && - myClaimIds.indexOf(fileInfo.claim_id) === -1 && - (fileInfo.completed || fileInfo.written_bytes) - ); - }) -); - -// export const selectFileInfoForUri = (state, props) => { -// const claims = selectClaimsByUri(state), -// claim = claims[props.uri], -// fileInfos = selectAllFileInfos(state), -// outpoint = claim ? `${claim.txid}:${claim.nout}` : undefined; - -// return outpoint && fileInfos ? fileInfos[outpoint] : undefined; -// }; - -export const selectDownloadingFileInfos = createSelector( - selectDownloadingByOutpoint, - selectFileInfosByOutpoint, - (downloadingByOutpoint, fileInfosByOutpoint) => { - const outpoints = Object.keys(downloadingByOutpoint); - const fileInfos = []; - - outpoints.forEach(outpoint => { - const fileInfo = fileInfosByOutpoint[outpoint]; - - if (fileInfo) fileInfos.push(fileInfo); - }); - - return fileInfos; - } -); - -export const selectTotalDownloadProgress = createSelector(selectDownloadingFileInfos, fileInfos => { - const progress = []; - - fileInfos.forEach(fileInfo => { - progress.push((fileInfo.written_bytes / fileInfo.total_bytes) * 100); - }); - - const totalProgress = progress.reduce((a, b) => a + b, 0); - - if (fileInfos.length > 0) return totalProgress / fileInfos.length / 100.0; - return -1; -}); - -export const selectSearchDownloadUris = query => - createSelector(selectFileInfosDownloaded, selectClaimsById, (fileInfos, claimsById) => { - if (!query || !fileInfos.length) { - return null; - } - - const queryParts = query.toLowerCase().split(' '); - const searchQueryDictionary = {}; - queryParts.forEach(subQuery => { - searchQueryDictionary[subQuery] = subQuery; - }); - - const arrayContainsQueryPart = array => { - for (let i = 0; i < array.length; i += 1) { - const subQuery = array[i]; - if (searchQueryDictionary[subQuery]) { - return true; - } - } - return false; - }; - - const downloadResultsFromQuery = []; - fileInfos.forEach(fileInfo => { - const { channel_name: channelName, claim_name: claimName, metadata } = fileInfo; - const { author, description, title } = metadata; - - if (channelName) { - const lowerCaseChannel = channelName.toLowerCase(); - const strippedOutChannelName = lowerCaseChannel.slice(1); // trim off the @ - if (searchQueryDictionary[channelName] || searchQueryDictionary[strippedOutChannelName]) { - downloadResultsFromQuery.push(fileInfo); - return; - } - } - - const nameParts = claimName.toLowerCase().split('-'); - if (arrayContainsQueryPart(nameParts)) { - downloadResultsFromQuery.push(fileInfo); - return; - } - - const titleParts = title.toLowerCase().split(' '); - if (arrayContainsQueryPart(titleParts)) { - downloadResultsFromQuery.push(fileInfo); - return; - } - - if (author) { - const authorParts = author.toLowerCase().split(' '); - if (arrayContainsQueryPart(authorParts)) { - downloadResultsFromQuery.push(fileInfo); - return; - } - } - - if (description) { - const descriptionParts = description.toLowerCase().split(' '); - if (arrayContainsQueryPart(descriptionParts)) { - downloadResultsFromQuery.push(fileInfo); - } - } - }); - - return downloadResultsFromQuery.length - ? downloadResultsFromQuery.map(fileInfo => { - const { channel_name: channelName, claim_id: claimId, claim_name: claimName } = fileInfo; - - const uriParams = {}; - - if (channelName) { - const claim = claimsById[claimId]; - if (claim && claim.value) { - uriParams.claimId = claim.value.publisherSignature.certificateId; - } else { - uriParams.claimId = claimId; - } - uriParams.channelName = channelName; - uriParams.contentName = claimName; - } else { - uriParams.claimId = claimId; - uriParams.claimName = claimName; - } - - const uri = buildURI(uriParams); - return uri; - }) - : null; - }); - -export const selectFileInfoErrors = createSelector(selectState, state => state.errors || {}); diff --git a/src/renderer/analytics.js b/src/ui/analytics.js similarity index 100% rename from src/renderer/analytics.js rename to src/ui/analytics.js diff --git a/src/ui/app.js b/src/ui/app.js new file mode 100644 index 000000000..f82a53307 --- /dev/null +++ b/src/ui/app.js @@ -0,0 +1,20 @@ +import store from 'store'; + +const env = process.env.NODE_ENV || 'production'; + +const logs = []; +const app = { + env, + store, + logs, + log(message) { + logs.push(message); + }, +}; + +global.app = app; + +// Lbryinc needs access to the redux store for dispatching auth-releated actions +global.store = app.store; + +export default app; diff --git a/src/renderer/component/app/index.js b/src/ui/component/app/index.js similarity index 100% rename from src/renderer/component/app/index.js rename to src/ui/component/app/index.js diff --git a/src/renderer/component/app/view.jsx b/src/ui/component/app/view.jsx similarity index 93% rename from src/renderer/component/app/view.jsx rename to src/ui/component/app/view.jsx index a929a4747..a40f7bf0b 100644 --- a/src/renderer/component/app/view.jsx +++ b/src/ui/component/app/view.jsx @@ -8,7 +8,7 @@ import SideBar from 'component/sideBar'; import Header from 'component/header'; import { openContextMenu } from 'util/context-menu'; import EnhancedLayoutListener from 'util/enhanced-layout'; -import Native from 'native'; +import Yrbl from 'component/yrbl'; const TWO_POINT_FIVE_MINUTES = 1000 * 60 * 2.5; @@ -112,13 +112,7 @@ class App extends React.PureComponent {
openContextMenu(e)}>
- {enhancedLayout && ( - Friendly gerbil - )} + {enhancedLayout && } {/* @if TARGET='app' */} {/* @endif */} diff --git a/src/renderer/component/button/index.js b/src/ui/component/button/index.js similarity index 100% rename from src/renderer/component/button/index.js rename to src/ui/component/button/index.js diff --git a/src/renderer/component/button/view.jsx b/src/ui/component/button/view.jsx similarity index 100% rename from src/renderer/component/button/view.jsx rename to src/ui/component/button/view.jsx diff --git a/src/renderer/component/cardMedia/index.js b/src/ui/component/cardMedia/index.js similarity index 100% rename from src/renderer/component/cardMedia/index.js rename to src/ui/component/cardMedia/index.js diff --git a/static/img/placeholder.png b/src/ui/component/cardMedia/placeholder.png similarity index 100% rename from static/img/placeholder.png rename to src/ui/component/cardMedia/placeholder.png diff --git a/src/renderer/component/cardMedia/view.jsx b/src/ui/component/cardMedia/view.jsx similarity index 78% rename from src/renderer/component/cardMedia/view.jsx rename to src/ui/component/cardMedia/view.jsx index 5c128a4dd..54e692eee 100644 --- a/src/renderer/component/cardMedia/view.jsx +++ b/src/ui/component/cardMedia/view.jsx @@ -1,6 +1,6 @@ // @flow import React from 'react'; -import Native from 'native'; +import Placeholder from './placeholder.png'; type Props = { thumbnail: ?string, // externally sourced image @@ -15,7 +15,7 @@ class CardMedia extends React.PureComponent { style={ thumbnail ? { backgroundImage: `url('${thumbnail}')` } - : { backgroundImage: `url('${Native.imagePath('placeholder.png')}')` } + : { backgroundImage: `url(${Placeholder})` } } className="media__thumb" /> diff --git a/src/renderer/component/cardVerify/index.js b/src/ui/component/cardVerify/index.js similarity index 100% rename from src/renderer/component/cardVerify/index.js rename to src/ui/component/cardVerify/index.js diff --git a/src/renderer/component/cardVerify/view.jsx b/src/ui/component/cardVerify/view.jsx similarity index 99% rename from src/renderer/component/cardVerify/view.jsx rename to src/ui/component/cardVerify/view.jsx index 49a12b4ca..6ba5b3ffe 100644 --- a/src/renderer/component/cardVerify/view.jsx +++ b/src/ui/component/cardVerify/view.jsx @@ -163,7 +163,7 @@ class CardVerify extends React.Component {
diff --git a/src/renderer/component/rewardSummary/index.js b/src/ui/component/rewardSummary/index.js similarity index 100% rename from src/renderer/component/rewardSummary/index.js rename to src/ui/component/rewardSummary/index.js diff --git a/src/renderer/component/rewardSummary/view.jsx b/src/ui/component/rewardSummary/view.jsx similarity index 100% rename from src/renderer/component/rewardSummary/view.jsx rename to src/ui/component/rewardSummary/view.jsx diff --git a/src/renderer/component/rewardTile/index.js b/src/ui/component/rewardTile/index.js similarity index 100% rename from src/renderer/component/rewardTile/index.js rename to src/ui/component/rewardTile/index.js diff --git a/src/renderer/component/rewardTile/view.jsx b/src/ui/component/rewardTile/view.jsx similarity index 100% rename from src/renderer/component/rewardTile/view.jsx rename to src/ui/component/rewardTile/view.jsx diff --git a/src/renderer/component/router/index.js b/src/ui/component/router/index.js similarity index 100% rename from src/renderer/component/router/index.js rename to src/ui/component/router/index.js diff --git a/src/renderer/component/router/view.jsx b/src/ui/component/router/view.jsx similarity index 100% rename from src/renderer/component/router/view.jsx rename to src/ui/component/router/view.jsx diff --git a/src/renderer/component/searchOptions/index.js b/src/ui/component/searchOptions/index.js similarity index 100% rename from src/renderer/component/searchOptions/index.js rename to src/ui/component/searchOptions/index.js diff --git a/src/renderer/component/searchOptions/view.jsx b/src/ui/component/searchOptions/view.jsx similarity index 100% rename from src/renderer/component/searchOptions/view.jsx rename to src/ui/component/searchOptions/view.jsx diff --git a/src/renderer/component/selectChannel/index.js b/src/ui/component/selectChannel/index.js similarity index 90% rename from src/renderer/component/selectChannel/index.js rename to src/ui/component/selectChannel/index.js index 45314beef..0d082aee5 100644 --- a/src/renderer/component/selectChannel/index.js +++ b/src/ui/component/selectChannel/index.js @@ -14,4 +14,7 @@ const perform = dispatch => ({ fetchChannelListMine: () => dispatch(doFetchChannelListMine()), }); -export default connect(select, perform)(SelectChannel); +export default connect( + select, + perform +)(SelectChannel); diff --git a/src/renderer/component/selectChannel/view.jsx b/src/ui/component/selectChannel/view.jsx similarity index 100% rename from src/renderer/component/selectChannel/view.jsx rename to src/ui/component/selectChannel/view.jsx diff --git a/src/renderer/component/selectThumbnail/index.js b/src/ui/component/selectThumbnail/index.js similarity index 100% rename from src/renderer/component/selectThumbnail/index.js rename to src/ui/component/selectThumbnail/index.js diff --git a/static/img/broken.png b/src/ui/component/selectThumbnail/thumbnail-broken.png similarity index 100% rename from static/img/broken.png rename to src/ui/component/selectThumbnail/thumbnail-broken.png diff --git a/static/img/no-thumbnail.png b/src/ui/component/selectThumbnail/thumbnail-missing.png similarity index 100% rename from static/img/no-thumbnail.png rename to src/ui/component/selectThumbnail/thumbnail-missing.png diff --git a/src/renderer/component/selectThumbnail/view.jsx b/src/ui/component/selectThumbnail/view.jsx similarity index 71% rename from src/renderer/component/selectThumbnail/view.jsx rename to src/ui/component/selectThumbnail/view.jsx index ecafee85e..aaa0fd5d5 100644 --- a/src/renderer/component/selectThumbnail/view.jsx +++ b/src/ui/component/selectThumbnail/view.jsx @@ -5,7 +5,8 @@ import * as React from 'react'; import { FormField } from 'component/common/form'; import FileSelector from 'component/common/file-selector'; import Button from 'component/button'; -import Native from 'native'; +import ThumbnailMissingImage from './thumbnail-missing.png'; +import ThumbnailBrokenImage from './thumbnail-broken.png'; type Props = { thumbnail: ?string, @@ -19,16 +20,21 @@ type Props = { type State = { thumbnailError: boolean, - thumbnailErrorImage: string, }; +const filters = [ + { + name: __('Thumbnail Image'), + extensions: ['png', 'jpg', 'jpeg', 'gif'], + }, +]; + class SelectThumbnail extends React.PureComponent { constructor() { super(); this.state = { thumbnailError: false, - thumbnailErrorImage: 'no-thumbnail.png', }; (this: any).handleThumbnailChange = this.handleThumbnailChange.bind(this); @@ -39,7 +45,7 @@ class SelectThumbnail extends React.PureComponent { const newThumbnail = e.target.value.replace(' ', ''); updatePublishForm({ thumbnail: newThumbnail }); - this.setState({ thumbnailError: false, thumbnailErrorImage: 'no-thumbnail.png' }); + this.setState({ thumbnailError: false }); } render() { @@ -52,15 +58,17 @@ class SelectThumbnail extends React.PureComponent { thumbnailPath, resetThumbnailStatus, } = this.props; - const filters = [ - { - name: __('Thumbnail Image'), - extensions: ['png', 'jpg', 'jpeg', 'gif'], - }, - ]; - const { thumbnailError, thumbnailErrorImage } = this.state; - const thumbnailSrc = - !thumbnail || thumbnailError ? Native.imagePath(thumbnailErrorImage) : thumbnail; + + const { thumbnailError } = this.state; + + let thumbnailSrc; + if (!thumbnail) { + thumbnailSrc = ThumbnailMissingImage; + } else if (thumbnailError) { + thumbnailSrc = ThumbnailBrokenImage; + } else { + thumbnailSrc = thumbnail; + } /* Note: @@ -81,11 +89,9 @@ class SelectThumbnail extends React.PureComponent { style={{ display: 'none' }} src={thumbnailSrc} alt={__('Thumbnail Preview')} - onError={() => { + onError={e => { this.setState({ thumbnailError: true, - thumbnailErrorImage: - thumbnail && thumbnail.length > 0 ? 'broken.png' : 'no-thumbnail.png', }); }} /> @@ -121,28 +127,27 @@ class SelectThumbnail extends React.PureComponent { onFileChosen={path => openModal(MODALS.CONFIRM_THUMBNAIL_UPLOAD, { path })} /> )} - {status === THUMBNAIL_STATUSES.COMPLETE && - thumbnail && ( -
-
-
-

- Upload complete.{' '} -

+ {status === THUMBNAIL_STATUSES.COMPLETE && thumbnail && ( +
+
+
+

+ Upload complete.{' '} +

- )} +
+ )} )} {status === THUMBNAIL_STATUSES.READY && ( diff --git a/src/renderer/component/shapeShift/index.js b/src/ui/component/shapeShift/index.js similarity index 73% rename from src/renderer/component/shapeShift/index.js rename to src/ui/component/shapeShift/index.js index 1108589ab..57906b8f8 100644 --- a/src/renderer/component/shapeShift/index.js +++ b/src/ui/component/shapeShift/index.js @@ -15,10 +15,13 @@ const select = state => ({ shapeShift: selectShapeShift(state), }); -export default connect(select, { - shapeShiftInit, - getCoinStats, - createShapeShift, - clearShapeShift, - getActiveShift, -})(ShapeShift); +export default connect( + select, + { + shapeShiftInit, + getCoinStats, + createShapeShift, + clearShapeShift, + getActiveShift, + } +)(ShapeShift); diff --git a/src/renderer/component/shapeShift/internal/active-shift.jsx b/src/ui/component/shapeShift/internal/active-shift.jsx similarity index 92% rename from src/renderer/component/shapeShift/internal/active-shift.jsx rename to src/ui/component/shapeShift/internal/active-shift.jsx index 7188fd787..91029c5cb 100644 --- a/src/renderer/component/shapeShift/internal/active-shift.jsx +++ b/src/ui/component/shapeShift/internal/active-shift.jsx @@ -133,13 +133,12 @@ class ActiveShapeShift extends React.PureComponent { /> )}
- {shiftState === statuses.NO_DEPOSITS && - shiftReturnAddress && ( -
- {__("If the transaction doesn't go through, ShapeShift will return your")}{' '} - {shiftCoinType} {__('back to')} {shiftReturnAddress} -
- )} + {shiftState === statuses.NO_DEPOSITS && shiftReturnAddress && ( +
+ {__("If the transaction doesn't go through, ShapeShift will return your")}{' '} + {shiftCoinType} {__('back to')} {shiftReturnAddress} +
+ )}
); } diff --git a/src/renderer/component/shapeShift/internal/form.jsx b/src/ui/component/shapeShift/internal/form.jsx similarity index 100% rename from src/renderer/component/shapeShift/internal/form.jsx rename to src/ui/component/shapeShift/internal/form.jsx diff --git a/src/renderer/component/shapeShift/internal/market_info.jsx b/src/ui/component/shapeShift/internal/market_info.jsx similarity index 100% rename from src/renderer/component/shapeShift/internal/market_info.jsx rename to src/ui/component/shapeShift/internal/market_info.jsx diff --git a/src/renderer/component/shapeShift/view.jsx b/src/ui/component/shapeShift/view.jsx similarity index 96% rename from src/renderer/component/shapeShift/view.jsx rename to src/ui/component/shapeShift/view.jsx index 4a4c2e045..acb1f8055 100644 --- a/src/renderer/component/shapeShift/view.jsx +++ b/src/ui/component/shapeShift/view.jsx @@ -79,8 +79,9 @@ class ShapeShift extends React.PureComponent {

{__('Powered by ShapeShift. Read our FAQ')}{' '}

- {linkText && - linkTarget && ( - - )} + {name && claimId && ( + + )} diff --git a/src/renderer/component/transactionList/view.jsx b/src/ui/component/transactionList/view.jsx similarity index 72% rename from src/renderer/component/transactionList/view.jsx rename to src/ui/component/transactionList/view.jsx index 704156611..34940fe36 100644 --- a/src/renderer/component/transactionList/view.jsx +++ b/src/ui/component/transactionList/view.jsx @@ -69,42 +69,41 @@ class TransactionList extends React.PureComponent { return (
- {!slim && - !!transactions.length && ( -
- + {!slim && !!transactions.length && ( +
+ -
- - } - > - {transactionTypes.map(tt => ( - - ))} - -
-
- )} +
+ + } + > + {transactionTypes.map(tt => ( + + ))} + +
+
+ )}
{!transactionList.length && (

{emptyMessage || __('No transactions to list.')}

diff --git a/src/renderer/component/transactionListRecent/index.js b/src/ui/component/transactionListRecent/index.js similarity index 100% rename from src/renderer/component/transactionListRecent/index.js rename to src/ui/component/transactionListRecent/index.js diff --git a/src/renderer/component/transactionListRecent/view.jsx b/src/ui/component/transactionListRecent/view.jsx similarity index 90% rename from src/renderer/component/transactionListRecent/view.jsx rename to src/ui/component/transactionListRecent/view.jsx index 5c5d4f57d..f98e75c3f 100644 --- a/src/renderer/component/transactionListRecent/view.jsx +++ b/src/ui/component/transactionListRecent/view.jsx @@ -39,12 +39,11 @@ class TransactionListRecent extends React.PureComponent {

- {fetchingTransactions && - !hasTransactions && ( -
- -
- )} + {fetchingTransactions && !hasTransactions && ( +
+ +
+ )} {hasTransactions && ( diff --git a/src/renderer/component/transactionRefreshButton/index.js b/src/ui/component/transactionRefreshButton/index.js similarity index 100% rename from src/renderer/component/transactionRefreshButton/index.js rename to src/ui/component/transactionRefreshButton/index.js diff --git a/src/renderer/component/transactionRefreshButton/view.jsx b/src/ui/component/transactionRefreshButton/view.jsx similarity index 100% rename from src/renderer/component/transactionRefreshButton/view.jsx rename to src/ui/component/transactionRefreshButton/view.jsx diff --git a/src/renderer/component/uriIndicator/index.js b/src/ui/component/uriIndicator/index.js similarity index 100% rename from src/renderer/component/uriIndicator/index.js rename to src/ui/component/uriIndicator/index.js diff --git a/src/renderer/component/uriIndicator/view.jsx b/src/ui/component/uriIndicator/view.jsx similarity index 100% rename from src/renderer/component/uriIndicator/view.jsx rename to src/ui/component/uriIndicator/view.jsx diff --git a/src/renderer/component/userEmailNew/index.js b/src/ui/component/userEmailNew/index.js similarity index 100% rename from src/renderer/component/userEmailNew/index.js rename to src/ui/component/userEmailNew/index.js diff --git a/src/renderer/component/userEmailNew/view.jsx b/src/ui/component/userEmailNew/view.jsx similarity index 100% rename from src/renderer/component/userEmailNew/view.jsx rename to src/ui/component/userEmailNew/view.jsx diff --git a/src/renderer/component/userEmailVerify/index.js b/src/ui/component/userEmailVerify/index.js similarity index 100% rename from src/renderer/component/userEmailVerify/index.js rename to src/ui/component/userEmailVerify/index.js diff --git a/src/renderer/component/userEmailVerify/view.jsx b/src/ui/component/userEmailVerify/view.jsx similarity index 100% rename from src/renderer/component/userEmailVerify/view.jsx rename to src/ui/component/userEmailVerify/view.jsx diff --git a/src/renderer/component/userHistory/index.js b/src/ui/component/userHistory/index.js similarity index 100% rename from src/renderer/component/userHistory/index.js rename to src/ui/component/userHistory/index.js diff --git a/src/renderer/component/userHistory/view.jsx b/src/ui/component/userHistory/view.jsx similarity index 100% rename from src/renderer/component/userHistory/view.jsx rename to src/ui/component/userHistory/view.jsx diff --git a/src/renderer/component/userHistoryItem/index.js b/src/ui/component/userHistoryItem/index.js similarity index 100% rename from src/renderer/component/userHistoryItem/index.js rename to src/ui/component/userHistoryItem/index.js diff --git a/src/renderer/component/userHistoryItem/view.jsx b/src/ui/component/userHistoryItem/view.jsx similarity index 100% rename from src/renderer/component/userHistoryItem/view.jsx rename to src/ui/component/userHistoryItem/view.jsx diff --git a/src/renderer/component/userPhoneNew/index.js b/src/ui/component/userPhoneNew/index.js similarity index 100% rename from src/renderer/component/userPhoneNew/index.js rename to src/ui/component/userPhoneNew/index.js diff --git a/src/renderer/component/userPhoneNew/view.jsx b/src/ui/component/userPhoneNew/view.jsx similarity index 100% rename from src/renderer/component/userPhoneNew/view.jsx rename to src/ui/component/userPhoneNew/view.jsx diff --git a/src/renderer/component/userPhoneVerify/index.js b/src/ui/component/userPhoneVerify/index.js similarity index 100% rename from src/renderer/component/userPhoneVerify/index.js rename to src/ui/component/userPhoneVerify/index.js diff --git a/src/renderer/component/userPhoneVerify/view.jsx b/src/ui/component/userPhoneVerify/view.jsx similarity index 100% rename from src/renderer/component/userPhoneVerify/view.jsx rename to src/ui/component/userPhoneVerify/view.jsx diff --git a/src/renderer/component/userVerify/index.js b/src/ui/component/userVerify/index.js similarity index 100% rename from src/renderer/component/userVerify/index.js rename to src/ui/component/userVerify/index.js diff --git a/src/renderer/component/userVerify/view.jsx b/src/ui/component/userVerify/view.jsx similarity index 100% rename from src/renderer/component/userVerify/view.jsx rename to src/ui/component/userVerify/view.jsx diff --git a/src/renderer/component/viewers/audioVideoViewer.jsx b/src/ui/component/viewers/audioVideoViewer.jsx similarity index 100% rename from src/renderer/component/viewers/audioVideoViewer.jsx rename to src/ui/component/viewers/audioVideoViewer.jsx diff --git a/src/renderer/component/viewers/codeViewer.jsx b/src/ui/component/viewers/codeViewer.jsx similarity index 100% rename from src/renderer/component/viewers/codeViewer.jsx rename to src/ui/component/viewers/codeViewer.jsx diff --git a/src/renderer/component/viewers/documentViewer.jsx b/src/ui/component/viewers/documentViewer.jsx similarity index 100% rename from src/renderer/component/viewers/documentViewer.jsx rename to src/ui/component/viewers/documentViewer.jsx diff --git a/src/renderer/component/viewers/docxViewer.jsx b/src/ui/component/viewers/docxViewer.jsx similarity index 80% rename from src/renderer/component/viewers/docxViewer.jsx rename to src/ui/component/viewers/docxViewer.jsx index 790269fe6..b0b21f280 100644 --- a/src/renderer/component/viewers/docxViewer.jsx +++ b/src/ui/component/viewers/docxViewer.jsx @@ -2,7 +2,6 @@ import React from 'react'; import mammoth from 'mammoth'; -import Breakdance from 'breakdance'; import LoadingScreen from 'component/common/loading-screen'; import MarkdownPreview from 'component/common/markdown-preview'; @@ -46,11 +45,7 @@ class DocxViewer extends React.PureComponent { mammoth .convertToHtml({ path: source }, options) .then(result => { - // Remove images and tables - const breakdance = new Breakdance({ omit: ['table', 'img'] }); - // Convert html to markdown - const markdown = breakdance.render(result.value); - this.setState({ content: markdown, loading: false }); + this.setState({ content: result.value, loading: false }); }) .catch(() => { this.setState({ error: true, loading: false }); @@ -68,9 +63,7 @@ class DocxViewer extends React.PureComponent { {loading && } {error && } {content && ( -
- -
+
)}
); diff --git a/src/renderer/component/viewers/htmlViewer.jsx b/src/ui/component/viewers/htmlViewer.jsx similarity index 100% rename from src/renderer/component/viewers/htmlViewer.jsx rename to src/ui/component/viewers/htmlViewer.jsx diff --git a/src/renderer/component/viewers/pdfViewer.jsx b/src/ui/component/viewers/pdfViewer.jsx similarity index 100% rename from src/renderer/component/viewers/pdfViewer.jsx rename to src/ui/component/viewers/pdfViewer.jsx diff --git a/src/renderer/component/viewers/threeViewer/index.jsx b/src/ui/component/viewers/threeViewer/index.jsx similarity index 94% rename from src/renderer/component/viewers/threeViewer/index.jsx rename to src/ui/component/viewers/threeViewer/index.jsx index 229347830..ba0f87a86 100644 --- a/src/renderer/component/viewers/threeViewer/index.jsx +++ b/src/ui/component/viewers/threeViewer/index.jsx @@ -5,13 +5,42 @@ import classNames from 'classnames'; import LoadingScreen from 'component/common/loading-screen'; // ThreeJS -import * as THREE from './internal/three'; +import * as THREE from 'three-full'; import detectWebGL from './internal/detector'; import ThreeGrid from './internal/grid'; import ThreeScene from './internal/scene'; -import ThreeLoader from './internal/loader'; import ThreeRenderer from './internal/renderer'; +const Manager = ({ onLoad, onStart, onError }) => { + const manager = new THREE.LoadingManager(); + manager.onLoad = onLoad; + manager.onStart = onStart; + manager.onError = onError; + + return manager; +}; + +const Loader = (fileType, manager) => { + const fileTypes = { + stl: () => new THREE.STLLoader(manager), + obj: () => new THREE.OBJLoader2(manager), + }; + return fileTypes[fileType] ? fileTypes[fileType]() : null; +}; + +const ThreeLoader = ({ fileType = null, downloadPath = null }, renderModel, managerEvents) => { + if (fileType && downloadPath) { + const manager = Manager(managerEvents); + const loader = Loader(fileType, manager); + + if (loader) { + loader.load(`file://${downloadPath}`, data => { + renderModel(fileType, data); + }); + } + } +}; + type viewerTheme = { gridColor: string, groundColor: string, diff --git a/src/renderer/component/viewers/threeViewer/internal/detector.js b/src/ui/component/viewers/threeViewer/internal/detector.js similarity index 100% rename from src/renderer/component/viewers/threeViewer/internal/detector.js rename to src/ui/component/viewers/threeViewer/internal/detector.js diff --git a/src/renderer/component/viewers/threeViewer/internal/grid.js b/src/ui/component/viewers/threeViewer/internal/grid.js similarity index 86% rename from src/renderer/component/viewers/threeViewer/internal/grid.js rename to src/ui/component/viewers/threeViewer/internal/grid.js index ad0020172..3195e1955 100644 --- a/src/renderer/component/viewers/threeViewer/internal/grid.js +++ b/src/ui/component/viewers/threeViewer/internal/grid.js @@ -1,4 +1,4 @@ -import { GridHelper, Color } from './three'; +import { GridHelper, Color } from 'three-full'; const ThreeGrid = ({ size, gridColor, centerLineColor }) => { const divisions = size / 2; diff --git a/src/renderer/component/viewers/threeViewer/internal/renderer.js b/src/ui/component/viewers/threeViewer/internal/renderer.js similarity index 91% rename from src/renderer/component/viewers/threeViewer/internal/renderer.js rename to src/ui/component/viewers/threeViewer/internal/renderer.js index 7ddefd48a..e87f188e2 100644 --- a/src/renderer/component/viewers/threeViewer/internal/renderer.js +++ b/src/ui/component/viewers/threeViewer/internal/renderer.js @@ -1,4 +1,4 @@ -import { WebGLRenderer } from './three'; +import { WebGLRenderer } from 'three-full'; const ThreeRenderer = ({ antialias, shadowMap, gammaCorrection }) => { const renderer = new WebGLRenderer({ antialias }); diff --git a/src/renderer/component/viewers/threeViewer/internal/scene.js b/src/ui/component/viewers/threeViewer/internal/scene.js similarity index 96% rename from src/renderer/component/viewers/threeViewer/internal/scene.js rename to src/ui/component/viewers/threeViewer/internal/scene.js index a22c4a996..ef4b848a7 100644 --- a/src/renderer/component/viewers/threeViewer/internal/scene.js +++ b/src/ui/component/viewers/threeViewer/internal/scene.js @@ -1,4 +1,4 @@ -import * as THREE from './three'; +import * as THREE from 'three-full'; const addLights = (scene, color, groundColor) => { // Light color diff --git a/src/renderer/component/walletAddress/index.js b/src/ui/component/walletAddress/index.js similarity index 100% rename from src/renderer/component/walletAddress/index.js rename to src/ui/component/walletAddress/index.js diff --git a/src/renderer/component/walletAddress/view.jsx b/src/ui/component/walletAddress/view.jsx similarity index 100% rename from src/renderer/component/walletAddress/view.jsx rename to src/ui/component/walletAddress/view.jsx diff --git a/static/img/stripe-background.png b/src/ui/component/walletBalance/balance-background.png similarity index 100% rename from static/img/stripe-background.png rename to src/ui/component/walletBalance/balance-background.png diff --git a/src/renderer/component/walletBalance/index.js b/src/ui/component/walletBalance/index.js similarity index 100% rename from src/renderer/component/walletBalance/index.js rename to src/ui/component/walletBalance/index.js diff --git a/src/renderer/component/walletBalance/view.jsx b/src/ui/component/walletBalance/view.jsx similarity index 91% rename from src/renderer/component/walletBalance/view.jsx rename to src/ui/component/walletBalance/view.jsx index 073f5fd9b..92d07f622 100644 --- a/src/renderer/component/walletBalance/view.jsx +++ b/src/ui/component/walletBalance/view.jsx @@ -1,6 +1,7 @@ // @flow import React from 'react'; import CreditAmount from 'component/common/credit-amount'; +import BalanceBackground from './balance-background.png'; type Props = { balance: number, diff --git a/src/renderer/component/walletSend/index.js b/src/ui/component/walletSend/index.js similarity index 100% rename from src/renderer/component/walletSend/index.js rename to src/ui/component/walletSend/index.js diff --git a/src/renderer/component/walletSend/view.jsx b/src/ui/component/walletSend/view.jsx similarity index 100% rename from src/renderer/component/walletSend/view.jsx rename to src/ui/component/walletSend/view.jsx diff --git a/src/renderer/component/walletSendTip/index.js b/src/ui/component/walletSendTip/index.js similarity index 100% rename from src/renderer/component/walletSendTip/index.js rename to src/ui/component/walletSendTip/index.js diff --git a/src/renderer/component/walletSendTip/view.jsx b/src/ui/component/walletSendTip/view.jsx similarity index 100% rename from src/renderer/component/walletSendTip/view.jsx rename to src/ui/component/walletSendTip/view.jsx diff --git a/src/renderer/component/wunderbar/index.js b/src/ui/component/wunderbar/index.js similarity index 100% rename from src/renderer/component/wunderbar/index.js rename to src/ui/component/wunderbar/index.js diff --git a/src/renderer/component/wunderbar/internal/autocomplete.jsx b/src/ui/component/wunderbar/internal/autocomplete.jsx similarity index 100% rename from src/renderer/component/wunderbar/internal/autocomplete.jsx rename to src/ui/component/wunderbar/internal/autocomplete.jsx diff --git a/src/renderer/component/wunderbar/view.jsx b/src/ui/component/wunderbar/view.jsx similarity index 100% rename from src/renderer/component/wunderbar/view.jsx rename to src/ui/component/wunderbar/view.jsx diff --git a/static/img/gerbil-happy.png b/src/ui/component/yrbl/gerbil-happy.png similarity index 100% rename from static/img/gerbil-happy.png rename to src/ui/component/yrbl/gerbil-happy.png diff --git a/static/img/gerbil-sad.png b/src/ui/component/yrbl/gerbil-sad.png similarity index 100% rename from static/img/gerbil-sad.png rename to src/ui/component/yrbl/gerbil-sad.png diff --git a/src/ui/component/yrbl/index.jsx b/src/ui/component/yrbl/index.jsx new file mode 100644 index 000000000..d4cf79702 --- /dev/null +++ b/src/ui/component/yrbl/index.jsx @@ -0,0 +1,41 @@ +// @flow +import * as React from 'react'; +import classnames from 'classnames'; +import HappyYrbl from './gerbil-happy.png'; +import SadYrbl from './gerbil-sad.png'; + +type Props = { + title?: string, + subtitle?: string | React.Node, + type: string, + className?: string, +}; + +const yrblTypes = { + happy: HappyYrbl, + sad: SadYrbl, +}; + +export default class extends React.PureComponent { + static defaultProps = { + type: 'happy', + }; + + render() { + const { title, subtitle, type, className } = this.props; + + const image = yrblTypes[type]; + + return ( +
+ Friendly gerbil + {title && subtitle && ( +
+

{title}

+

{subtitle}

+
+ )} +
+ ); + } +} diff --git a/src/renderer/constants/action_types.js b/src/ui/constants/action_types.js similarity index 98% rename from src/renderer/constants/action_types.js rename to src/ui/constants/action_types.js index f85e6111a..10248feae 100644 --- a/src/renderer/constants/action_types.js +++ b/src/ui/constants/action_types.js @@ -16,6 +16,7 @@ export const VOLUME_CHANGED = 'VOLUME_CHANGED'; export const ADD_COMMENT = 'ADD_COMMENT'; export const SHOW_MODAL = 'SHOW_MODAL'; export const HIDE_MODAL = 'HIDE_MODAL'; +export const CHANGE_MODALS_ALLOWED = 'CHANGE_MODALS_ALLOWED'; export const TOGGLE_SEARCH_EXPANDED = 'TOGGLE_SEARCH_EXPANDED'; export const ENNNHHHAAANNNCEEE = 'ENNNHHHAAANNNCEEE'; @@ -206,3 +207,7 @@ export const PUBLISH_FAIL = 'PUBLISH_FAIL'; export const CLEAR_PUBLISH_ERROR = 'CLEAR_PUBLISH_ERROR'; export const REMOVE_PENDING_PUBLISH = 'REMOVE_PENDING_PUBLISH'; export const DO_PREPARE_EDIT = 'DO_PREPARE_EDIT'; + +// media +export const MEDIA_PLAY = 'MEDIA_PLAY'; +export const MEDIA_PAUSE = 'MEDIA_PAUSE'; diff --git a/src/renderer/constants/claim.js b/src/ui/constants/claim.js similarity index 100% rename from src/renderer/constants/claim.js rename to src/ui/constants/claim.js diff --git a/src/renderer/constants/content.js b/src/ui/constants/content.js similarity index 100% rename from src/renderer/constants/content.js rename to src/ui/constants/content.js diff --git a/src/renderer/constants/icons.js b/src/ui/constants/icons.js similarity index 96% rename from src/renderer/constants/icons.js rename to src/ui/constants/icons.js index 35f58974b..96dc2917e 100644 --- a/src/renderer/constants/icons.js +++ b/src/ui/constants/icons.js @@ -46,3 +46,5 @@ export const YES = 'ThumbsUp'; export const NO = 'ThumbsDown'; export const UP = 'ChevronUp'; export const DOWN = 'ChevronDown'; +export const SECURE = 'Lock'; +export const MENU = 'Menu'; diff --git a/src/renderer/constants/languages.js b/src/ui/constants/languages.js similarity index 100% rename from src/renderer/constants/languages.js rename to src/ui/constants/languages.js diff --git a/src/renderer/constants/licenses.js b/src/ui/constants/licenses.js similarity index 100% rename from src/renderer/constants/licenses.js rename to src/ui/constants/licenses.js diff --git a/src/renderer/constants/modal_types.js b/src/ui/constants/modal_types.js similarity index 100% rename from src/renderer/constants/modal_types.js rename to src/ui/constants/modal_types.js diff --git a/src/renderer/constants/pages.js b/src/ui/constants/pages.js similarity index 100% rename from src/renderer/constants/pages.js rename to src/ui/constants/pages.js diff --git a/src/renderer/constants/search.js b/src/ui/constants/search.js similarity index 100% rename from src/renderer/constants/search.js rename to src/ui/constants/search.js diff --git a/src/renderer/constants/settings.js b/src/ui/constants/settings.js similarity index 100% rename from src/renderer/constants/settings.js rename to src/ui/constants/settings.js diff --git a/src/renderer/constants/shape_shift.js b/src/ui/constants/shape_shift.js similarity index 100% rename from src/renderer/constants/shape_shift.js rename to src/ui/constants/shape_shift.js diff --git a/src/renderer/constants/subscriptions.js b/src/ui/constants/subscriptions.js similarity index 100% rename from src/renderer/constants/subscriptions.js rename to src/ui/constants/subscriptions.js diff --git a/src/renderer/constants/themes.js b/src/ui/constants/themes.js similarity index 100% rename from src/renderer/constants/themes.js rename to src/ui/constants/themes.js diff --git a/src/renderer/constants/thumbnail_upload_statuses.js b/src/ui/constants/thumbnail_upload_statuses.js similarity index 100% rename from src/renderer/constants/thumbnail_upload_statuses.js rename to src/ui/constants/thumbnail_upload_statuses.js diff --git a/src/renderer/constants/transaction_types.js b/src/ui/constants/transaction_types.js similarity index 100% rename from src/renderer/constants/transaction_types.js rename to src/ui/constants/transaction_types.js diff --git a/src/ui/i18n/__.js b/src/ui/i18n/__.js new file mode 100644 index 000000000..fbda9af90 --- /dev/null +++ b/src/ui/i18n/__.js @@ -0,0 +1,3 @@ +import i18n from './index'; + +export default i18n.__; diff --git a/src/ui/i18n/__n.js b/src/ui/i18n/__n.js new file mode 100644 index 000000000..a005ee154 --- /dev/null +++ b/src/ui/i18n/__n.js @@ -0,0 +1,3 @@ +import i18n from './index.js'; + +export default i18n.__n; diff --git a/src/ui/i18n/index.js b/src/ui/i18n/index.js new file mode 100644 index 000000000..216641d3b --- /dev/null +++ b/src/ui/i18n/index.js @@ -0,0 +1,17 @@ +// @if TARGET='app' +import y18n from 'y18n'; + +const i18n = y18n({ + directory: `static/locales`.replace(/\\/g, '\\\\'), + updateFiles: false, + locale: 'en', +}); +// @endif +// @if TARGET='web' +const i18n = { + setLocale: () => {}, + getLocale: () => {}, +}; +// @endif + +export default i18n; diff --git a/src/renderer/index.js b/src/ui/index.js similarity index 99% rename from src/renderer/index.js rename to src/ui/index.js index e8dc23ea9..9b9fc94bf 100644 --- a/src/renderer/index.js +++ b/src/ui/index.js @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-filename-extension */ /* eslint-disable no-console */ import App from 'component/app'; import SnackBar from 'component/snackBar'; @@ -233,9 +232,9 @@ const init = () => { } app.store.dispatch(doUpdateIsNightAsync()); - app.store.dispatch(doDownloadLanguages()); // @endif + app.store.dispatch(doDownloadLanguages()); app.store.dispatch(doBlackListedOutpointsSubscribe()); function onDaemonReady() { diff --git a/src/renderer/lbryio.js b/src/ui/lbryio.js similarity index 100% rename from src/renderer/lbryio.js rename to src/ui/lbryio.js diff --git a/src/renderer/logWarningConsoleMessage.js b/src/ui/logWarningConsoleMessage.js similarity index 100% rename from src/renderer/logWarningConsoleMessage.js rename to src/ui/logWarningConsoleMessage.js diff --git a/src/renderer/modal/modal.jsx b/src/ui/modal/modal.jsx similarity index 89% rename from src/renderer/modal/modal.jsx rename to src/ui/modal/modal.jsx index 7cb749d3f..507945514 100644 --- a/src/renderer/modal/modal.jsx +++ b/src/ui/modal/modal.jsx @@ -29,10 +29,8 @@ export class Modal extends React.PureComponent { static defaultProps = { type: 'alert', overlay: true, - /* eslint-disable no-underscore-dangle */ - confirmButtonLabel: app.i18n.__('OK'), - abortButtonLabel: app.i18n.__('Cancel'), - /* eslint-enable no-underscore-dangle */ + confirmButtonLabel: __('OK'), + abortButtonLabel: __('Cancel'), confirmButtonDisabled: false, abortButtonDisabled: false, fullScreen: false, @@ -98,11 +96,9 @@ type State = { export class ExpandableModal extends React.PureComponent { static defaultProps = { - /* eslint-disable no-underscore-dangle */ - confirmButtonLabel: app.i18n.__('OK'), - expandButtonLabel: app.i18n.__('Show More...'), - hideButtonLabel: app.i18n.__('Show Less'), - /* eslint-enable no-underscore-dangle */ + confirmButtonLabel: __('OK'), + expandButtonLabel: __('Show More...'), + hideButtonLabel: __('Show Less'), }; constructor(props: ModalProps) { diff --git a/src/renderer/modal/modalAffirmPurchase/index.js b/src/ui/modal/modalAffirmPurchase/index.js similarity index 100% rename from src/renderer/modal/modalAffirmPurchase/index.js rename to src/ui/modal/modalAffirmPurchase/index.js diff --git a/src/renderer/modal/modalAffirmPurchase/view.jsx b/src/ui/modal/modalAffirmPurchase/view.jsx similarity index 100% rename from src/renderer/modal/modalAffirmPurchase/view.jsx rename to src/ui/modal/modalAffirmPurchase/view.jsx diff --git a/src/renderer/modal/modalAuthFailure/index.js b/src/ui/modal/modalAuthFailure/index.js similarity index 100% rename from src/renderer/modal/modalAuthFailure/index.js rename to src/ui/modal/modalAuthFailure/index.js diff --git a/src/renderer/modal/modalAuthFailure/view.jsx b/src/ui/modal/modalAuthFailure/view.jsx similarity index 100% rename from src/renderer/modal/modalAuthFailure/view.jsx rename to src/ui/modal/modalAuthFailure/view.jsx diff --git a/src/renderer/modal/modalAutoUpdateConfirm/index.js b/src/ui/modal/modalAutoUpdateConfirm/index.js similarity index 100% rename from src/renderer/modal/modalAutoUpdateConfirm/index.js rename to src/ui/modal/modalAutoUpdateConfirm/index.js diff --git a/src/renderer/modal/modalAutoUpdateConfirm/view.jsx b/src/ui/modal/modalAutoUpdateConfirm/view.jsx similarity index 97% rename from src/renderer/modal/modalAutoUpdateConfirm/view.jsx rename to src/ui/modal/modalAutoUpdateConfirm/view.jsx index 10f5ac15e..e31dbabc8 100644 --- a/src/renderer/modal/modalAutoUpdateConfirm/view.jsx +++ b/src/ui/modal/modalAutoUpdateConfirm/view.jsx @@ -37,7 +37,8 @@ class ModalAutoUpdateConfirm extends React.PureComponent { button="link" label={__('release notes')} href="https://github.com/lbryio/lbry-desktop/releases" - />. + /> + .

diff --git a/src/renderer/modal/modalAutoUpdateDownloaded/index.js b/src/ui/modal/modalAutoUpdateDownloaded/index.js similarity index 100% rename from src/renderer/modal/modalAutoUpdateDownloaded/index.js rename to src/ui/modal/modalAutoUpdateDownloaded/index.js diff --git a/src/renderer/modal/modalAutoUpdateDownloaded/view.jsx b/src/ui/modal/modalAutoUpdateDownloaded/view.jsx similarity index 91% rename from src/renderer/modal/modalAutoUpdateDownloaded/view.jsx rename to src/ui/modal/modalAutoUpdateDownloaded/view.jsx index 30209b10c..04065a286 100644 --- a/src/renderer/modal/modalAutoUpdateDownloaded/view.jsx +++ b/src/ui/modal/modalAutoUpdateDownloaded/view.jsx @@ -1,6 +1,8 @@ // @flow import React from 'react'; +// @if TARGET='app' import { ipcRenderer } from 'electron'; +// @endif import { Modal } from 'modal/modal'; import Button from 'component/button'; @@ -45,18 +47,15 @@ class ModalAutoUpdateDownloaded extends React.PureComponent { }} >
-

- {__( - 'A new version of LBRY is ready for you.' - )} -

+

{__('A new version of LBRY is ready for you.')}

{__('Want to know what has changed?')} See the{' '}

diff --git a/src/renderer/modal/modalConfirmThumbnailUpload/index.js b/src/ui/modal/modalConfirmThumbnailUpload/index.js similarity index 100% rename from src/renderer/modal/modalConfirmThumbnailUpload/index.js rename to src/ui/modal/modalConfirmThumbnailUpload/index.js diff --git a/src/renderer/modal/modalConfirmThumbnailUpload/view.jsx b/src/ui/modal/modalConfirmThumbnailUpload/view.jsx similarity index 100% rename from src/renderer/modal/modalConfirmThumbnailUpload/view.jsx rename to src/ui/modal/modalConfirmThumbnailUpload/view.jsx diff --git a/src/renderer/modal/modalConfirmTransaction/index.js b/src/ui/modal/modalConfirmTransaction/index.js similarity index 100% rename from src/renderer/modal/modalConfirmTransaction/index.js rename to src/ui/modal/modalConfirmTransaction/index.js diff --git a/src/renderer/modal/modalConfirmTransaction/view.jsx b/src/ui/modal/modalConfirmTransaction/view.jsx similarity index 100% rename from src/renderer/modal/modalConfirmTransaction/view.jsx rename to src/ui/modal/modalConfirmTransaction/view.jsx diff --git a/src/renderer/modal/modalCreditIntro/index.js b/src/ui/modal/modalCreditIntro/index.js similarity index 100% rename from src/renderer/modal/modalCreditIntro/index.js rename to src/ui/modal/modalCreditIntro/index.js diff --git a/src/renderer/modal/modalCreditIntro/view.jsx b/src/ui/modal/modalCreditIntro/view.jsx similarity index 100% rename from src/renderer/modal/modalCreditIntro/view.jsx rename to src/ui/modal/modalCreditIntro/view.jsx diff --git a/src/renderer/modal/modalDownloading/index.js b/src/ui/modal/modalDownloading/index.js similarity index 100% rename from src/renderer/modal/modalDownloading/index.js rename to src/ui/modal/modalDownloading/index.js diff --git a/src/renderer/modal/modalDownloading/view.jsx b/src/ui/modal/modalDownloading/view.jsx similarity index 100% rename from src/renderer/modal/modalDownloading/view.jsx rename to src/ui/modal/modalDownloading/view.jsx diff --git a/src/renderer/modal/modalError/index.js b/src/ui/modal/modalError/index.js similarity index 100% rename from src/renderer/modal/modalError/index.js rename to src/ui/modal/modalError/index.js diff --git a/src/renderer/modal/modalError/view.jsx b/src/ui/modal/modalError/view.jsx similarity index 83% rename from src/renderer/modal/modalError/view.jsx rename to src/ui/modal/modalError/view.jsx index ad7220182..24062a4b0 100644 --- a/src/renderer/modal/modalError/view.jsx +++ b/src/ui/modal/modalError/view.jsx @@ -1,6 +1,5 @@ // @flow import React from 'react'; -import Native from 'native'; import { ExpandableModal } from 'modal/modal'; type Props = { @@ -40,16 +39,7 @@ class ModalError extends React.PureComponent { - {__('Error')}{' '} - -
- } + title={__('Error')} className="error-modal" onConfirmed={closeModal} extraContent={errorInfo} diff --git a/src/renderer/modal/modalFileTimeout/index.js b/src/ui/modal/modalFileTimeout/index.js similarity index 100% rename from src/renderer/modal/modalFileTimeout/index.js rename to src/ui/modal/modalFileTimeout/index.js diff --git a/src/renderer/modal/modalFileTimeout/view.jsx b/src/ui/modal/modalFileTimeout/view.jsx similarity index 100% rename from src/renderer/modal/modalFileTimeout/view.jsx rename to src/ui/modal/modalFileTimeout/view.jsx diff --git a/src/renderer/modal/modalFirstReward/index.js b/src/ui/modal/modalFirstReward/index.js similarity index 100% rename from src/renderer/modal/modalFirstReward/index.js rename to src/ui/modal/modalFirstReward/index.js diff --git a/src/renderer/modal/modalFirstReward/view.jsx b/src/ui/modal/modalFirstReward/view.jsx similarity index 100% rename from src/renderer/modal/modalFirstReward/view.jsx rename to src/ui/modal/modalFirstReward/view.jsx diff --git a/src/renderer/modal/modalFirstSubscription/index.js b/src/ui/modal/modalFirstSubscription/index.js similarity index 100% rename from src/renderer/modal/modalFirstSubscription/index.js rename to src/ui/modal/modalFirstSubscription/index.js diff --git a/src/renderer/modal/modalFirstSubscription/view.jsx b/src/ui/modal/modalFirstSubscription/view.jsx similarity index 100% rename from src/renderer/modal/modalFirstSubscription/view.jsx rename to src/ui/modal/modalFirstSubscription/view.jsx diff --git a/src/renderer/modal/modalIncompatibleDaemon/index.js b/src/ui/modal/modalIncompatibleDaemon/index.js similarity index 100% rename from src/renderer/modal/modalIncompatibleDaemon/index.js rename to src/ui/modal/modalIncompatibleDaemon/index.js diff --git a/src/renderer/modal/modalIncompatibleDaemon/view.jsx b/src/ui/modal/modalIncompatibleDaemon/view.jsx similarity index 97% rename from src/renderer/modal/modalIncompatibleDaemon/view.jsx rename to src/ui/modal/modalIncompatibleDaemon/view.jsx index 41b43ea20..dead7319b 100644 --- a/src/renderer/modal/modalIncompatibleDaemon/view.jsx +++ b/src/ui/modal/modalIncompatibleDaemon/view.jsx @@ -32,7 +32,8 @@ class ModalIncompatibleDaemon extends React.PureComponent { button="link" label={__('Learn more')} href="https://lbry.io/faq/incompatible-protocol-version" - />. + /> + .

diff --git a/src/renderer/modal/modalOpenExternalLink/index.js b/src/ui/modal/modalOpenExternalLink/index.js similarity index 100% rename from src/renderer/modal/modalOpenExternalLink/index.js rename to src/ui/modal/modalOpenExternalLink/index.js diff --git a/src/renderer/modal/modalOpenExternalLink/view.jsx b/src/ui/modal/modalOpenExternalLink/view.jsx similarity index 97% rename from src/renderer/modal/modalOpenExternalLink/view.jsx rename to src/ui/modal/modalOpenExternalLink/view.jsx index 0ebb58046..a097efa7d 100644 --- a/src/renderer/modal/modalOpenExternalLink/view.jsx +++ b/src/ui/modal/modalOpenExternalLink/view.jsx @@ -1,7 +1,9 @@ // @flow import React from 'react'; import { Modal } from 'modal/modal'; +// @if TARGET='app' import { shell } from 'electron'; +// @endif type Props = { uri: string, diff --git a/src/renderer/modal/modalPhoneCollection/index.js b/src/ui/modal/modalPhoneCollection/index.js similarity index 100% rename from src/renderer/modal/modalPhoneCollection/index.js rename to src/ui/modal/modalPhoneCollection/index.js diff --git a/src/renderer/modal/modalPhoneCollection/view.jsx b/src/ui/modal/modalPhoneCollection/view.jsx similarity index 100% rename from src/renderer/modal/modalPhoneCollection/view.jsx rename to src/ui/modal/modalPhoneCollection/view.jsx diff --git a/src/renderer/modal/modalPublish/index.js b/src/ui/modal/modalPublish/index.js similarity index 100% rename from src/renderer/modal/modalPublish/index.js rename to src/ui/modal/modalPublish/index.js diff --git a/src/renderer/modal/modalPublish/view.jsx b/src/ui/modal/modalPublish/view.jsx similarity index 100% rename from src/renderer/modal/modalPublish/view.jsx rename to src/ui/modal/modalPublish/view.jsx diff --git a/src/renderer/modal/modalRemoveFile/index.js b/src/ui/modal/modalRemoveFile/index.js similarity index 100% rename from src/renderer/modal/modalRemoveFile/index.js rename to src/ui/modal/modalRemoveFile/index.js diff --git a/src/renderer/modal/modalRemoveFile/view.jsx b/src/ui/modal/modalRemoveFile/view.jsx similarity index 100% rename from src/renderer/modal/modalRemoveFile/view.jsx rename to src/ui/modal/modalRemoveFile/view.jsx diff --git a/src/renderer/modal/modalRevokeClaim/index.js b/src/ui/modal/modalRevokeClaim/index.js similarity index 100% rename from src/renderer/modal/modalRevokeClaim/index.js rename to src/ui/modal/modalRevokeClaim/index.js diff --git a/src/renderer/modal/modalRevokeClaim/view.jsx b/src/ui/modal/modalRevokeClaim/view.jsx similarity index 100% rename from src/renderer/modal/modalRevokeClaim/view.jsx rename to src/ui/modal/modalRevokeClaim/view.jsx diff --git a/src/renderer/modal/modalRewardApprovalRequired/index.js b/src/ui/modal/modalRewardApprovalRequired/index.js similarity index 100% rename from src/renderer/modal/modalRewardApprovalRequired/index.js rename to src/ui/modal/modalRewardApprovalRequired/index.js diff --git a/src/renderer/modal/modalRewardApprovalRequired/view.jsx b/src/ui/modal/modalRewardApprovalRequired/view.jsx similarity index 100% rename from src/renderer/modal/modalRewardApprovalRequired/view.jsx rename to src/ui/modal/modalRewardApprovalRequired/view.jsx diff --git a/src/renderer/modal/modalRewardCode/index.js b/src/ui/modal/modalRewardCode/index.js similarity index 100% rename from src/renderer/modal/modalRewardCode/index.js rename to src/ui/modal/modalRewardCode/index.js diff --git a/src/renderer/modal/modalRewardCode/view.jsx b/src/ui/modal/modalRewardCode/view.jsx similarity index 98% rename from src/renderer/modal/modalRewardCode/view.jsx rename to src/ui/modal/modalRewardCode/view.jsx index cf554535c..78d3bb456 100644 --- a/src/renderer/modal/modalRewardCode/view.jsx +++ b/src/ui/modal/modalRewardCode/view.jsx @@ -52,7 +52,8 @@ class ModalRewardCode extends React.PureComponent { button="link" href="https://lbry.io/faq/rewards#reward-code" label={__('Learn more')} - />. + /> + .

{ button="link" label={__('release notes')} href="https://github.com/lbryio/lbry-desktop/releases" - />. + /> + .

diff --git a/src/renderer/modal/modalWalletDecrypt/index.js b/src/ui/modal/modalWalletDecrypt/index.js similarity index 100% rename from src/renderer/modal/modalWalletDecrypt/index.js rename to src/ui/modal/modalWalletDecrypt/index.js diff --git a/src/renderer/modal/modalWalletDecrypt/view.jsx b/src/ui/modal/modalWalletDecrypt/view.jsx similarity index 98% rename from src/renderer/modal/modalWalletDecrypt/view.jsx rename to src/ui/modal/modalWalletDecrypt/view.jsx index 50c1fdca4..2f3f5a33a 100644 --- a/src/renderer/modal/modalWalletDecrypt/view.jsx +++ b/src/ui/modal/modalWalletDecrypt/view.jsx @@ -56,7 +56,8 @@ class ModalWalletDecrypt extends React.PureComponent { button="link" label={__('Learn more')} href="https://lbry.io/faq/wallet-encryption" - />. + /> + .

diff --git a/src/renderer/modal/modalWalletEncrypt/index.js b/src/ui/modal/modalWalletEncrypt/index.js similarity index 100% rename from src/renderer/modal/modalWalletEncrypt/index.js rename to src/ui/modal/modalWalletEncrypt/index.js diff --git a/src/renderer/modal/modalWalletEncrypt/view.jsx b/src/ui/modal/modalWalletEncrypt/view.jsx similarity index 99% rename from src/renderer/modal/modalWalletEncrypt/view.jsx rename to src/ui/modal/modalWalletEncrypt/view.jsx index 6ca1d27cf..15cddcde9 100644 --- a/src/renderer/modal/modalWalletEncrypt/view.jsx +++ b/src/ui/modal/modalWalletEncrypt/view.jsx @@ -110,7 +110,8 @@ class ModalWalletEncrypt extends React.PureComponent { button="link" label={__('Learn more')} href="https://lbry.io/faq/wallet-encryption" - />. + /> + .

{ button="link" label={__('Learn more')} href="https://lbry.io/faq/wallet-encryption" - />. + /> + .

new Promise(resolve => { // @if TARGET='app' @@ -11,6 +12,7 @@ Native.getAppVersionInfo = () => ipcRenderer.send('version-info-requested'); // @endif }); +// @endif // @if TARGET='app' Native.imagePath = file => `${staticResourcesPath}/img/${file}`; diff --git a/src/renderer/page/auth/index.js b/src/ui/page/auth/index.js similarity index 100% rename from src/renderer/page/auth/index.js rename to src/ui/page/auth/index.js diff --git a/src/renderer/page/auth/view.jsx b/src/ui/page/auth/view.jsx similarity index 100% rename from src/renderer/page/auth/view.jsx rename to src/ui/page/auth/view.jsx diff --git a/src/renderer/page/backup/index.js b/src/ui/page/backup/index.js similarity index 100% rename from src/renderer/page/backup/index.js rename to src/ui/page/backup/index.js diff --git a/src/renderer/page/backup/view.jsx b/src/ui/page/backup/view.jsx similarity index 100% rename from src/renderer/page/backup/view.jsx rename to src/ui/page/backup/view.jsx diff --git a/src/renderer/page/channel/index.js b/src/ui/page/channel/index.js similarity index 100% rename from src/renderer/page/channel/index.js rename to src/ui/page/channel/index.js diff --git a/src/renderer/page/channel/view.jsx b/src/ui/page/channel/view.jsx similarity index 71% rename from src/renderer/page/channel/view.jsx rename to src/ui/page/channel/view.jsx index 434c16cec..ff348eefb 100644 --- a/src/renderer/page/channel/view.jsx +++ b/src/ui/page/channel/view.jsx @@ -106,39 +106,38 @@ class ChannelPage extends React.PureComponent {
{contentList}
- {(!fetching || (claimsInChannel && claimsInChannel.length)) && - totalPages > 1 && ( -
- - - this.changePage(e.selected + 1)} - forcePage={currentPage} - initialPage={currentPage} - containerClassName="pagination" - /> - - - this.paginate(e, totalPages)} - label={__('Go to page:')} - type="text" - name="paginate-file" + {(!fetching || (claimsInChannel && claimsInChannel.length)) && totalPages > 1 && ( + + + + this.changePage(e.selected + 1)} + forcePage={currentPage} + initialPage={currentPage} + containerClassName="pagination" /> - - - )} +
+ + this.paginate(e, totalPages)} + label={__('Go to page:')} + type="text" + name="paginate-file" + /> + + + )} {!channelIsMine && } diff --git a/src/renderer/page/discover/index.js b/src/ui/page/discover/index.js similarity index 100% rename from src/renderer/page/discover/index.js rename to src/ui/page/discover/index.js diff --git a/src/renderer/page/discover/view.jsx b/src/ui/page/discover/view.jsx similarity index 100% rename from src/renderer/page/discover/view.jsx rename to src/ui/page/discover/view.jsx diff --git a/src/renderer/page/file/index.js b/src/ui/page/file/index.js similarity index 100% rename from src/renderer/page/file/index.js rename to src/ui/page/file/index.js diff --git a/src/renderer/page/file/view.jsx b/src/ui/page/file/view.jsx similarity index 100% rename from src/renderer/page/file/view.jsx rename to src/ui/page/file/view.jsx diff --git a/src/renderer/page/fileListDownloaded/index.js b/src/ui/page/fileListDownloaded/index.js similarity index 100% rename from src/renderer/page/fileListDownloaded/index.js rename to src/ui/page/fileListDownloaded/index.js diff --git a/src/renderer/page/fileListDownloaded/view.jsx b/src/ui/page/fileListDownloaded/view.jsx similarity index 100% rename from src/renderer/page/fileListDownloaded/view.jsx rename to src/ui/page/fileListDownloaded/view.jsx diff --git a/src/renderer/page/fileListPublished/index.js b/src/ui/page/fileListPublished/index.js similarity index 100% rename from src/renderer/page/fileListPublished/index.js rename to src/ui/page/fileListPublished/index.js diff --git a/src/renderer/page/fileListPublished/view.jsx b/src/ui/page/fileListPublished/view.jsx similarity index 100% rename from src/renderer/page/fileListPublished/view.jsx rename to src/ui/page/fileListPublished/view.jsx diff --git a/src/renderer/page/getCredits/index.js b/src/ui/page/getCredits/index.js similarity index 100% rename from src/renderer/page/getCredits/index.js rename to src/ui/page/getCredits/index.js diff --git a/src/renderer/page/getCredits/view.jsx b/src/ui/page/getCredits/view.jsx similarity index 100% rename from src/renderer/page/getCredits/view.jsx rename to src/ui/page/getCredits/view.jsx diff --git a/src/renderer/page/help/index.js b/src/ui/page/help/index.js similarity index 100% rename from src/renderer/page/help/index.js rename to src/ui/page/help/index.js diff --git a/src/renderer/page/help/view.jsx b/src/ui/page/help/view.jsx similarity index 95% rename from src/renderer/page/help/view.jsx rename to src/ui/page/help/view.jsx index 3276c6ee9..c1c64e36d 100644 --- a/src/renderer/page/help/view.jsx +++ b/src/ui/page/help/view.jsx @@ -2,7 +2,9 @@ // @flow import * as icons from 'constants/icons'; import * as React from 'react'; +// @if TARGET='app' import { shell } from 'electron'; +// @endif import { Lbry } from 'lbry-redux'; import Native from 'native'; import Button from 'component/button'; @@ -272,15 +274,14 @@ class HelpPage extends React.PureComponent { {this.state.accessTokenHidden && (