From 05c6789030791bd1b46434cf89c1817db37e8f38 Mon Sep 17 00:00:00 2001 From: Dan <danjm.com@gmail.com> Date: Fri, 8 Dec 2017 21:18:08 -0330 Subject: [PATCH] Adds button for opening app in main browser window in extension. --- app/images/open.svg | 15 +++++++++++++++ app/scripts/platforms/extension.js | 5 +++++ ui/app/components/tx-view.js | 5 +++++ ui/app/css/itcss/components/newui-sections.scss | 4 ++++ 4 files changed, 29 insertions(+) create mode 100644 app/images/open.svg diff --git a/app/images/open.svg b/app/images/open.svg new file mode 100644 index 000000000..2957ce43d --- /dev/null +++ b/app/images/open.svg @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch --> + <title>open</title> + <desc>Created with Sketch.</desc> + <defs></defs> + <g id="Mobile-screens" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="MetaMascara-Mobile---structured" transform="translate(-329.000000, -93.000000)"> + <g id="open" transform="translate(330.000000, 94.000000)"> + <path d="M26,13 C26,20.1799 20.1799,26 13,26 C5.8201,26 0,20.1799 0,13 C0,5.8201 5.8201,0 13,0 C20.1799,0 26,5.8201 26,13 Z" id="Stroke-3" stroke="#4A4A4A"></path> + <path d="M6,17 C6,17 7.78735344,10.8360387 13.7616996,10.8360387 L13.7616996,8 L19,12.3733433 L13.7616996,17 L13.7616996,14.1639613 C13.7616996,14.1639613 9.54083576,13.4629933 6,17" id="Fill-5" fill="#4A4A4A"></path> + </g> + </g> + </g> +</svg> \ No newline at end of file diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 2f47512eb..f5cc255d1 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -17,6 +17,11 @@ class ExtensionPlatform { return extension.runtime.getManifest().version } + openExtensionInBrowser () { + const extensionURL = extension.runtime.getURL('home.html') + this.openWindow({ url: extensionURL }) + } + getPlatformInfo (cb) { try { extension.runtime.getPlatformInfo((platform) => { diff --git a/ui/app/components/tx-view.js b/ui/app/components/tx-view.js index ebef22680..832f8e56a 100644 --- a/ui/app/components/tx-view.js +++ b/ui/app/components/tx-view.js @@ -107,6 +107,7 @@ TxView.prototype.render = function () { h('div.flex-row.phone-visible', { style: { margin: '1em 0.9em', + justifyContent: 'space-between', alignItems: 'center', }, }, [ @@ -139,6 +140,10 @@ TxView.prototype.render = function () { identity.name, ]), + h('div.open-in-browser', { + onClick: () => global.platform.openExtensionInBrowser(), + }, [h('img', { src: 'images/open.svg' })]) + ]), this.renderHeroBalance(), diff --git a/ui/app/css/itcss/components/newui-sections.scss b/ui/app/css/itcss/components/newui-sections.scss index 43a59c4da..61dfbd176 100644 --- a/ui/app/css/itcss/components/newui-sections.scss +++ b/ui/app/css/itcss/components/newui-sections.scss @@ -38,6 +38,10 @@ $wallet-view-bg: $wild-sand; } } +.open-in-browser { + cursor: pointer; +} + // wallet view and sidebar .wallet-view {