From fd1e5f65f7c7a9c41bbe7fca6fcf019843640f31 Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Mon, 31 Jul 2017 23:20:50 -0500 Subject: [PATCH] fix(sass-variables): refactor sass sheets to use variables --- app/reducers/payment.js | 1 + app/routes/activity/components/Activity.scss | 22 ++++---- .../components/components/Invoices.scss | 10 ++-- .../components/components/Payments.js | 53 +++++++++---------- .../components/components/Payments.scss | 17 ++++-- app/routes/app/components/App.js | 2 + .../app/components/components/Form/Form.js | 15 ++++-- .../app/components/components/Form/Form.scss | 36 +++++++------ app/routes/app/components/components/Nav.scss | 16 +++--- app/routes/app/containers/AppContainer.js | 4 +- app/variables.scss | 11 +++- package-lock.json | 25 +++++++-- package.json | 2 +- 13 files changed, 134 insertions(+), 80 deletions(-) diff --git a/app/reducers/payment.js b/app/reducers/payment.js index 9bdf8d8a..fa2055a9 100644 --- a/app/reducers/payment.js +++ b/app/reducers/payment.js @@ -57,6 +57,7 @@ export const fetchPayments = () => async (dispatch) => { } export const payInvoice = (payment_request) => async (dispatch) => { + console.log('payment_request: ', payment_request) dispatch(sendPayment()) const payment = await callApi('sendpayment', 'post', { payment_request }) console.log('payment: ', payment) diff --git a/app/routes/activity/components/Activity.scss b/app/routes/activity/components/Activity.scss index 667258ce..8846d58f 100644 --- a/app/routes/activity/components/Activity.scss +++ b/app/routes/activity/components/Activity.scss @@ -1,7 +1,9 @@ +@import '../../../variables.scss'; + .search { height: 75px; padding: 2px; - border-bottom: 1px solid #EBEBEB; + border-bottom: 1px solid $darkgrey; .input { display: inline-block; @@ -29,7 +31,7 @@ } .activities { - background: #F7F7F7; + background: $lightgrey; .header { width: 75%; @@ -39,8 +41,8 @@ display: inline-block; margin: 60px 0 20px 0; padding: 5px 10px; - background: #F7F7F7; - color: #999; + background: $lightgrey; + color: $darkestgrey; text-transform: uppercase; font-size: 14px; font-weight: 400; @@ -49,12 +51,12 @@ transition: all 0.5s; &:first-child { - border-right: 1px solid #999; + border-right: 1px solid $darkestgrey; } &.active { - color: #eec27b; + color: $main; font-weight: bold; } } @@ -62,7 +64,7 @@ } .activityContainer { - background: #fff; + background: $white; padding: 20px 0; } @@ -70,12 +72,12 @@ .activityList { width: 75%; margin: 0 auto; - background: #fff; + background: $white; } .activity { padding: 35px 10px; - border-bottom: 1px solid #f2f2f2; + border-bottom: 1px solid $grey; font-size: 14px; .left, .center, .right { @@ -89,7 +91,7 @@ .left { width: 80%; - color: #000; + color: $black; } .center { diff --git a/app/routes/activity/components/components/Invoices.scss b/app/routes/activity/components/components/Invoices.scss index 9f1ae063..c7aeaaea 100644 --- a/app/routes/activity/components/components/Invoices.scss +++ b/app/routes/activity/components/components/Invoices.scss @@ -1,14 +1,16 @@ +@import '../../../../variables.scss'; + .invoices { width: 75%; margin: 0 auto; - background: #fff; + background: $white; } .invoice, .invoiceTitles { display: flex; flex-direction: 'row'; padding: 35px 10px; - border-bottom: 1px solid #f2f2f2; + border-bottom: 1px solid $grey; font-size: 14px; .left { @@ -24,7 +26,7 @@ } .settled { - color: #00c730; + color: $main; font-weight: bold; } } @@ -33,7 +35,7 @@ border: none; .left, .center, .right { - color: #000; + color: $black; text-transform: uppercase; font-size: 16px; font-weight: bold; diff --git a/app/routes/activity/components/components/Payments.js b/app/routes/activity/components/components/Payments.js index a152d5d3..3e7bc8f1 100644 --- a/app/routes/activity/components/components/Payments.js +++ b/app/routes/activity/components/components/Payments.js @@ -25,38 +25,37 @@ class Payments extends Component { { - payments.map((payment, index) => ( -
  • -
    -
    {payment.path[0]}
    + payments.map((payment, index) => +
  • +
    +
    {payment.path[0]}
    +
    +
    +
    + {payment.creation_date * 1000}
    -
    -
    - {payment.creation_date * 1000} -
    -
    -
    - +
    +
    + + { + ticker.currency === 'btc' ? + btc.satoshisToBtc(payment.fee) + : + btc.satoshisToUsd(payment.fee, ticker.btcTicker.price_usd) + } + +
    +
    + { ticker.currency === 'btc' ? - btc.satoshisToBtc(payment.fee) + btc.satoshisToBtc(payment.value) : - btc.satoshisToUsd(payment.fee, ticker.btcTicker.price_usd) + btc.satoshisToUsd(payment.value, ticker.btcTicker.price_usd) } - -
    -
    - - { - ticker.currency === 'btc' ? - btc.satoshisToBtc(payment.value) - : - btc.satoshisToUsd(payment.value, ticker.btcTicker.price_usd) - } - -
    -
  • - ) + + + ) } diff --git a/app/routes/activity/components/components/Payments.scss b/app/routes/activity/components/components/Payments.scss index debe1bad..d20aa96c 100644 --- a/app/routes/activity/components/components/Payments.scss +++ b/app/routes/activity/components/components/Payments.scss @@ -1,14 +1,16 @@ +@import '../../../../variables.scss'; + .payments { width: 75%; margin: 0 auto; - background: #fff; + background: $white; } .payment, .paymentTitles { display: flex; flex-direction: 'row'; padding: 35px 10px; - border-bottom: 1px solid #f2f2f2; + border-bottom: 1px solid $grey; font-size: 14px; .left, .center, .right { @@ -29,9 +31,18 @@ border: none; .left, .center, .right { - color: #000; + color: $black; text-transform: uppercase; font-size: 16px; font-weight: bold; } } + + +.payment { + cursor: pointer; + + &:hover { + background: lighten($grey, 5%); + } +} diff --git a/app/routes/app/components/App.js b/app/routes/app/components/App.js index 5fd240d3..ac5e5c2b 100644 --- a/app/routes/app/components/App.js +++ b/app/routes/app/components/App.js @@ -26,6 +26,7 @@ class App extends Component { setCurrency, setForm, createInvoice, + payInvoice, children } = this.props @@ -43,6 +44,7 @@ class App extends Component { ticker={ticker} form={form} createInvoice={createInvoice} + payInvoice={payInvoice} />