JimmyMow
7 years ago
committed by
GitHub
13 changed files with 261 additions and 17 deletions
After Width: | Height: | Size: 575 B |
@ -0,0 +1,88 @@ |
|||||
|
import { shell } from 'electron' |
||||
|
import React, { Component } from 'react' |
||||
|
|
||||
|
import { MdSearch } from 'react-icons/lib/md' |
||||
|
|
||||
|
import styles from './Help.scss' |
||||
|
|
||||
|
class Help extends Component { |
||||
|
constructor(props) { |
||||
|
super(props) |
||||
|
|
||||
|
this.state = { |
||||
|
videos: [ |
||||
|
{ |
||||
|
id: '8kZq6eec49A', |
||||
|
title: 'Syncing and Depositing - Zap Lightning Network Wallet Tutorial (Video 1)' |
||||
|
}, |
||||
|
{ |
||||
|
id: 'xSiTH63fOQM', |
||||
|
title: 'Adding a contact - Zap Lightning Network Wallet Tutorial (Video 2)' |
||||
|
}, |
||||
|
{ |
||||
|
id: 'c0SLmywYDHU', |
||||
|
title: 'Making a Lightning Network payment - Zap Lightning Network Wallet Tutorial (Video 3)' |
||||
|
}, |
||||
|
{ |
||||
|
id: 'Xrx2TiiF90Q', |
||||
|
title: 'Receive Lightning Network payment - Zap Lightning Network Wallet Tutorial (Video 4)' |
||||
|
}, |
||||
|
{ |
||||
|
id: 'YfxukBHnwUM', |
||||
|
title: 'Network Map - Zap Lightning Network Wallet Tutorial (Video 5)' |
||||
|
}, |
||||
|
{ |
||||
|
id: 'NORklrrYzOg', |
||||
|
title: 'Using an explorer to add Zap contacts - Zap Lightning Network Wallet Tutorial (Video 6)' |
||||
|
} |
||||
|
], |
||||
|
searchQuery: '' |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
render() { |
||||
|
const { videos, searchQuery } = this.state |
||||
|
const filteredVideos = videos.filter(video => video.title.includes(searchQuery)) |
||||
|
|
||||
|
return ( |
||||
|
<div className={styles.helpContainer}> |
||||
|
<header className={styles.header}> |
||||
|
<h1>Video tutorials</h1> |
||||
|
</header> |
||||
|
|
||||
|
<div className={styles.search}> |
||||
|
<label className={`${styles.label} ${styles.input}`} htmlFor='helpSearch'> |
||||
|
<MdSearch /> |
||||
|
</label> |
||||
|
<input |
||||
|
value={searchQuery} |
||||
|
onChange={event => this.setState({ searchQuery: event.target.value })} |
||||
|
className={`${styles.text} ${styles.input}`} |
||||
|
placeholder='Search the video library...' |
||||
|
type='text' |
||||
|
id='helpSearch' |
||||
|
/> |
||||
|
</div> |
||||
|
|
||||
|
<ul className={styles.videos}> |
||||
|
{ |
||||
|
filteredVideos.map((video, index) => ( |
||||
|
<li key={index}> |
||||
|
<iframe |
||||
|
src={`https://www.youtube.com/embed/${video.id}`} |
||||
|
frameBorder='0' |
||||
|
title={video.id} |
||||
|
/> |
||||
|
<section className={styles.info} onClick={() => shell.openExternal(`https://www.youtube.com/watch?v=${video.id}`)}> |
||||
|
<h2>{video.title}</h2> |
||||
|
</section> |
||||
|
</li> |
||||
|
)) |
||||
|
} |
||||
|
</ul> |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export default Help |
@ -0,0 +1,90 @@ |
|||||
|
@import '../../../variables.scss'; |
||||
|
|
||||
|
.header { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
justify-content: space-between; |
||||
|
background: $lightgrey; |
||||
|
padding: 20px 40px; |
||||
|
|
||||
|
h1 { |
||||
|
text-transform: uppercase; |
||||
|
font-size: 26px; |
||||
|
margin-right: 5px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.search { |
||||
|
height: 55px; |
||||
|
padding: 2px 25px; |
||||
|
border-top: 1px solid $darkgrey; |
||||
|
border-bottom: 1px solid $darkgrey; |
||||
|
background: $white; |
||||
|
|
||||
|
.input { |
||||
|
display: inline-block; |
||||
|
vertical-align: top; |
||||
|
height: 100%; |
||||
|
} |
||||
|
|
||||
|
.label { |
||||
|
width: 5%; |
||||
|
line-height: 50px; |
||||
|
font-size: 20px; |
||||
|
text-align: center; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
|
||||
|
.text { |
||||
|
width: 95%; |
||||
|
outline: 0; |
||||
|
padding: 0; |
||||
|
border: 0; |
||||
|
border-radius: 0; |
||||
|
height: 50px; |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.videos { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
flex-wrap: wrap; |
||||
|
justify-content: space-around; |
||||
|
padding: 20px 40px; |
||||
|
|
||||
|
li { |
||||
|
position: relative; |
||||
|
width: 50%; |
||||
|
text-align: center; |
||||
|
margin: 20px 0; |
||||
|
width: 400px; |
||||
|
height: 400px; |
||||
|
transition: all 0.25s; |
||||
|
|
||||
|
&:hover { |
||||
|
opacity: 0.5; |
||||
|
|
||||
|
.info { |
||||
|
padding: 50px 15px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
iframe { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
||||
|
|
||||
|
.info { |
||||
|
position: absolute; |
||||
|
bottom: 0; |
||||
|
width: calc(100% - 30px); |
||||
|
padding: 15px; |
||||
|
background: $darkgrey; |
||||
|
cursor: pointer; |
||||
|
transition: all 0.25s; |
||||
|
text-align: left; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
import { withRouter } from 'react-router' |
||||
|
import { connect } from 'react-redux' |
||||
|
|
||||
|
import Help from '../components/Help' |
||||
|
|
||||
|
const mapDispatchToProps = {} |
||||
|
|
||||
|
const mapStateToProps = () => ({}) |
||||
|
|
||||
|
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Help)) |
@ -0,0 +1,3 @@ |
|||||
|
import HelpContainer from './containers/HelpContainer' |
||||
|
|
||||
|
export default HelpContainer |
Loading…
Reference in new issue