Browse Source

feature(ltc-icon): add ltc icon support

renovate/lint-staged-8.x
Jack Mallers 8 years ago
parent
commit
c15c5404b9
  1. 10
      app/components/CryptoIcon/CryptoIcon.js
  2. 3
      app/components/CryptoIcon/index.js
  3. 26
      app/components/CryptoIcon/litecoin.svg
  4. 1
      app/lnd/methods/index.js
  5. 3
      app/reducers/ticker.js
  6. 3
      app/routes/app/components/components/Nav.js
  7. 14
      app/routes/app/components/components/Nav.scss
  8. 1
      package.json
  9. 6
      resources/litecoin.svg
  10. 33
      yarn.lock

10
app/components/CryptoIcon/CryptoIcon.js

@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import { FaBitcoin } from 'react-icons/lib/fa'
// import Litecoin from '../resources/'
import Isvg from 'react-inlinesvg'
const CryptoIcon = ({ currency }) => {
switch(currency) {
@ -9,9 +9,13 @@ const CryptoIcon = ({ currency }) => {
return (<FaBitcoin />)
break
case 'ltc':
return <span>LTC</span>
return (
<Isvg src='/Users/jmow/Projects/bolt/bolt-desktop/resources/litecoin.svg'></Isvg>
)
break
default:
return <span></span>
}
}
}
export default CryptoIcon

3
app/components/CryptoIcon/index.js

@ -0,0 +1,3 @@
import CryptoIcon from './CryptoIcon'
export default CryptoIcon

26
app/components/CryptoIcon/litecoin.svg

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
]>
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="612px" height="792px"
viewBox="0 0 612 792" enable-background="new 0 0 612 792" xml:space="preserve">
<metadata>
<sfw xmlns="&ns_sfw;">
<slices></slices>
<sliceSourceBounds width="91.512" height="134.376" x="272.761" y="-412.939" bottomLeftOrigin="true"></sliceSourceBounds>
</sfw>
</metadata>
<g>
<path d="M289.508,412.939v-53.83l-16.747,12.361v-13.557l16.747-12.162v-67.188h17.346v55.226l26.716-19.339v13.756l-26.716,19.14
v45.04h57.419v20.554H289.508z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

1
app/lnd/methods/index.js

@ -21,6 +21,7 @@ export default function (lnd, event, msg, data) {
case 'info':
info(lnd)
.then((infoData) => {
console.log('infoData: ', infoData)
event.sender.send('receiveInfo', infoData)
event.sender.send('receiveCryptocurrency', infoData.chains[0])
})

3
app/reducers/ticker.js

@ -56,7 +56,8 @@ export const fetchTicker = () => async (dispatch) => {
// Receive IPC event for receiveCryptocurrency
export const receiveCryptocurrency = (event, currency) => (dispatch) => {
dispatch({ type: SET_CURRENCY, currency: cryptoTickers[currency] })
dispatch({ type: SET_CRYPTO, crypto: cryptoTickers[currency] })
// dispatch({ type: SET_CRYPTO, crypto: cryptoTickers[currency] })
dispatch({ type: SET_CRYPTO, crypto: 'ltc' })
}

3
app/routes/app/components/components/Nav.js

@ -5,6 +5,7 @@ import ReactSVG from 'react-svg'
import { MdAccountBalanceWallet, MdSettings } from 'react-icons/lib/md'
import { FaClockO, FaBitcoin, FaDollar } from 'react-icons/lib/fa'
import { btc } from '../../../../utils'
import CryptoIcon from 'components/CryptoIcon'
import styles from './Nav.scss'
const Nav = ({ ticker, balance, setCurrency, formClicked, currentTicker }) => (
@ -16,7 +17,7 @@ const Nav = ({ ticker, balance, setCurrency, formClicked, currentTicker }) => (
className={`${styles.currency} ${ticker.currency === 'btc' ? styles.active : ''} hint--bottom`}
onClick={() => setCurrency('btc')}
>
<FaBitcoin />
<CryptoIcon currency={ticker.crypto} />
</span>
<span
className={`${styles.currency} ${ticker.currency === 'usd' ? styles.active : ''}`}

14
app/routes/app/components/components/Nav.scss

@ -31,6 +31,20 @@
&.active {
color: $main;
}
span {
display: inline-block;
vertical-align: middle;
svg {
width: 24px;
height: 28px;
g {
transform: scale(1.75) translate(-5px, -5px);
}
}
}
}
.logo {

1
package.json

@ -197,6 +197,7 @@
"react-addons-css-transition-group": "^15.6.0",
"react-dom": "^15.6.1",
"react-hot-loader": "3.0.0-beta.6",
"react-inlinesvg": "^0.6.2",
"react-modal": "^2.2.2",
"react-moment": "^0.6.0",
"react-redux": "^5.0.5",

6
resources/litecoin.svg

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 40 40">
<g>
<path d="M12.29 28.04l1.29-5.52-1.58.67.63-2.85 1.64-.68L16.52 10h5.23l-1.52 7.14 2.09-.74-.58 2.7-2.05.8-.9 4.34h8.1l-.99 3.8z">
</path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 247 B

33
yarn.lock

@ -4401,6 +4401,14 @@ http-signature@~1.1.0:
jsprim "^1.2.2"
sshpk "^1.7.0"
httpplease@^0.16:
version "0.16.4"
resolved "https://registry.yarnpkg.com/httpplease/-/httpplease-0.16.4.tgz#d382ebe230ef5079080b4e9ffebf316a9e75c0da"
dependencies:
urllite "~0.5.0"
xmlhttprequest "*"
xtend "~3.0.0"
https-browserify@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82"
@ -6234,7 +6242,7 @@ on-headers@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7"
once@^1.3.0, once@^1.3.3, once@^1.4.0:
once@^1.3.0, once@^1.3.3, once@^1.4, once@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
dependencies:
@ -7099,6 +7107,13 @@ react-hot-loader@3.0.0-beta.6:
redbox-react "^1.2.5"
source-map "^0.4.4"
react-inlinesvg@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/react-inlinesvg/-/react-inlinesvg-0.6.2.tgz#cad181824652934f6235ff2b09e39b8c86344aab"
dependencies:
httpplease "^0.16"
once "^1.4"
react-modal@^2.2.2:
version "2.2.4"
resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-2.2.4.tgz#a32483c3555bd7677f09bca65d82f51da3abcbc0"
@ -8773,6 +8788,12 @@ url@^0.11.0, url@~0.11.0:
punycode "1.3.2"
querystring "0.2.0"
urllite@~0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/urllite/-/urllite-0.5.0.tgz#1b7bb9ca3fb0db9520de113466bbcf7cc341451a"
dependencies:
xtend "~4.0.0"
utf8-byte-length@^1.0.1:
version "1.0.4"
resolved "https://registry.yarnpkg.com/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz#f45f150c4c66eee968186505ab93fcbb8ad6bf61"
@ -9164,7 +9185,11 @@ xmldom@0.1.x:
version "0.1.27"
resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.27.tgz#d501f97b3bdb403af8ef9ecc20573187aadac0e9"
"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1:
xmlhttprequest@*:
version "1.8.0"
resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc"
"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
@ -9174,6 +9199,10 @@ xtend@~2.1.1:
dependencies:
object-keys "~0.4.0"
xtend@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a"
y18n@^3.2.0, y18n@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"

Loading…
Cancel
Save