Browse Source

Merge pull request #75 from LN-Zap/fix/bugs

Fix/bugs
renovate/lint-staged-8.x
JimmyMow 7 years ago
committed by GitHub
parent
commit
86b12e24bb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/components/Form/PayForm.js
  2. 19
      app/components/Form/PayForm.scss
  3. 2
      app/components/Form/RequestForm.js
  4. 18
      app/components/Form/RequestForm.scss
  5. 7
      app/components/Nav/Nav.js
  6. 55
      app/containers/Root.js
  7. 6
      app/reducers/address.js
  8. 2
      app/routes.js
  9. 20
      app/routes/app/components/App.js
  10. BIN
      resources/bin/darwin/lnd

2
app/components/Form/PayForm.js

@ -108,7 +108,7 @@ class PayForm extends Component {
</section>
</div>
<section className={styles.buttonGroup}>
<div className={`${styles.button} ${isValid && styles.active}`} onClick={onPaySubmit}>Pay</div>
<div className={`buttonPrimary ${styles.button} ${isValid && styles.active}`} onClick={onPaySubmit}>Pay</div>
</section>
</div>
)

19
app/components/Form/PayForm.scss

@ -156,21 +156,12 @@
overflow: hidden;
.button {
height: 55px;
min-height: 55px;
text-transform: none;
font-size: 18px;
transition: opacity .2s ease-out;
background: $main;
color: $white;
border: none;
font-weight: 500;
padding: 0;
width: 100%;
text-align: center;
line-height: 55px;
opacity: 0.5;
cursor: default;
margin-bottom: 20px;
font-weight: bold;
cursor: pointer;
text-transform: uppercase;
letter-spacing: .2px;
&:first-child {
border-right: 1px solid lighten($main, 20%);

2
app/components/Form/RequestForm.js

@ -38,7 +38,7 @@ const RequestForm = ({
/>
</section>
<section className={styles.buttonGroup}>
<div className={styles.button} onClick={onRequestSubmit}>
<div className={`buttonPrimary ${styles.button}`} onClick={onRequestSubmit}>
Request
</div>
</section>

18
app/components/Form/RequestForm.scss

@ -89,20 +89,12 @@
overflow: hidden;
.button {
cursor: pointer;
height: 55px;
min-height: 55px;
text-transform: none;
font-size: 18px;
transition: opacity .2s ease-out;
background: $main;
color: $white;
border: none;
font-weight: 500;
padding: 0;
width: 100%;
text-align: center;
line-height: 55px;
margin-bottom: 20px;
font-weight: bold;
cursor: pointer;
text-transform: uppercase;
letter-spacing: .2px;
&:first-child {
border-right: 1px solid lighten($main, 20%);

7
app/components/Nav/Nav.js

@ -38,13 +38,6 @@ const Nav = ({ openPayForm, openRequestForm }) => (
<span>Channels</span>
</li>
</NavLink>
<NavLink exact to='/settings' activeClassName={styles.active} className={styles.link}>
<span className={styles.activeBorder} />
<li>
<Isvg styles={{ verticalAlign: 'middle' }} src={settingsIcon} />
<span>Settings</span>
</li>
</NavLink>
</ul>
<div className={styles.buttons}>
<div className={`buttonPrimary ${styles.button}`} onClick={openPayForm}>

55
app/containers/Root.js

@ -1,20 +1,55 @@
// @flow
import React from 'react'
import { Provider } from 'react-redux'
import { Provider, connect } from 'react-redux'
import { ConnectedRouter } from 'react-router-redux'
import { fetchBlockHeight, lndSelectors } from 'reducers/lnd'
import LndSyncing from 'components/LndSyncing'
import Routes from '../routes'
const mapDispatchToProps = {
fetchBlockHeight
}
const mapStateToProps = state => ({
lnd: state.lnd,
syncPercentage: lndSelectors.syncPercentage(state)
})
type RootType = {
store: {},
history: {}
};
export default function Root({ store, history }: RootType) {
return (
<Provider store={store}>
<ConnectedRouter history={history}>
<Routes />
</ConnectedRouter>
</Provider>
)
}
class Root extends React.Component {
render() {
const {
store,
history,
lnd,
fetchBlockHeight,
syncPercentage
} = this.props
if (lnd.syncing) {
return (
<LndSyncing
fetchBlockHeight={fetchBlockHeight}
fetchingBlockHeight={lnd.fetchingBlockHeight}
syncPercentage={syncPercentage}
/>
)
}
return (
<Provider store={store}>
<ConnectedRouter history={history}>
<Routes />
</ConnectedRouter>
</Provider>
)
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Root)

6
app/reducers/address.js

@ -24,11 +24,15 @@ export function getAddress() {
// Send IPC event for getinfo
export const newAddress = type => async (dispatch) => {
dispatch(getAddress())
console.log('getting new address type: ', addressTypes[type])
ipcRenderer.send('lnd', { msg: 'newaddress', data: { type: addressTypes[type] } })
}
// Receive IPC event for info
export const receiveAddress = (event, address) => dispatch => dispatch({ type: RECEIVE_ADDRESS, address })
export const receiveAddress = (event, address) => dispatch => {
console.log('address: ', address)
dispatch({ type: RECEIVE_ADDRESS, address })
}
// ------------------------------------
// Action Handlers

2
app/routes.js

@ -14,4 +14,4 @@ export default () => (
<Route path='/' component={Activity} />
</Switch>
</App>
);
)

20
app/routes/app/components/App.js

@ -13,12 +13,10 @@ class App extends Component {
componentWillMount() {
const { fetchTicker, fetchBalance, fetchInfo, newAddress, lnd: { syncing } } = this.props
if (!syncing) {
fetchTicker()
fetchBalance()
fetchInfo()
newAddress('p2pkh')
}
fetchTicker()
fetchBalance()
fetchInfo()
newAddress('p2pkh')
}
render() {
@ -47,16 +45,6 @@ class App extends Component {
children
} = this.props
if (lnd.syncing) {
return (
<LndSyncing
fetchBlockHeight={fetchBlockHeight}
fetchingBlockHeight={lnd.fetchingBlockHeight}
syncPercentage={syncPercentage}
/>
)
}
if (!currentTicker || balance.balanceLoading) { return <LoadingBolt /> }
return (

BIN
resources/bin/darwin/lnd

Binary file not shown.
Loading…
Cancel
Save