Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
656 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
.copy-input .copy-title { | ||
white-space: nowrap; | ||
color: var(--grey-color); | ||
padding: 0 1em; | ||
} | ||
|
||
|
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
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 @@ | ||
export { default } from './inputButton' |
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,14 @@ | ||
.input-button { | ||
display: flex; | ||
} | ||
|
||
.input-button > input { | ||
border-top-right-radius: 0; | ||
border-bottom-right-radius: 0; | ||
border-right: transparent; | ||
} | ||
|
||
.input-button > button { | ||
border-top-left-radius: 0; | ||
border-bottom-left-radius: 0; | ||
} |
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,59 @@ | ||
import React, { Component } from 'react' | ||
import PropTypes from 'prop-types' | ||
import cn from 'classnames' | ||
|
||
import './inputButton.css' | ||
|
||
class InputButton extends Component { | ||
state = { value: this.props.defaultValue } | ||
|
||
handleChange = e => this.setState({ value: e.target.value }) | ||
|
||
handleClick = () => this.props.onClick(this.state.value) | ||
|
||
handleKeyPress = (e) => { | ||
if (e.charCode === 13) { | ||
this.props.onClick(this.state.value) | ||
} | ||
} | ||
|
||
render() { | ||
const { | ||
btnLabel, className, btnClassName, defaultValue, onClick, ...inputProps | ||
} = this.props | ||
|
||
return ( | ||
<div className={cn('input-button', className)}> | ||
<input | ||
defaultValue={this.state.value} | ||
{...inputProps} | ||
onChange={this.handleChange} | ||
onKeyPress={this.handleKeyPress} | ||
/> | ||
<button | ||
onClick={this.handleClick} | ||
className={cn('btn', btnClassName)} | ||
disabled={!this.state.value} | ||
> | ||
{btnLabel} | ||
</button> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
InputButton.propTypes = { | ||
onClick: PropTypes.func.isRequired, | ||
btnLabel: PropTypes.node.isRequired, | ||
defaultValue: PropTypes.string, | ||
className: PropTypes.string, | ||
btnClassName: PropTypes.string, | ||
} | ||
|
||
InputButton.defaultProps = { | ||
className: undefined, | ||
defaultValue: undefined, | ||
btnClassName: undefined, | ||
} | ||
|
||
export default InputButton |
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
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
/* eslint-disable react/jsx-filename-extension, react/prop-types */ | ||
import React from 'react' | ||
import Modal from './modal.container' | ||
import { inject } from '@k-ramel/react' | ||
|
||
export default id => Component => ({ modalId, children, ...rest }) => ( | ||
<Modal id={id || modalId}> | ||
<Component {...rest} /> | ||
</Modal> | ||
) | ||
export default id => Component => inject(store => ({ | ||
openModal: () => store.ui.modal.set({ openedModal: id }), | ||
closeModal: () => store.ui.modal.set({ openedModal: undefined }), | ||
}))(Component) |
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
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
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 |
---|---|---|
@@ -1,3 +1,17 @@ | ||
import firebase from 'firebase/app' | ||
import crud from './crud' | ||
|
||
/** | ||
* Fetch user by email | ||
* @param {string} email user's email | ||
*/ | ||
export const fetchUsersByEmail = async (email) => { | ||
const result = await firebase | ||
.firestore() | ||
.collection('users') | ||
.where('email', '==', email) | ||
.get() | ||
return result.docs.map(ref => ({ uid: ref.id, ...ref.data() })) | ||
} | ||
|
||
export default crud('users', 'uid') |
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
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
.talk-abstract .talk-reference { | ||
margin-top: 2em; | ||
} | ||
|
||
.talk-abstract .talk-abstract-title { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: flex-start; | ||
} |
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
21 changes: 21 additions & 0 deletions
21
src/screens/components/talk/speakers/addSpeaker/addSpeakerButton.css
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,21 @@ | ||
a.add-speaker-button { | ||
display: flex; | ||
align-items: center; | ||
text-decoration: none; | ||
color: var(--grey-color-dark); | ||
} | ||
|
||
.add-speaker-button-icon { | ||
border-radius: 50%; | ||
height: 40px; | ||
width: 40px; | ||
background: var(--grey-color-light); | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.add-speaker-button-label { | ||
margin-left: .8em; | ||
text-decoration: underline; | ||
} |
26 changes: 26 additions & 0 deletions
26
src/screens/components/talk/speakers/addSpeaker/addSpeakerButton.jsx
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,26 @@ | ||
import React, { Fragment } from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
import { withModal } from 'components/modal' | ||
import AddSpeakerModal from './addSpeakerModal.container' | ||
import './addSpeakerButton.css' | ||
|
||
const ADD_SPEAKER_MODAL = 'add-speaker-modal' | ||
|
||
const AddSpeakerButton = ({ openModal }) => ( | ||
<Fragment> | ||
<a onClick={openModal} role="button" className="add-speaker-button"> | ||
<span className="add-speaker-button-icon"> | ||
<i className="fa fa-user fa-lg" /> | ||
</span> | ||
<span className="add-speaker-button-label">Add a co-speaker</span> | ||
</a> | ||
<AddSpeakerModal modalId={ADD_SPEAKER_MODAL} /> | ||
</Fragment> | ||
) | ||
|
||
AddSpeakerButton.propTypes = { | ||
openModal: PropTypes.func.isRequired, | ||
} | ||
|
||
export default withModal(ADD_SPEAKER_MODAL)(AddSpeakerButton) |
Oops, something went wrong.