Browse Source

commit

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
8f040469c5
  1. 2
      app/app.global.scss
  2. BIN
      app/app.icns
  3. 14
      app/components/Contacts/ContactsForm.js
  4. 4
      app/components/Contacts/ContactsForm.scss
  5. 8
      app/components/Nav/Nav.js
  6. 27
      app/components/Nav/Nav.scss
  7. 15
      app/icons/contacts.svg
  8. 18
      app/icons/help_2.svg
  9. 14
      app/icons/network.svg
  10. 15
      app/icons/wallet_2.svg
  11. BIN
      app/icons/zap.icns
  12. 22
      app/menu.js
  13. 43
      app/reducers/activity.js
  14. 14
      app/routes/activity/components/Activity.js
  15. 8
      app/routes/activity/containers/ActivityContainer.js
  16. 2
      app/routes/app/components/App.scss
  17. 4
      package.json

2
app/app.global.scss

@ -25,7 +25,7 @@ body {
}
// disable the pinball scrollers for windows
* {
*, input[type=text], input[type=number] {
&::-webkit-inner-spin-button, &::-webkit-outer-spin-button {
-webkit-appearance: none;
}

BIN
app/app.icns

Binary file not shown.

14
app/components/Contacts/ContactsForm.js

@ -102,7 +102,7 @@ class ContactsForm extends React.Component {
updateManualFormSearchQuery('')
return
}
// clear any existing errors
// clear any existing errors
updateManualFormErrors({ manualInput: null })
const [pubkey, host] = contactsform.manualSearchQuery && contactsform.manualSearchQuery.split('@')
@ -112,6 +112,16 @@ class ContactsForm extends React.Component {
updateManualFormSearchQuery('')
}
const searchUpdated = (search) => {
updateContactFormSearchQuery(search)
console.log('search: ', search)
if (search.includes('@') && search.split('@')[0].length === 66) {
console.log('yo')
updateManualFormSearchQuery(search)
}
}
return (
<div>
<ReactModal
@ -139,7 +149,7 @@ class ContactsForm extends React.Component {
placeholder='Find contact by alias or pubkey'
className={styles.searchInput}
value={contactsform.searchQuery}
onChange={event => updateContactFormSearchQuery(event.target.value)}
onChange={event => searchUpdated(event.target.value)}
/>
</div>

4
app/components/Contacts/ContactsForm.scss

@ -49,7 +49,7 @@
.networkResults {
overflow-y: scroll;
height: 300px;
height: 250px;
margin-top: 30px;
padding: 20px 0;
@ -156,7 +156,7 @@
.manualFormSpinner {
position: absolute;
right: 0;
top: 50%;
top: 40%;
padding: 0 10px;
}
}

8
app/components/Nav/Nav.js

@ -3,10 +3,10 @@ import PropTypes from 'prop-types'
import { NavLink } from 'react-router-dom'
import Isvg from 'react-inlinesvg'
import walletIcon from 'icons/wallet.svg'
import peersIcon from 'icons/peers.svg'
import networkIcon from 'icons/globe.svg'
import helpIcon from 'icons/help.svg'
import walletIcon from 'icons/wallet_2.svg'
import peersIcon from 'icons/channels.svg'
import networkIcon from 'icons/network.svg'
import helpIcon from 'icons/help_2.svg'
import styles from './Nav.scss'

27
app/components/Nav/Nav.scss

@ -3,7 +3,7 @@
.nav {
display: inline-block;
vertical-align: top;
width: 20%;
width: 15%;
font-size: 24px;
background: $secondary;
height: 100vh;
@ -133,12 +133,11 @@
opacity: 0.5;
cursor: pointer;
text-decoration: none;
border-left: 20px solid transparent;
transition: all 0.25s;
li {
margin: 12.5px 0;
min-width: 200px;
min-width: 150px;
}
&.active {
@ -151,15 +150,15 @@
}
svg {
width: 32px;
height: 32px;
width: 28px;
height: 28px;
vertical-align: middle;
}
span {
margin-left: 15px;
line-height: 22px;
font-size: 20px;
font-size: 18px;
font-weight: 500;
letter-spacing: .2px;
}
@ -172,15 +171,17 @@
position: absolute;
bottom: 10px;
right: 12.5%;
.button {
margin-bottom: 20px;
font-weight: bold;
cursor: pointer;
text-transform: uppercase;
letter-spacing: .2px;
font-size: 0.75em;
}
}
.button {
margin-bottom: 20px;
font-weight: bold;
cursor: pointer;
text-transform: uppercase;
letter-spacing: .2px;
}
.content {
width: 80%;

15
app/icons/contacts.svg

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="15px" viewBox="0 0 20 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
<title>Group 7</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Main-Page-Copy-15" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-38.000000, -227.000000)" stroke-linecap="round" stroke-linejoin="round">
<g id="Group-7" transform="translate(39.000000, 228.000000)" stroke="#FFFFFF" stroke-width="0.81">
<path d="M13.5,14 L13.5,12.5416667 C13.5,10.9308361 11.988961,9.625 10.125,9.625 L3.375,9.625 C1.51103897,9.625 1.87350135e-16,10.9308361 0,12.5416667 L0,14" id="Shape"></path>
<ellipse id="Oval" cx="6.75" cy="3.0625" rx="3.15" ry="3.0625"></ellipse>
<path d="M18,14 L18,12.5093697 C17.9987763,11.1507479 16.8884989,9.96465516 15.3,9.625" id="Shape"></path>
<path d="M12.6,0 C14.1887696,0.358150316 15.3,1.61857365 15.3,3.0625 C15.3,4.50642635 14.1887696,5.76684968 12.6,6.125" id="Shape"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

18
app/icons/help_2.svg

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
<title>life-buoy</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Main-Page-Copy-15" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-39.000000, -377.000000)" stroke-linecap="round" stroke-linejoin="round">
<g id="life-buoy" transform="translate(40.000000, 378.000000)" stroke="#FFFFFF" stroke-width="0.8">
<circle id="Oval" cx="8" cy="8" r="8"></circle>
<circle id="Oval" cx="8" cy="8" r="3.2"></circle>
<path d="M2.4,2.4 L5.792,5.792" id="Shape"></path>
<path d="M10.4,10.4 L13.792,13.792" id="Shape"></path>
<path d="M10.4,5.792 L13.792,2.4" id="Shape"></path>
<path d="M10.4,6.024 L13.224,3.2" id="Shape"></path>
<path d="M2.4,13.792 L5.792,10.4" id="Shape"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

14
app/icons/network.svg

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
<title>Group 2</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Main-Page-Copy-15" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-39.000000, -275.000000)" stroke-linecap="round" stroke-linejoin="round">
<g id="Group-2" transform="translate(40.000000, 276.000000)" stroke="#FFFFFF" stroke-width="0.8">
<circle id="Oval" cx="8" cy="8" r="8"></circle>
<path d="M0,8 L16,8" id="Shape"></path>
<path d="M8,1.77635684e-16 C9.87596028,2.19068232 10.9420646,5.03362708 11,8 C10.9420646,10.9663729 9.87596028,13.8093177 8,16 C6.12403972,13.8093177 5.05793543,10.9663729 5,8 C5.05793543,5.03362708 6.12403972,2.19068232 8,0 Z" id="Shape"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

15
app/icons/wallet_2.svg

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="18px" height="16px" viewBox="0 0 18 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
<title>Group 5</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Main-Page-Copy-15" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-39.000000, -175.000000)">
<g id="Group-5" transform="translate(39.000000, 175.000000)" fill="#FFFFFF">
<path d="M16.488,15.8758927 L1.512,15.8758927 C0.67824,15.8758927 0,15.2205883 0,14.4150231 L0,3.3868492 C0,3.2414579 0.09288,3.11693616 0.22392,3.06476224 C0.17496,2.99311007 0.13176,2.91380572 0.0972,2.82615355 C0.02592,2.64667529 0.11808,2.44493616 0.30384,2.37606659 C0.4896,2.30858833 0.69768,2.39624051 0.76896,2.57571877 C0.95328,3.03902311 1.7352,3.04458833 2.07576,3.03902311 L16.488,3.03902311 C17.32176,3.03902311 18,3.69432746 18,4.49989268 L18,14.4150231 C18,15.2205883 17.32176,15.8758927 16.488,15.8758927 L16.488,15.8758927 Z M0.72,3.49050138 L0.72,14.4150231 C0.72,14.8365883 1.07568,15.1802405 1.512,15.1802405 L16.488,15.1802405 C16.92504,15.1802405 17.28,14.8365883 17.28,14.4150231 L17.28,4.49989268 C17.28,4.07832746 16.92504,3.73467529 16.488,3.73467529 L2.08872,3.73467529 C1.79928,3.74858833 1.20168,3.73537094 0.72,3.49050138 L0.72,3.49050138 Z" id="Fill-305"></path>
<path d="M16.06896,3.69015355 C15.87024,3.69015355 15.70896,3.53502311 15.70896,3.34232746 L15.70896,1.27206659 C15.70896,1.0814579 15.63768,0.918675288 15.50736,0.815718766 C15.37704,0.712066592 15.1992,0.674501375 15.00696,0.71137094 L1.54728,1.97119703 C0.77112,2.13815355 0.72,2.75450138 0.71928,2.76076224 L0.72,3.28250138 C0.72,3.47450138 0.55872,3.63032746 0.36,3.63032746 C0.16128,3.63032746 0,3.47450138 0,3.28250138 L0,2.73780572 C0.02808,2.32041442 0.36216,1.51276224 1.43496,1.28528398 L14.90328,0.0240665925 C15.2712,-0.0482812336 15.6708,0.0442405055 15.96528,0.277979636 C16.25976,0.513110071 16.42896,0.875544853 16.42896,1.27206659 L16.42896,3.34232746 C16.42896,3.53502311 16.2684,3.69015355 16.06896,3.69015355" id="Fill-306"></path>
<path d="M14.33952,10.4324144 C13.82328,10.4324144 13.40352,10.0261535 13.40352,9.52737094 C13.40352,9.02928398 13.82328,8.62371877 14.33952,8.62371877 C14.85576,8.62371877 15.27552,9.02928398 15.27552,9.52737094 C15.27552,10.0261535 14.85576,10.4324144 14.33952,10.4324144 L14.33952,10.4324144 Z M14.33952,9.31937094 C14.22,9.31937094 14.12352,9.41258833 14.12352,9.52737094 C14.12352,9.6428492 14.22,9.73676224 14.33952,9.73676224 C14.45832,9.73676224 14.55552,9.6428492 14.55552,9.52737094 C14.55552,9.41258833 14.45832,9.31937094 14.33952,9.31937094 L14.33952,9.31937094 Z" id="Fill-307"></path>
<path d="M17.64,12.243197 L12.48984,12.243197 C11.4912,12.243197 10.67904,11.4585014 10.67904,10.4936318 L10.67904,8.56250138 C10.67904,7.59763181 11.4912,6.81224051 12.48984,6.81224051 L17.64,6.81224051 C17.83872,6.81224051 18,6.96806659 18,7.16006659 L18,11.8953709 C18,12.0880666 17.83872,12.243197 17.64,12.243197 L17.64,12.243197 Z M12.48984,7.50789268 C11.88864,7.50789268 11.39904,7.98093616 11.39904,8.56250138 L11.39904,10.4936318 C11.39904,11.075197 11.88864,11.5475449 12.48984,11.5475449 L17.28,11.5475449 L17.28,7.50789268 L12.48984,7.50789268 L12.48984,7.50789268 Z" id="Fill-308"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
app/icons/zap.icns

Binary file not shown.

22
app/menu.js

@ -47,11 +47,9 @@ export default class MenuBuilder {
const subMenuAbout = {
label: 'Electron',
submenu: [
{ label: 'About ElectronReact', selector: 'orderFrontStandardAboutPanel:' },
{ label: 'About Zap', selector: 'orderFrontStandardAboutPanel:' },
{ type: 'separator' },
{ label: 'Services', submenu: [] },
{ type: 'separator' },
{ label: 'Hide ElectronReact', accelerator: 'Command+H', selector: 'hide:' },
{ label: 'Hide Zap', accelerator: 'Command+H', selector: 'hide:' },
{ label: 'Hide Others', accelerator: 'Command+Shift+H', selector: 'hideOtherApplications:' },
{ label: 'Show All', selector: 'unhideAllApplications:' },
{ type: 'separator' },
@ -104,10 +102,10 @@ export default class MenuBuilder {
const subMenuHelp = {
label: 'Help',
submenu: [
{ label: 'Learn More', click() { shell.openExternal('http://electron.atom.io') } },
{ label: 'Documentation', click() { shell.openExternal('https://github.com/atom/electron/tree/master/docs#readme') } },
{ label: 'Community Discussions', click() { shell.openExternal('https://discuss.atom.io/c/electron') } },
{ label: 'Search Issues', click() { shell.openExternal('https://github.com/atom/electron/issues') } }
{ label: 'Learn More', click() { shell.openExternal('https://zap.jackmallers.com/') } },
{ label: 'Documentation', click() { shell.openExternal('https://github.com/LN-Zap/zap-desktop') } },
{ label: 'Community Discussions', click() { shell.openExternal('zaphq.slack.com') } },
{ label: 'Search Issues', click() { shell.openExternal('https://github.com/LN-Zap/zap-desktop/issues') } }
]
}
@ -169,22 +167,22 @@ export default class MenuBuilder {
submenu: [{
label: 'Learn More',
click() {
shell.openExternal('http://electron.atom.io')
shell.openExternal('https://zap.jackmallers.com/')
}
}, {
label: 'Documentation',
click() {
shell.openExternal('https://github.com/atom/electron/tree/master/docs#readme')
shell.openExternal('https://github.com/LN-Zap/zap-desktop')
}
}, {
label: 'Community Discussions',
click() {
shell.openExternal('https://discuss.atom.io/c/electron')
shell.openExternal('zaphq.slack.com')
}
}, {
label: 'Search Issues',
click() {
shell.openExternal('https://github.com/atom/electron/issues')
shell.openExternal('https://github.com/LN-Zap/zap-desktop/issues')
}
}]
}]

43
app/reducers/activity.js

@ -16,7 +16,8 @@ const initialState = {
modal: {
modalType: null,
modalProps: {}
}
},
searchText: ''
}
// ------------------------------------
@ -29,6 +30,8 @@ export const CHANGE_FILTER = 'CHANGE_FILTER'
export const TOGGLE_PULLDOWN = 'TOGGLE_PULLDOWN'
export const UPDATE_SEARCH_TEXT = 'UPDATE_SEARCH_TEXT'
// ------------------------------------
// Actions
// ------------------------------------
@ -59,6 +62,13 @@ export function toggleFilterPulldown() {
}
}
export function updateSearchText(searchText) {
return {
type: UPDATE_SEARCH_TEXT,
searchText
}
}
// ------------------------------------
// Action Handlers
// ------------------------------------
@ -66,7 +76,9 @@ const ACTION_HANDLERS = {
[SHOW_ACTIVITY_MODAL]: (state, { modalType, modalProps }) => ({ ...state, modal: { modalType, modalProps } }),
[HIDE_ACTIVITY_MODAL]: state => ({ ...state, modal: { modalType: null, modalProps: {} } }),
[CHANGE_FILTER]: (state, { filter }) => ({ ...state, filter, filterPulldown: false }),
[TOGGLE_PULLDOWN]: state => ({ ...state, filterPulldown: !state.filterPulldown })
[TOGGLE_PULLDOWN]: state => ({ ...state, filterPulldown: !state.filterPulldown }),
[UPDATE_SEARCH_TEXT]: (state, { searchText }) => ({ ...state, searchText })
}
// ------------------------------------
@ -75,20 +87,34 @@ const ACTION_HANDLERS = {
const activitySelectors = {}
const filtersSelector = state => state.activity.filters
const filterSelector = state => state.activity.filter
const searchSelector = state => state.activity.searchText
const paymentsSelector = state => state.payment.payments
const invoicesSelector = state => state.invoice.invoices
const transactionsSelector = state => state.transaction.transactions
const allActivity = createSelector(
searchSelector,
paymentsSelector,
invoicesSelector,
transactionsSelector,
(payments, invoices, transactions) => [...payments, ...invoices, ...transactions].sort((a, b) => {
const aTimestamp = Object.prototype.hasOwnProperty.call(a, 'time_stamp') ? a.time_stamp : a.creation_date
const bTimestamp = Object.prototype.hasOwnProperty.call(b, 'time_stamp') ? b.time_stamp : b.creation_date
return bTimestamp - aTimestamp
})
(searchText, payments, invoices, transactions) => {
const searchedArr = [...payments, ...invoices, ...transactions].filter((tx) => {
if ((tx.tx_hash && tx.tx_hash.includes(searchText)) ||
(tx.payment_hash && tx.payment_hash.includes(searchText)) ||
(tx.r_hash && tx.r_hash.includes(searchText))) {
return true
}
return false
})
return searchedArr.sort((a, b) => {
const aTimestamp = Object.prototype.hasOwnProperty.call(a, 'time_stamp') ? a.time_stamp : a.creation_date
const bTimestamp = Object.prototype.hasOwnProperty.call(b, 'time_stamp') ? b.time_stamp : b.creation_date
return bTimestamp - aTimestamp
})
}
)
const lnActivity = createSelector(
@ -131,7 +157,6 @@ activitySelectors.nonActiveFilters = createSelector(
(filters, filter) => filters.filter(f => f.key !== filter.key)
)
export { activitySelectors }

14
app/routes/activity/components/Activity.js

@ -47,14 +47,14 @@ class Activity extends Component {
render() {
const {
ticker,
searchInvoices,
invoice: { invoicesSearchText, invoiceLoading },
updateSearchText,
invoice: { invoiceLoading },
address: { address },
balance,
info,
payment: { paymentLoading },
currentTicker,
activity: { modal, filter, filterPulldown },
activity: { modal, filter, filterPulldown, searchText },
hideActivityModal,
changeFilter,
toggleFilterPulldown,
@ -84,10 +84,10 @@ class Activity extends Component {
<MdSearch />
</label>
<input
value={invoicesSearchText}
onChange={event => searchInvoices(event.target.value)}
value={searchText}
onChange={event => updateSearchText(event.target.value)}
className={`${styles.text} ${styles.input}`}
placeholder='Search by amount, hash, memo, etc'
placeholder='Search by hash...'
type='text'
id='invoiceSearch'
/>
@ -132,7 +132,7 @@ Activity.propTypes = {
fetchBalance: PropTypes.func.isRequired,
ticker: PropTypes.object.isRequired,
searchInvoices: PropTypes.func.isRequired,
updateSearchText: PropTypes.func.isRequired,
invoice: PropTypes.object.isRequired,
payment: PropTypes.object.isRequired,
currentTicker: PropTypes.object.isRequired,

8
app/routes/activity/containers/ActivityContainer.js

@ -3,7 +3,6 @@ import { tickerSelectors } from 'reducers/ticker'
import { fetchBalance } from 'reducers/balance'
import {
fetchInvoices,
searchInvoices,
setInvoice,
invoiceSelectors
} from 'reducers/invoice'
@ -18,7 +17,8 @@ import {
hideActivityModal,
changeFilter,
toggleFilterPulldown,
activitySelectors
activitySelectors,
updateSearchText
} from 'reducers/activity'
import { newAddress } from 'reducers/address'
@ -30,13 +30,13 @@ const mapDispatchToProps = {
fetchPayments,
fetchInvoices,
fetchTransactions,
searchInvoices,
showActivityModal,
hideActivityModal,
changeFilter,
toggleFilterPulldown,
newAddress,
fetchBalance
fetchBalance,
updateSearchText
}
const mapStateToProps = state => ({

2
app/routes/app/components/App.scss

@ -1,6 +1,6 @@
.content {
position: relative;
width: 80%;
width: 85%;
height: 100vh;
display: inline-block;
vertical-align: top;

4
package.json

@ -82,8 +82,8 @@
},
"extraResources": [
{
"from": "./resources/bin/darwin/lnd",
"to": "./bin/lnd"
"from": "./resources/bin/win32/lnd.exe",
"to": "./bin/lnd.exe"
}
]
},

Loading…
Cancel
Save