Skip to content

Instantly share code, notes, and snippets.

@EricCat
Created June 8, 2017 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EricCat/4051579a3d2c78c551f4c593a75ea028 to your computer and use it in GitHub Desktop.
Save EricCat/4051579a3d2c78c551f4c593a75ea028 to your computer and use it in GitHub Desktop.
For line 25, how should I retrieve design data?
import React, { PropTypes } from 'react';
import { CALL_API, Schemas } from '../../middleware/dascommService';
import * as ActionTypes from '../../constants/Editor';
const CSS = require('./Navbar.scss');
export default class NavbarActions extends React.Component {
get className() {
return [ CSS.navbarActions, 'actions', this.props.className ].join(' ').trim();
}
static get propTypes() {
return {
className: PropTypes.string
};
}
static get defaultProps() {
return {
className: ''
};
}
static get handleSaveClick() {
//TODO: retrieve some design data
//TODO: map/reducer design data to schema
//Exec API call
return {
[CALL_API]: {
types: [ActionTypes.SAVE_DESIGN],
schema: Schemas.DESIGN,
method: 'POST'
}
};
}
render() {
return (
<div className={this.className}>
<div className='section right'>
<div className='action'>
<span className='glyphicon glyphicon-arrow-left' />
Undo</div>
<div className='action'>
<span className='glyphicon glyphicon-arrow-right' />
Redo
</div>
</div>
<div className='section left'>
<div className='action'>
<span className='glyphicon glyphicon-share' />
Share
</div>
<div className='action'>
<span className='glyphicon glyphicon-floppy-save' onClick={this.handleSaveClick} />
Save
</div>
</div>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment