/** * * @flow */ import React from 'react'; import { connect } from 'react-redux'; import { THREE_CANVAS_HEIGHT } from '../core/constants'; import { selectCanvas } from '../actions'; const textStyle = { color: 'hsla(218, 5%, 47%, .6)', fontSize: 14, fontWeight: 500, position: 'relative', textAlign: 'inherit', float: 'none', margin: 2, padding: 0, overflow: 'auto', }; const infoStyle = { color: '#4f545c', fontSize: 15, fontWeight: 500, position: 'relative', textAlign: 'inherit', float: 'none', margin: 0, padding: 0, }; const titleStyle = { color: '#4f545c', marginLeft: 0, marginRight: 10, overflow: 'hidden', wordWrap: 'break-word', lineHeight: '24px', fontSize: 16, marginTop: 5, marginBottom: 0, fontWeight: 'bold', }; const buttonStyle = { marginTop: 10, marginBottom: 10, border: '#c5c5c5', borderStyle: 'solid', cursor: 'pointer', }; const CanvasItem = ({ canvasId, canvas, changeCanvas }) => (
{ changeCanvas(canvasId); }} role="button" tabIndex={0} >

preview {canvas.title}
{canvas.desc}
Cooldown: {(canvas.bcd !== canvas.pcd) ? {canvas.bcd / 1000}s / {canvas.pcd / 1000}s : {canvas.bcd / 1000}s}
Stacking till {canvas.cds / 1000}s
{(canvas.req !== -1) ? Requirements:
: null} {(canvas.req !== -1) ? User Account : null} {(canvas.req > 0) ? and {canvas.req} Pixels set : null}
Dimensions: {canvas.size} x {canvas.size} {(canvas.v) ? x {THREE_CANVAS_HEIGHT} Voxels : Pixels}

); function mapDispatchToProps(dispatch) { return { changeCanvas(canvasId) { dispatch(selectCanvas(canvasId)); }, }; } export default connect(null, mapDispatchToProps)(CanvasItem);