From 9954165e413a4d8492a4706769d2e9307c56d71d Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 19 May 2019 13:46:43 +0200 Subject: [PATCH 1/9] basic setup without react-touchbar-electron --- package.json | 3 +-- src/app/App.jsx | 3 --- src/app/index.js | 5 +---- src/app/store/AppProvider.jsx | 7 +++++++ src/main.js | 5 +++-- src/touchbar.js | 37 +++++++++++++++++++++++++++++++++++ webpack.common.config.js | 8 +------- 7 files changed, 50 insertions(+), 18 deletions(-) create mode 100644 src/touchbar.js diff --git a/package.json b/package.json index 9cd5c4f..1487902 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,7 @@ "react": "^16.8.6", "react-blockies": "^1.4.1", "react-dom": "^16.8.6", - "react-pose": "^4.0.8", - "react-touchbar-electron": "0.0.1" + "react-pose": "^4.0.8" }, "devDependencies": { "@babel/core": "^7.4.4", diff --git a/src/app/App.jsx b/src/app/App.jsx index 06eded9..fe17c81 100644 --- a/src/app/App.jsx +++ b/src/app/App.jsx @@ -8,7 +8,6 @@ import Home from './screens/Home' import Preferences from './screens/Preferences' import './App.css' import { defaultAnimation } from './components/Animations' -import Touchbar from './components/Touchbar' // // Disable zooming @@ -51,8 +50,6 @@ export default class App extends PureComponent { - - ) } diff --git a/src/app/index.js b/src/app/index.js index f34f57e..4d5050c 100644 --- a/src/app/index.js +++ b/src/app/index.js @@ -1,6 +1,5 @@ import React from 'react' import { render } from 'react-dom' -import { TouchBarProvider } from 'react-touchbar-electron' import AppProvider from './store/AppProvider' import App from './App' @@ -13,9 +12,7 @@ document.body.appendChild(root) render( - - - + , document.getElementById('root') ) diff --git a/src/app/store/AppProvider.jsx b/src/app/store/AppProvider.jsx index 6f17628..87b02cc 100644 --- a/src/app/store/AppProvider.jsx +++ b/src/app/store/AppProvider.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types' import ms from 'ms' import { ipcRenderer } from 'electron' import Store from 'electron-store' +import { ipcRenderer } from 'electron' import { AppContext } from './createContext' import fetchData from '../util/fetch' import { refreshInterval, prices, oceanTokenContract } from '../config' @@ -37,6 +38,12 @@ export default class AppProvider extends PureComponent { setInterval(this.setBalances, ms(refreshInterval)) this.setState({ isLoading: false }) + + // listener for touchbar + ipcRenderer.on('setCurrency', (evt, currency) => { + console.log('pong') + this.context.toggleCurrencies(currency) + }) } getAccounts() { diff --git a/src/main.js b/src/main.js index 7b7058c..e11223a 100644 --- a/src/main.js +++ b/src/main.js @@ -1,8 +1,8 @@ const path = require('path') const { app, BrowserWindow, systemPreferences } = require('electron') -const { touchBarWrapper } = require('react-touchbar-electron') const pkg = require('../package.json') const buildMenu = require('./menu') +const buildTouchbar = require('./touchbar') const { rgbaToHex } = require('./utils') let mainWindow @@ -108,7 +108,8 @@ const createWindow = async () => { // Load menubar buildMenu(mainWindow) // Load touchbar - process.platform === 'darwin' && touchBarWrapper(mainWindow) + process.platform === 'darwin' && + buildTouchbar(mainWindow, app.getLocale()) } app.on('ready', () => { diff --git a/src/touchbar.js b/src/touchbar.js new file mode 100644 index 0000000..eb1b95c --- /dev/null +++ b/src/touchbar.js @@ -0,0 +1,37 @@ +const { TouchBar } = require('electron') +const { formatCurrency } = require('@coingecko/cryptoformat') +const { prices } = require('./app/config') + +const { TouchBarButton } = TouchBar + +// const currency = ipc... +// const prices = ipc... + +const createButton = (price, key, locale, mainWindow) => { + const formattedPrice = formatCurrency(price, key.toUpperCase(), locale) + .replace(/OCEAN/, 'Ọ') + .replace(/BTC/, 'Ƀ') + .replace(/ETH/, 'Ξ') + + return new TouchBarButton({ + label: formattedPrice, + click: () => { + console.log('ping') + mainWindow.webContents.send('setCurrency', key) + } + // backgroundColor: currency === 'ocean' ? '#f6388a' : '#141414' + }) +} + +const buildTouchbar = (mainWindow, locale) => { + const touchBar = new TouchBar({ + items: [ + createButton(1, 'ocean', locale, mainWindow), + ...prices.map(key => createButton(0, key, locale, mainWindow)) + ] + }) + + mainWindow.setTouchBar(touchBar) +} + +module.exports = buildTouchbar diff --git a/webpack.common.config.js b/webpack.common.config.js index cd7c789..807e936 100644 --- a/webpack.common.config.js +++ b/webpack.common.config.js @@ -2,11 +2,10 @@ const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') const CopyPlugin = require('copy-webpack-plugin') -// Any directories you will be adding code/files into, need to be added to this array so webpack will pick them up const defaultInclude = [path.resolve(__dirname, 'src')] module.exports = { - entry: path.resolve(__dirname, 'src') + '/app/index.js', + entry: path.resolve(__dirname, 'src', 'app', 'index.js'), output: { path: path.resolve(__dirname, 'build'), filename: 'bundle.js', @@ -33,11 +32,6 @@ module.exports = { test: /\.svg$/, use: ['@svgr/webpack'], include: defaultInclude - }, - { - test: /\.(eot|ttf|woff|woff2)$/, - use: ['file-loader?name=font/[name]__[hash:base64:5].[ext]'], - include: defaultInclude } ] }, From d5b43be6ec7a9d591742f43e1824b4bce8c771ab Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 20 May 2019 03:35:19 +0200 Subject: [PATCH 2/9] update touchbar with data --- src/app/components/Balance.jsx | 1 + src/app/components/Ticker.jsx | 1 + src/app/components/Touchbar.js | 49 -------------------------------- src/app/store/AppProvider.jsx | 28 +++++++++++------- src/app/{util => utils}/fetch.js | 0 src/main.js | 13 +++++++-- src/touchbar.js | 45 ++++++++++++++++------------- 7 files changed, 54 insertions(+), 83 deletions(-) delete mode 100644 src/app/components/Touchbar.js rename src/app/{util => utils}/fetch.js (100%) diff --git a/src/app/components/Balance.jsx b/src/app/components/Balance.jsx index 12019c9..6016272 100644 --- a/src/app/components/Balance.jsx +++ b/src/app/components/Balance.jsx @@ -5,6 +5,7 @@ import { AppContext } from '../store/createContext' import { cryptoFormatter } from '../../utils' import './Balance.css' import { fadeIn } from './Animations' +import { cryptoFormatter } from '../../utils' const Animation = posed.h1(fadeIn) diff --git a/src/app/components/Ticker.jsx b/src/app/components/Ticker.jsx index 88ea657..a2eb431 100644 --- a/src/app/components/Ticker.jsx +++ b/src/app/components/Ticker.jsx @@ -4,6 +4,7 @@ import { AppContext } from '../store/createContext' import { cryptoFormatter } from '../../utils' import './Ticker.css' import { fadeIn } from './Animations' +import { cryptoFormatter } from '../../utils' const Item = posed.div(fadeIn) diff --git a/src/app/components/Touchbar.js b/src/app/components/Touchbar.js deleted file mode 100644 index 9d8d923..0000000 --- a/src/app/components/Touchbar.js +++ /dev/null @@ -1,49 +0,0 @@ -import React, { PureComponent } from 'react' -import PropTypes from 'prop-types' -import { TouchBar, Button } from 'react-touchbar-electron' -import { cryptoFormatter } from '../../utils' -import { AppContext } from '../store/createContext' - -const TouchbarItems = ({ prices, currency, toggleCurrencies, accentColor }) => ( - <> - )) diff --git a/src/app/components/Total.jsx b/src/app/components/Total.jsx index 3430ed6..4812f28 100644 --- a/src/app/components/Total.jsx +++ b/src/app/components/Total.jsx @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import { AppContext } from '../store/createContext' import Balance from './Balance' -import { prices } from '../../config' +import { conversions } from '../../config' const calculateTotalBalance = (accounts, currency) => { const balanceTotalArray = [] @@ -23,15 +23,15 @@ export default class Total extends PureComponent { static contextType = AppContext render() { - const conversions = Object.assign( - ...prices.map(key => ({ + const conversionsBalance = Object.assign( + ...conversions.map(key => ({ [key]: calculateTotalBalance(this.context.accounts, key) })) ) const balanceNew = { ocean: calculateTotalBalance(this.context.accounts, 'ocean'), - ...conversions + ...conversionsBalance } return ( diff --git a/src/app/store/AppProvider.jsx b/src/app/store/AppProvider.jsx index efe778a..3910cd9 100644 --- a/src/app/store/AppProvider.jsx +++ b/src/app/store/AppProvider.jsx @@ -5,7 +5,13 @@ import { ipcRenderer } from 'electron' import Store from 'electron-store' import { AppContext } from './createContext' import fetchData from '../utils/fetch' -import { refreshInterval, prices, oceanTokenContract } from '../../config' +import { refreshInterval, conversions, oceanTokenContract } from '../../config' + +// construct initial prices Map to get consistent +// order for Ticker and Touchbar +let pricesMap = new Map() +pricesMap.set('ocean', 1) +conversions.map(key => pricesMap.set(key, 0)) export default class AppProvider extends PureComponent { static propTypes = { @@ -19,7 +25,7 @@ export default class AppProvider extends PureComponent { accounts: [], currency: 'ocean', needsConfig: false, - prices: Object.assign(...prices.map(key => ({ [key]: 0 }))), + prices: pricesMap, toggleCurrencies: currency => this.toggleCurrencies(currency), setBalances: () => this.setBalances(), accentColor: '' @@ -74,20 +80,17 @@ export default class AppProvider extends PureComponent { } fetchAndSetPrices = async () => { - const currencies = prices.join(',') + const currencies = conversions.join(',') const json = await fetchData( `https://api.coingecko.com/api/v3/simple/price?ids=ocean-protocol&vs_currencies=${currencies}` ) - const newPrizes = Object.assign( - ...prices.map(key => ({ - ocean: 1, - [key]: json['ocean-protocol'][key] - })) - ) + let newPrices = new Map(this.state.prices) // make a shallow copy of the Map + conversions.map(key => newPrices.set(key, json['ocean-protocol'][key])) // modify the copy - ipcRenderer.send('prices-updated', newPrizes) - return newPrizes + ipcRenderer.send('prices-updated', Array.from(newPrices)) // convert Map to array, ipc messages seem to kill it + this.setState({ prices: newPrices }) + return newPrices } setBalances = async () => { @@ -98,9 +101,9 @@ export default class AppProvider extends PureComponent { for (const account of accountsPref) { const oceanBalance = await this.getBalance(account) - const conversions = Object.assign( - ...prices.map(key => ({ - [key]: oceanBalance * this.state.prices[key] || 0 + const conversionsBalance = Object.assign( + ...conversions.map(key => ({ + [key]: oceanBalance * this.state.prices.get(key) || 0 })) ) @@ -108,7 +111,7 @@ export default class AppProvider extends PureComponent { address: account, balance: { ocean: oceanBalance, - ...conversions + ...conversionsBalance } } @@ -121,7 +124,8 @@ export default class AppProvider extends PureComponent { } toggleCurrencies(currency) { - ipcRenderer.send('currency-updated', this.state.prices, currency) + const pricesNew = Array.from(this.state.prices) + ipcRenderer.send('currency-updated', pricesNew, currency) this.setState({ currency }) } diff --git a/src/config.js b/src/config.js index e6d0825..2bff297 100644 --- a/src/config.js +++ b/src/config.js @@ -1,5 +1,5 @@ module.exports = { - prices: ['eur', 'usd', 'btc', 'eth'], + conversions: ['eur', 'usd', 'btc', 'eth'], refreshInterval: '1m', oceanTokenContract: '0x985dd3D42De1e256d09e1c10F112bCCB8015AD41' } diff --git a/src/main.js b/src/main.js index 1049d85..d318c1f 100644 --- a/src/main.js +++ b/src/main.js @@ -4,7 +4,6 @@ const pkg = require('../package.json') const buildMenu = require('./menu') const { buildTouchbar, updateTouchbar } = require('./touchbar') const { rgbaToHex } = require('./utils') -const { prices } = require('./config') let mainWindow @@ -65,7 +64,7 @@ const createWindow = async () => { // Load touchbar if (process.platform === 'darwin') { const accentColor = getAccentColor() - buildTouchbar(prices, mainWindow, accentColor) + buildTouchbar(mainWindow, accentColor) ipcMain.on('prices-updated', (event, pricesNew) => { updateTouchbar(pricesNew, mainWindow, accentColor) diff --git a/src/touchbar.js b/src/touchbar.js index 4c6529b..16dd303 100644 --- a/src/touchbar.js +++ b/src/touchbar.js @@ -1,5 +1,6 @@ const { TouchBar } = require('electron') const { cryptoFormatter } = require('./utils') +const { conversions } = require('./config') const { TouchBarButton } = TouchBar @@ -16,11 +17,11 @@ const createButton = ( backgroundColor: key === currentCurrency ? accentColor : '#141414' }) -const buildTouchbar = (prices, mainWindow, accentColor) => { +const buildTouchbar = (mainWindow, accentColor) => { const touchBar = new TouchBar({ items: [ createButton(1, 'ocean', mainWindow, accentColor), - ...prices.map(key => createButton(0, key, mainWindow, accentColor)) + ...conversions.map(key => createButton(0, key, mainWindow, accentColor)) ] }) @@ -28,22 +29,23 @@ const buildTouchbar = (prices, mainWindow, accentColor) => { } const updateTouchbar = ( - prices, + pricesNew, mainWindow, accentColor, currentCurrency = 'ocean' ) => { - const items = Object.keys(prices) - .filter(key => key !== 'ocean') - .map(key => - createButton(prices[key], key, mainWindow, accentColor, currentCurrency) + const items = pricesNew.map(item => { + return createButton( + item[1], + item[0], + mainWindow, + accentColor, + currentCurrency ) + }) const touchBar = new TouchBar({ - items: [ - createButton(1, 'ocean', mainWindow, accentColor, currentCurrency), - ...items - ] + items: [...items] }) mainWindow.setTouchBar(touchBar) From 04ae12fd393e883f292078973a3d18878fc6582b Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sat, 25 May 2019 03:16:53 +0200 Subject: [PATCH 9/9] project restructuring --- README.md | 18 +++++++++++++++++- package.json | 15 ++++++++------- src/{main.js => main/index.js} | 6 +++--- src/{ => main}/menu.js | 4 ++-- src/{ => main}/touchbar.js | 4 ++-- src/{app => renderer}/App.css | 0 src/{app => renderer}/App.jsx | 0 src/{app => renderer}/components/Account.jsx | 0 .../components/Animations.js | 0 src/{app => renderer}/components/Balance.css | 0 src/{app => renderer}/components/Balance.jsx | 0 src/{app => renderer}/components/Spinner.css | 0 src/{app => renderer}/components/Spinner.jsx | 0 src/{app => renderer}/components/Ticker.css | 0 src/{app => renderer}/components/Ticker.jsx | 0 src/{app => renderer}/components/Titlebar.css | 0 src/{app => renderer}/components/Titlebar.jsx | 0 src/{app => renderer}/components/Total.jsx | 0 src/{app => renderer}/components/Welcome.css | 0 src/{app => renderer}/components/Welcome.jsx | 0 src/{app => renderer}/images/cog.svg | 0 src/{app => renderer}/images/icon.icns | Bin src/{app => renderer}/images/icon.ico | Bin src/{app => renderer}/images/icon1024.png | Bin src/{app => renderer}/images/rocket.svg | 0 src/{app => renderer}/index.js | 0 src/{app => renderer}/screens/Home.css | 0 src/{app => renderer}/screens/Home.jsx | 0 .../screens/Preferences/Accounts.jsx | 0 .../screens/Preferences/index.css | 0 .../screens/Preferences/index.jsx | 0 src/{app => renderer}/store/AppProvider.jsx | 0 src/{app => renderer}/store/createContext.jsx | 0 src/{app => renderer}/utils/fetch.js | 0 webpack.common.config.js | 6 +++--- 35 files changed, 35 insertions(+), 18 deletions(-) rename src/{main.js => main/index.js} (96%) rename src/{ => main}/menu.js (97%) rename src/{ => main}/touchbar.js (92%) rename src/{app => renderer}/App.css (100%) rename src/{app => renderer}/App.jsx (100%) rename src/{app => renderer}/components/Account.jsx (100%) rename src/{app => renderer}/components/Animations.js (100%) rename src/{app => renderer}/components/Balance.css (100%) rename src/{app => renderer}/components/Balance.jsx (100%) rename src/{app => renderer}/components/Spinner.css (100%) rename src/{app => renderer}/components/Spinner.jsx (100%) rename src/{app => renderer}/components/Ticker.css (100%) rename src/{app => renderer}/components/Ticker.jsx (100%) rename src/{app => renderer}/components/Titlebar.css (100%) rename src/{app => renderer}/components/Titlebar.jsx (100%) rename src/{app => renderer}/components/Total.jsx (100%) rename src/{app => renderer}/components/Welcome.css (100%) rename src/{app => renderer}/components/Welcome.jsx (100%) rename src/{app => renderer}/images/cog.svg (100%) rename src/{app => renderer}/images/icon.icns (100%) rename src/{app => renderer}/images/icon.ico (100%) rename src/{app => renderer}/images/icon1024.png (100%) rename src/{app => renderer}/images/rocket.svg (100%) rename src/{app => renderer}/index.js (100%) rename src/{app => renderer}/screens/Home.css (100%) rename src/{app => renderer}/screens/Home.jsx (100%) rename src/{app => renderer}/screens/Preferences/Accounts.jsx (100%) rename src/{app => renderer}/screens/Preferences/index.css (100%) rename src/{app => renderer}/screens/Preferences/index.jsx (100%) rename src/{app => renderer}/store/AppProvider.jsx (100%) rename src/{app => renderer}/store/createContext.jsx (100%) rename src/{app => renderer}/utils/fetch.js (100%) diff --git a/README.md b/README.md index 652e8df..88c908b 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ - [Features](#features) - [Download](#download) - [Development](#development) +- [Configuration](#configuration) - [Build packages](#build-packages) - [License](#license) @@ -39,9 +40,10 @@ - re-fetches everything automatically every minute - balances are fetched via etherscan.io API - spot prices are fetched from coingecko.com API -- detects system locale for number formatting - detects dark appearance setting and switches to dark theme automatically (macOS only) - detects system accent color and uses it as primary color (macOS & Windows only) +- Touch Bar support (macOS only) +- detects system locale for number formatting - currently highly optimized for macOS, your mileage on Windows or Linux may vary ## Download @@ -57,6 +59,8 @@ Alternatively, you can [build the app on your system](#build-packages). ## Development +The main app is a React app in `src/renderer/` wrapped within an Electron app defined in `src/main/`. + Clone, and run: ```bash @@ -70,6 +74,18 @@ npm install npm start ``` +## Configuration + +The app has a settings screen where you can add your account addresses. + +When building the app yourself, you can configure more in the `src/config.js` file: + +| Key | Description | +| -------------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| `conversions` | Array defining the currencies the Ocean balance is converted to. Every currency listed here will appear in the ticker buttons. | +| `refreshInterval` | Defines the interval prices and balances are refetched. | +| `oceanTokenContract` | Contract address of the Ocean Token. You should not change this. | + ## Build packages ```bash diff --git a/package.json b/package.json index c439cfe..c7cd0a0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "Blowfish", "version": "1.0.2", "description": "🐡 Simple Electron-based desktop app to retrieve and display your total Ocean Token balances.", - "main": "./src/main.js", + "main": "./src/main/index.js", "scripts": { "test": "eslint ./src/**/*.{js,jsx} && stylelint ./src/**/*.css", "start": "webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js", @@ -21,13 +21,8 @@ "license": "MIT", "dependencies": { "@coingecko/cryptoformat": "^0.3.1", - "@reach/router": "^1.2.1", "ethereum-address": "0.0.4", - "ms": "^2.1.1", - "react": "^16.8.6", - "react-blockies": "^1.4.1", - "react-dom": "^16.8.6", - "react-pose": "^4.0.8" + "ms": "^2.1.1" }, "devDependencies": { "@babel/core": "^7.4.5", @@ -36,6 +31,7 @@ "@babel/preset-env": "^7.4.5", "@babel/preset-react": "^7.0.0", "@babel/runtime": "^7.4.5", + "@reach/router": "^1.2.1", "@svgr/webpack": "^4.2.0", "babel-eslint": "^10.0.1", "babel-loader": "^8.0.6", @@ -52,6 +48,10 @@ "html-webpack-plugin": "^3.2.0", "prettier": "^1.17.0", "prettier-stylelint": "^0.4.2", + "react": "^16.8.6", + "react-blockies": "^1.4.1", + "react-dom": "^16.8.6", + "react-pose": "^4.0.8", "style-loader": "^0.23.1", "stylelint": "^10.0.1", "stylelint-config-standard": "^18.3.0", @@ -64,6 +64,7 @@ "appId": "com.kremalicious.blowfish", "files": [ "./build/**/*", + "./src/main/**/*", "./src/*.js", "package.json" ], diff --git a/src/main.js b/src/main/index.js similarity index 96% rename from src/main.js rename to src/main/index.js index d318c1f..a7458c4 100644 --- a/src/main.js +++ b/src/main/index.js @@ -1,9 +1,9 @@ const path = require('path') const { app, BrowserWindow, systemPreferences, ipcMain } = require('electron') -const pkg = require('../package.json') +const pkg = require('../../package.json') const buildMenu = require('./menu') const { buildTouchbar, updateTouchbar } = require('./touchbar') -const { rgbaToHex } = require('./utils') +const { rgbaToHex } = require('../utils') let mainWindow @@ -44,7 +44,7 @@ const createWindow = async () => { mainWindow.loadURL( isDev ? 'http://localhost:8080' - : `file://${path.join(__dirname, '../build/index.html')}` + : `file://${path.join(__dirname, '../../build/index.html')}` ) createWindowEvents(mainWindow) diff --git a/src/menu.js b/src/main/menu.js similarity index 97% rename from src/menu.js rename to src/main/menu.js index c9fdd1e..fd247ca 100644 --- a/src/menu.js +++ b/src/main/menu.js @@ -1,6 +1,6 @@ const { app, Menu } = require('electron') -const { openUrl } = require('./utils') -const { homepage } = require('../package.json') +const { openUrl } = require('../utils') +const { homepage } = require('../../package.json') const buildMenu = mainWindow => { const template = [ diff --git a/src/touchbar.js b/src/main/touchbar.js similarity index 92% rename from src/touchbar.js rename to src/main/touchbar.js index 16dd303..d321bba 100644 --- a/src/touchbar.js +++ b/src/main/touchbar.js @@ -1,6 +1,6 @@ const { TouchBar } = require('electron') -const { cryptoFormatter } = require('./utils') -const { conversions } = require('./config') +const { cryptoFormatter } = require('../utils') +const { conversions } = require('../config') const { TouchBarButton } = TouchBar diff --git a/src/app/App.css b/src/renderer/App.css similarity index 100% rename from src/app/App.css rename to src/renderer/App.css diff --git a/src/app/App.jsx b/src/renderer/App.jsx similarity index 100% rename from src/app/App.jsx rename to src/renderer/App.jsx diff --git a/src/app/components/Account.jsx b/src/renderer/components/Account.jsx similarity index 100% rename from src/app/components/Account.jsx rename to src/renderer/components/Account.jsx diff --git a/src/app/components/Animations.js b/src/renderer/components/Animations.js similarity index 100% rename from src/app/components/Animations.js rename to src/renderer/components/Animations.js diff --git a/src/app/components/Balance.css b/src/renderer/components/Balance.css similarity index 100% rename from src/app/components/Balance.css rename to src/renderer/components/Balance.css diff --git a/src/app/components/Balance.jsx b/src/renderer/components/Balance.jsx similarity index 100% rename from src/app/components/Balance.jsx rename to src/renderer/components/Balance.jsx diff --git a/src/app/components/Spinner.css b/src/renderer/components/Spinner.css similarity index 100% rename from src/app/components/Spinner.css rename to src/renderer/components/Spinner.css diff --git a/src/app/components/Spinner.jsx b/src/renderer/components/Spinner.jsx similarity index 100% rename from src/app/components/Spinner.jsx rename to src/renderer/components/Spinner.jsx diff --git a/src/app/components/Ticker.css b/src/renderer/components/Ticker.css similarity index 100% rename from src/app/components/Ticker.css rename to src/renderer/components/Ticker.css diff --git a/src/app/components/Ticker.jsx b/src/renderer/components/Ticker.jsx similarity index 100% rename from src/app/components/Ticker.jsx rename to src/renderer/components/Ticker.jsx diff --git a/src/app/components/Titlebar.css b/src/renderer/components/Titlebar.css similarity index 100% rename from src/app/components/Titlebar.css rename to src/renderer/components/Titlebar.css diff --git a/src/app/components/Titlebar.jsx b/src/renderer/components/Titlebar.jsx similarity index 100% rename from src/app/components/Titlebar.jsx rename to src/renderer/components/Titlebar.jsx diff --git a/src/app/components/Total.jsx b/src/renderer/components/Total.jsx similarity index 100% rename from src/app/components/Total.jsx rename to src/renderer/components/Total.jsx diff --git a/src/app/components/Welcome.css b/src/renderer/components/Welcome.css similarity index 100% rename from src/app/components/Welcome.css rename to src/renderer/components/Welcome.css diff --git a/src/app/components/Welcome.jsx b/src/renderer/components/Welcome.jsx similarity index 100% rename from src/app/components/Welcome.jsx rename to src/renderer/components/Welcome.jsx diff --git a/src/app/images/cog.svg b/src/renderer/images/cog.svg similarity index 100% rename from src/app/images/cog.svg rename to src/renderer/images/cog.svg diff --git a/src/app/images/icon.icns b/src/renderer/images/icon.icns similarity index 100% rename from src/app/images/icon.icns rename to src/renderer/images/icon.icns diff --git a/src/app/images/icon.ico b/src/renderer/images/icon.ico similarity index 100% rename from src/app/images/icon.ico rename to src/renderer/images/icon.ico diff --git a/src/app/images/icon1024.png b/src/renderer/images/icon1024.png similarity index 100% rename from src/app/images/icon1024.png rename to src/renderer/images/icon1024.png diff --git a/src/app/images/rocket.svg b/src/renderer/images/rocket.svg similarity index 100% rename from src/app/images/rocket.svg rename to src/renderer/images/rocket.svg diff --git a/src/app/index.js b/src/renderer/index.js similarity index 100% rename from src/app/index.js rename to src/renderer/index.js diff --git a/src/app/screens/Home.css b/src/renderer/screens/Home.css similarity index 100% rename from src/app/screens/Home.css rename to src/renderer/screens/Home.css diff --git a/src/app/screens/Home.jsx b/src/renderer/screens/Home.jsx similarity index 100% rename from src/app/screens/Home.jsx rename to src/renderer/screens/Home.jsx diff --git a/src/app/screens/Preferences/Accounts.jsx b/src/renderer/screens/Preferences/Accounts.jsx similarity index 100% rename from src/app/screens/Preferences/Accounts.jsx rename to src/renderer/screens/Preferences/Accounts.jsx diff --git a/src/app/screens/Preferences/index.css b/src/renderer/screens/Preferences/index.css similarity index 100% rename from src/app/screens/Preferences/index.css rename to src/renderer/screens/Preferences/index.css diff --git a/src/app/screens/Preferences/index.jsx b/src/renderer/screens/Preferences/index.jsx similarity index 100% rename from src/app/screens/Preferences/index.jsx rename to src/renderer/screens/Preferences/index.jsx diff --git a/src/app/store/AppProvider.jsx b/src/renderer/store/AppProvider.jsx similarity index 100% rename from src/app/store/AppProvider.jsx rename to src/renderer/store/AppProvider.jsx diff --git a/src/app/store/createContext.jsx b/src/renderer/store/createContext.jsx similarity index 100% rename from src/app/store/createContext.jsx rename to src/renderer/store/createContext.jsx diff --git a/src/app/utils/fetch.js b/src/renderer/utils/fetch.js similarity index 100% rename from src/app/utils/fetch.js rename to src/renderer/utils/fetch.js diff --git a/webpack.common.config.js b/webpack.common.config.js index 807e936..a6e3bdc 100644 --- a/webpack.common.config.js +++ b/webpack.common.config.js @@ -2,10 +2,10 @@ const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') const CopyPlugin = require('copy-webpack-plugin') -const defaultInclude = [path.resolve(__dirname, 'src')] +const defaultInclude = [path.resolve(__dirname, 'src', 'renderer')] module.exports = { - entry: path.resolve(__dirname, 'src', 'app', 'index.js'), + entry: path.resolve(__dirname, 'src', 'renderer', 'index.js'), output: { path: path.resolve(__dirname, 'build'), filename: 'bundle.js', @@ -42,7 +42,7 @@ module.exports = { plugins: [ new HtmlWebpackPlugin(), new CopyPlugin([ - { from: './src/app/images/icon.*', to: './', flatten: true } + { from: './src/renderer/images/icon.*', to: './', flatten: true } ]) ] }