Skip to content

Commit

Permalink
Fix import account on home page
Browse files Browse the repository at this point in the history
  • Loading branch information
wliyongfeng committed May 20, 2020
1 parent efa9f96 commit 2c1ce82
Show file tree
Hide file tree
Showing 4 changed files with 2,633 additions and 2,556 deletions.
4 changes: 2 additions & 2 deletions electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ function createWindow() {
height: isWin() ? 665 : 610,
webPreferences: { preload: path.join(__dirname, 'preload.js') }
})
mainWindow.removeMenu()
mainWindow.removeMenu() // only work for linux and windows
if (isDev) {
mainWindow
.loadURL('http://localhost:3001')
.loadURL('http://localhost:3002')
.then(() => console.log('url loaded'))
} else {
mainWindow
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,18 @@
"ts-pnp": "1.1.4",
"url-loader": "2.1.0",
"webpack": "4.41.0",
"webpack-dev-server": "3.2.1",
"webpack-dev-server": "^3.11.0",
"webpack-manifest-plugin": "2.1.1",
"workbox-webpack-plugin": "4.3.1",
"ws": "^7.2.0"
},
"scripts": {
"start": "PORT=3001 node scripts/start.js",
"start": "PORT=3002 node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js",
"dev": "concurrently \"BROWSER=none yarn start\" \"wait-on http://localhost:3001 && electron .\"",
"electron": "electron .",
"fix": "electron-fix start",
"dist": "yarn build && rimraf dist && electron-builder"
},
"eslintConfig": {
Expand All @@ -108,8 +109,8 @@
},
"devDependencies": {
"concurrently": "^5.0.0",
"electron": "^7.1.2",
"electron-builder": "^21.2.0",
"electron": "^9.0.0",
"electron-builder": "^22.6.1",
"husky": "^3.1.0",
"lint-staged": "^9.4.3",
"node-sass": "^4.13.0",
Expand Down
6 changes: 5 additions & 1 deletion src/pages/Home/CreateOrImportAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import React from 'react'
import styled from 'styled-components'
import { WhiteButton } from '@chainx/ui'
import { useHistory } from 'react-router'
import { useDispatch } from 'react-redux'
import { setShowImportMenu } from '../../store/reducers/statusSlice'

const Wrapper = styled.div`
padding: 60px 20px 0;
Expand All @@ -15,6 +17,8 @@ const Wrapper = styled.div`
export default React.memo(function() {
const history = useHistory()

const dispatch = useDispatch()

return (
<Wrapper>
<img src={logo} alt="logo" width="90" height="90" />
Expand All @@ -28,7 +32,7 @@ export default React.memo(function() {
<WhiteButton
size="fullWidth"
style={{ marginTop: 16 }}
onClick={() => history.push('/importAccount')}
onClick={() => dispatch(setShowImportMenu(true))}
>
Import Account
</WhiteButton>
Expand Down
Loading

0 comments on commit 2c1ce82

Please sign in to comment.