@@ -11,13 +11,17 @@ import './assets/styles/main.scss';
1111// Assets
1212import arrowImage from './assets/images/arrow.svg' ;
1313import closeImage from './assets/images/close.svg' ;
14+ import githubImage from './assets/images/github.svg' ;
15+ import bitcoinImage from './assets/images/bitcoin.svg' ;
1416import boltImage from './assets/images/bolt.png' ;
1517
1618// Constants
1719import {
1820 APP_NAME ,
1921 APP_TAGLINE ,
2022 APP_INPUT_PLACEHOLDER ,
23+ APP_GITHUB ,
24+ DONATION_BTC ,
2125} from './constants/app' ;
2226import {
2327 TAGS_KEY ,
@@ -31,6 +35,7 @@ const INITIAL_STATE = {
3135 error : { } ,
3236 hasError : false ,
3337 isInvoiceLoaded : false ,
38+ isBitcoinAddrOpened : false ,
3439 text : '' ,
3540} ;
3641
@@ -70,6 +75,10 @@ class App extends PureComponent {
7075 if ( event . key === 'Enter' ) this . getInvoiceDetails ( text ) ;
7176 }
7277
78+ handleBitcoinClick = ( ) => this . setState ( prevState => ( {
79+ isBitcoinAddrOpened : ! prevState . isBitcoinAddrOpened ,
80+ } ) ) ;
81+
7382 renderErrorDetails = ( ) => {
7483 const { hasError, error } = this . state ;
7584
@@ -256,9 +265,52 @@ class App extends PureComponent {
256265 ) ;
257266 }
258267
268+ renderOptions = ( ) => {
269+ const { isBitcoinAddrOpened } = this . state ;
270+ const bitcoinClassnames = cx ( {
271+ 'options__bitcoin' : true ,
272+ 'options__bitcoin--opened' : isBitcoinAddrOpened ,
273+ } ) ;
274+
275+ return (
276+ < div className = 'options' >
277+ < div className = 'options__wrapper' >
278+ < div className = { bitcoinClassnames } >
279+ < div className = 'options__bitcoin-address' >
280+ { DONATION_BTC }
281+ </ div >
282+ < button
283+ onClick = { this . handleBitcoinClick }
284+ className = 'options__bitcoin-icon-wrapper'
285+ >
286+ < img
287+ className = 'options__bitcoin-icon'
288+ src = { bitcoinImage }
289+ alt = 'Bitcoin'
290+ />
291+ </ button >
292+ </ div >
293+ < a
294+ href = { APP_GITHUB }
295+ className = 'options__github'
296+ target = '_blank'
297+ rel = 'noopener noreferrer'
298+ >
299+ < img
300+ className = 'options__github-icon'
301+ src = { githubImage }
302+ alt = 'GitHub'
303+ />
304+ </ a >
305+ </ div >
306+ </ div >
307+ ) ;
308+ }
309+
259310 render ( ) {
260311 return (
261312 < div className = 'app' >
313+ { this . renderOptions ( ) }
262314 { this . renderLogo ( ) }
263315 < div className = 'app__row' >
264316 { this . renderInput ( ) }
0 commit comments