From a5d5022688e3bfbf5f529cf26e2c59fdbcefc221 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 13 May 2019 22:54:40 +0200 Subject: [PATCH 1/2] touchbar support --- package.json | 3 ++- src/app/App.jsx | 8 +++++--- src/app/components/Touchbar.js | 35 ++++++++++++++++++++++++++++++++++ src/app/index.js | 11 ++++++++++- src/main.js | 3 +++ 5 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 src/app/components/Touchbar.js diff --git a/package.json b/package.json index dc16487..f4dffa2 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "react": "^16.8.6", "react-blockies": "^1.4.1", "react-dom": "^16.8.6", - "react-pose": "^4.0.8" + "react-pose": "^4.0.8", + "react-touchbar-electron": "0.0.1" }, "devDependencies": { "@babel/core": "^7.4.4", diff --git a/src/app/App.jsx b/src/app/App.jsx index bc9fac5..2292113 100644 --- a/src/app/App.jsx +++ b/src/app/App.jsx @@ -3,12 +3,12 @@ import PropTypes from 'prop-types' import { Router, Location } from '@reach/router' import { webFrame } from 'electron' import posed, { PoseGroup } from 'react-pose' -import AppProvider from './store/AppProvider' import Titlebar from './components/Titlebar' 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 @@ -37,7 +37,7 @@ PosedRouter.propTypes = { export default class App extends PureComponent { render() { return ( - + <>
@@ -45,7 +45,9 @@ export default class App extends PureComponent {
-
+ + + ) } } diff --git a/src/app/components/Touchbar.js b/src/app/components/Touchbar.js new file mode 100644 index 0000000..4dbc342 --- /dev/null +++ b/src/app/components/Touchbar.js @@ -0,0 +1,35 @@ +import React, { PureComponent } from 'react' +import { TouchBar, Button } from 'react-touchbar-electron' +import { locale } from '../util/moneyFormatter' +import { formatCurrency } from '@coingecko/cryptoformat' +import { AppContext } from '../store/createContext' + +export default class Touchbar extends PureComponent { + items = ( + <> +