-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #176 from appsembler/matej-work/add-new-views
Add new views - Learners, Courses
- Loading branch information
Showing
14 changed files
with
1,175 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
frontend/src/components/header-views/header-content-static/HeaderContentStatic.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React, { Component } from 'react'; | ||
import classNames from 'classnames/bind'; | ||
import PropTypes from 'prop-types'; | ||
import styles from './_header-content-static.scss'; | ||
|
||
let cx = classNames.bind(styles); | ||
|
||
class HeaderContentStatic extends Component { | ||
render() { | ||
|
||
return ( | ||
<section className={cx({ 'header-content-static': true, 'container': true})}> | ||
<h1 className={styles['title']}>{this.props.title}</h1> | ||
<p className={styles['subtitle']}>{this.props.subtitle}</p> | ||
</section> | ||
); | ||
} | ||
} | ||
|
||
HeaderContentStatic.defaultProps = { | ||
title: 'Static page header', | ||
subtitle: 'Static page header subtitle.' | ||
} | ||
|
||
HeaderContentStatic.propTypes = { | ||
title: PropTypes.string, | ||
subtitle: PropTypes.string | ||
}; | ||
|
||
export default HeaderContentStatic |
24 changes: 24 additions & 0 deletions
24
frontend/src/components/header-views/header-content-static/_header-content-static.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@import '~base/sass/base/variables'; | ||
@import '~base/sass/base/functions'; | ||
@import '~base/sass/base/grid'; | ||
|
||
.header-content-static { | ||
margin-bottom: calcRem(60); | ||
position: relative; | ||
padding-bottom: calcRem(40); | ||
|
||
.title { | ||
font-weight: 900; | ||
color: pick-visible-color($primary-color, #fff, $base-text-color); | ||
font-size: calcRem(48); | ||
line-height: 120%; | ||
margin: calcRem(20) 0 calcRem(10); | ||
} | ||
|
||
.subtitle { | ||
font-weight: normal; | ||
color: pick-visible-color($primary-color, #fff, $base-text-color); | ||
font-size: calcRem(18); | ||
line-height: 150%; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import styles from './_list-search.scss'; | ||
import classNames from 'classnames/bind'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
import { faSearch, faTimes } from '@fortawesome/free-solid-svg-icons'; | ||
|
||
let cx = classNames.bind(styles); | ||
|
||
|
||
class ListSearch extends Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
value: '', | ||
}; | ||
|
||
this.onChange = this.onChange.bind(this); | ||
this.clearInput = this.clearInput.bind(this); | ||
this.passValue = this.passValue.bind(this); | ||
} | ||
|
||
onChange = (newValue) => { | ||
clearTimeout(this.timer); | ||
this.setState({ | ||
value: newValue | ||
}); | ||
this.timer = setTimeout(this.passValue, this.props.waitInterval); | ||
}; | ||
|
||
clearInput = () => { | ||
this.setState({ | ||
value: '' | ||
}, () => this.props.valueChangeFunction('')) | ||
} | ||
|
||
passValue = () => { | ||
this.props.valueChangeFunction(this.state.value); | ||
} | ||
|
||
componentWillMount() { | ||
this.timer = null; | ||
} | ||
|
||
|
||
|
||
render() { | ||
|
||
return ( | ||
<div className={styles['list-search']}> | ||
<div className={cx({ 'inner-container': true, 'active': (this.state.value !== '')})}> | ||
<FontAwesomeIcon icon={faSearch} className={styles['search-icon']} /> | ||
<input | ||
type="text" | ||
className={styles['list-search-input']} | ||
value={this.state.value} | ||
onChange={(e) => this.onChange(e.target.value)} | ||
placeholder={this.props.inputPlaceholder} | ||
/> | ||
{this.state.value ? ( | ||
<button className={styles['clear-button']} onClick={() => this.clearInput()}> | ||
<FontAwesomeIcon icon={faTimes} className={styles['clear-icon']} /> | ||
</button> | ||
) : ''} | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
ListSearch.defaultProps = { | ||
waitInterval: 1000, | ||
inputPlaceholder: 'Start typing...', | ||
} | ||
|
||
ListSearch.propTypes = { | ||
negativeStyleButton: PropTypes.bool, | ||
buttonText: PropTypes.string, | ||
inputPlaceholder: PropTypes.string | ||
}; | ||
|
||
export default ListSearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@import '~base/sass/base/variables'; | ||
@import '~base/sass/base/functions'; | ||
@import '~base/sass/base/mixins'; | ||
|
||
.list-search { | ||
display: block; | ||
padding: calcRem(15) 0; | ||
|
||
.inner-container { | ||
padding: calcRem(15) 0; | ||
width: 100%; | ||
max-width: calcRem(420); | ||
border-bottom: 1px solid #ccc; | ||
display: flex; | ||
align-items: center; | ||
|
||
&.active { | ||
border-bottom: 2px solid $primary-color; | ||
} | ||
} | ||
|
||
.search-icon { | ||
font-size: calcRem(14); | ||
margin-right: calcRem(10); | ||
color: #ccc; | ||
flex-grow: 0; | ||
flex-shrink: 0; | ||
} | ||
|
||
.list-search-input { | ||
border: none; | ||
font-size: calcRem(14); | ||
flex: 1 1 100%; | ||
outline: none; | ||
|
||
&:focus { | ||
outline: none; | ||
} | ||
} | ||
|
||
.clear-button { | ||
border: none; | ||
flex-grow: 0; | ||
flex-shrink: 0; | ||
|
||
&:hover { | ||
cursor: pointer; | ||
} | ||
} | ||
|
||
.clear-icon { | ||
font-size: calcRem(14); | ||
border: none; | ||
color: $primary-color; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.