-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSingle.js
35 lines (32 loc) · 1.04 KB
/
Single.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from 'react'
import { connect } from 'react-redux'
import { compose, branch, renderNothing, lifecycle } from 'recompose'
import * as binActions from './actions'
/** @param {import('./typings').Single.PropTypes} props */
const Comp = (props) => (
<section className="hl single">
<p style={{ cursor: 'default'}}>{props.bin.content}</p>
<i style={{ alignSelf: 'flex-end', marginRight: '15px' }}>Share this bin by url: <b style={{ textDecoration: 'underline' }}>{process.env.REACT_APP_CLIENT_URL}/{props.bin._id}</b></i>
</section>
)
export default compose(
connect(
/**
* @param {import('./typings').Reducers.Root} state
* @returns {import('./typings').Single.PropTypes}
*/
state => ({
bin: state.bins.single,
})
),
// lifecycle({
// componentDidMount() {
//
// }
// }),
branch(
/** @param {import('./typings').Single.PropTypes} props */
props => !props.bin,
renderNothing,
),
)(Comp)