From d9501ec5485d7d3a5bf8a8f47031da67f2ed6219 Mon Sep 17 00:00:00 2001 From: ubasar Date: Thu, 18 Apr 2019 13:20:06 -0400 Subject: [PATCH 1/3] add debug mode --- app/main.dev.js | 9 +++++---- package.json | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/main.dev.js b/app/main.dev.js index 7bce9d93..3b4db31b 100644 --- a/app/main.dev.js +++ b/app/main.dev.js @@ -21,16 +21,17 @@ if (process.env.NODE_ENV === 'production') { sourceMapSupport.install(); } -if ( - process.env.NODE_ENV === 'development' || - process.env.DEBUG_PROD === 'true' -) { +if (process.env.NODE_ENV === 'development') { require('electron-debug')(); const path = require('path'); const p = path.join(__dirname, '..', 'app', 'node_modules'); require('module').globalPaths.push(p); } +if (process.env.DEBUG_PROD === 'true') { + require('electron-debug')(); +} + const installExtensions = async () => { const installer = require('electron-devtools-installer'); const forceDownload = !!process.env.UPGRADE_EXTENSIONS; diff --git a/package.json b/package.json index bd1b2a4b..088f1b47 100755 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "description": "A community wallet for Tezos", "scripts": { "build": "npm run check-wallet-state && concurrently \"yarn build-main\" \"yarn build-renderer\"", + "build-debug": "cross-env DEBUG_PROD=true yarn build", "build-dll": "cross-env NODE_ENV=development node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config ./configs/webpack.config.renderer.dev.dll.js --colors", "build-e2e": "cross-env E2E_BUILD=true yarn build", "build-main": "cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config ./configs/webpack.config.main.prod.js --colors", @@ -19,10 +20,13 @@ "lint-styles-fix": "yarn --silent lint-styles --fix; exit 0", "check-wallet-state": "node -r babel-register internals/scripts/CheckWalletStateExist.js", "package": "yarn build && electron-builder build --publish never", + "package-debug": "yarn build-debug && electron-builder build --publish never", "package-all": "yarn build && electron-builder build -mwl", "package-ci": "yarn postinstall && yarn build && electron-builder --publish always", "package-linux": "yarn build && electron-builder build --linux", + "package-linux-debug": "yarn build-debug && electron-builder build --linux", "package-win": "yarn build && electron-builder build --win --x64", + "package-win-debug": "yarn build-debug && electron-builder build --win --x64", "postinstall": "node -r babel-register internals/scripts/CheckNativeDep.js && yarn flow-typed && yarn build-dll && electron-builder install-app-deps package.json", "postlint-fix": "prettier --ignore-path .eslintignore --single-quote --write '**/*.{*{js,jsx,json},babelrc,eslintrc,prettierrc,stylelintrc}'", "postlint-styles-fix": "prettier --ignore-path .eslintignore --single-quote --write '**/*.{css,scss}'", From 09264a936bee372d1a3afe61708952a213279198 Mon Sep 17 00:00:00 2001 From: developer0623 Date: Thu, 18 Apr 2019 22:33:57 -0400 Subject: [PATCH 2/3] used the latest version of walletsettings --- app/utils/settings.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/utils/settings.js b/app/utils/settings.js index 3b9f801f..f5ecbfdc 100644 --- a/app/utils/settings.js +++ b/app/utils/settings.js @@ -9,14 +9,16 @@ if (process.env.NODE_ENV === 'production') { } export function getWalletSettings() { - const settings = localStorage.getItem('settings'); - if (settings) { - return JSON.parse(settings); + const stringSettings = localStorage.getItem('settings'); + let localSettings = {}; + let fileSettings = {}; + if (stringSettings) { + localSettings = JSON.parse(stringSettings); } if (fs.existsSync(filePath)) { - return JSON.parse(fs.readFileSync(filePath)); + fileSettings = JSON.parse(fs.readFileSync(filePath)); } - return {}; + return {...localSettings, ...fileSettings}; } export function setWalletSettings(nodes) { From be5eba75b829e622046eb14bc4373026fbb5858d Mon Sep 17 00:00:00 2001 From: developer0623 Date: Fri, 19 Apr 2019 06:01:05 -0400 Subject: [PATCH 3/3] fixed some ui issues --- .../InteractContractModal/CustomTextArea.js | 129 +++++++++--------- .../InteractContractModal/InvokeContract.js | 24 +++- app/components/InteractContractModal/style.js | 8 ++ app/components/Invoke/index.js | 27 ++++ app/components/TextField/index.js | 3 +- 5 files changed, 123 insertions(+), 68 deletions(-) diff --git a/app/components/InteractContractModal/CustomTextArea.js b/app/components/InteractContractModal/CustomTextArea.js index 8389d8b5..86c1baa5 100644 --- a/app/components/InteractContractModal/CustomTextArea.js +++ b/app/components/InteractContractModal/CustomTextArea.js @@ -1,92 +1,89 @@ import React from 'react'; -import styled from 'styled-components'; +import { withStyles } from '@material-ui/core/styles'; import InputLabel from '@material-ui/core/InputLabel'; import Input from '@material-ui/core/Input'; import FormControl from '@material-ui/core/FormControl'; import FormHelperText from '@material-ui/core/FormHelperText'; +import themes from '../../styles/theme'; -const Container = styled(FormControl)` - width: 100%; - pointer-events: ${props => (props.disabled ? 'none' : 'auto')}; -`; - -const TextAreaWrapper = styled(Input)` - &&& { - &[class*='focused'] { - &:after { - border-bottom-color: ${({ error, theme: { colors } }) => - error ? colors.error1 : colors.accent}; - } - } - background-color: ${({ theme: { colors } }) => colors.gray14}; - border: 1px solid ${({ theme: { colors } }) => colors.gray14}; - font-size: 14px; - color: ${({ theme: { colors } }) => colors.blue5}; - padding: 10px 22px 5px 22px; - &:before { - border-bottom: ${({ disabled }) => - disabled - ? '1px dotted rgba(0, 0, 0, 0.32)' - : '1px solid rgba(0, 0, 0, 0.12)'} ; - } - &:hover:before { - border-bottom: solid 2px ${({ error, theme: { colors } }) => - error ? colors.error1 : colors.accent} !important; - } - } -}`; - -const LabelWrapper = styled(InputLabel)` - &&& { - &[class*='focused'] { - color: ${({ theme: { colors } }) => colors.gray3}; - } - &[class*='shrink'] { - transform: translate(0, 1.5px) scale(0.75); +const styles = { + cssContainer: { + width: '100%' + }, + cssLabel: { + color: themes.colors.gray15, + zIndex: 10, + fontSize: '16px', + pointerEvents: 'none', + '&$cssFocused': { + color: themes.colors.gray3 } - color: ${({ theme: { colors } }) => colors.gray15}; - z-index: 10; - font-size: 16px; - pointer-events: none; - transform: translate(22px, 34px) scale(1); + }, + cssFormControl: { + transform: 'translate(22px, 34px) scale(1)' + }, + cssShrink: { + transform: 'translate(0, 1.5px) scale(0.75)' + }, + cssFocused: {}, + cssInput: { + backgroundColor: themes.colors.gray14, + border: `1px solid ${themes.colors.gray14}`, + fontSize: '14px', + color: themes.colors.blue5, + padding: '10px 22px 5px 22px' + }, + cssText: { + color: themes.colors.error1, + fontSize: '12px', + marginTop: '5px', + lineHeight: '18px', + height: '18px' } -}`; - -const ErrorText = styled(FormHelperText)` - &&& { - color: ${({ theme: { colors } }) => colors.error1}; - font-size: 12px; - margin-top: 5px; - line-height: 18px; - height: 18px; - } -}`; +}; type Props = { label: string, errorText?: string | React.Node, - disabled?: boolean, - onChange?: () => {} + onChange?: () => {}, + classes: object }; const CustomTextArea = (props: Props) => { - const { label, onChange, errorText, disabled, ...other } = props; + const { label, onChange, errorText, classes, ...other } = props; return ( - - {label} - + + {label} + + onChange(event.target.value)} multiline {...other} /> - {errorText} - + + {errorText} + + ); }; CustomTextArea.defaultProps = { - errorText: '', - disabled: false + errorText: '' }; -export default CustomTextArea; +export default withStyles(styles)(CustomTextArea); diff --git a/app/components/InteractContractModal/InvokeContract.js b/app/components/InteractContractModal/InvokeContract.js index 72ff1a83..a4ca5e10 100644 --- a/app/components/InteractContractModal/InvokeContract.js +++ b/app/components/InteractContractModal/InvokeContract.js @@ -30,7 +30,8 @@ import { ViewScan, LinkIcon, InvokeAddressContainer, - ItemWrapper + ItemWrapper, + SelectRenderWrapper } from './style'; const utez = 1000000; @@ -204,6 +205,27 @@ class InvokeContract extends Component { label={t('components.interactModal.invoke_from')} value={selectedInvokeAddress} onChange={this.onChangeInvokeAddress} + renderValue={value => { + const address = addresses.find( + address => address.pkh === value + ); + return ( + + + + + + ); + }} > {addresses.map(address => ( { label={t('components.interactModal.invoke_from')} value={selectedInvokeAddress} onChange={this.onChangeInvokeAddress} + renderValue={value => { + const address = addresses.find(address => address.pkh === value); + return ( + + + + + + ); + }} > {addresses.map(address => ( { const { label, type, onChange, errorText, disabled, right, ...other } = props; return ( - {label} + {label} onChange(event.target.value)}