53 lines
1.6 KiB
JavaScript
Raw Normal View History

import React, { PropTypes } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { ScrollSync, ScrollSyncPane } from '../ScrollSync';
import ControlPane from '../ControlPanel/ControlPane';
import PreviewPane from '../PreviewPane/PreviewPane';
2016-09-11 23:08:18 +02:00
import styles from './EntryEditor.css';
2016-05-30 16:55:32 -07:00
export default function EntryEditor(
{
collection, entry, getMedia, onChange, onAddMedia, onRemoveMedia, onPersist
}) {
return (
<div className={styles.root}>
<ScrollSync>
<div className={styles.container}>
<ScrollSyncPane>
<div className={styles.controlPane}>
<ControlPane
collection={collection}
entry={entry}
getMedia={getMedia}
onChange={onChange}
onAddMedia={onAddMedia}
onRemoveMedia={onRemoveMedia}
/>
</div>
</ScrollSyncPane>
<div className={styles.previewPane}>
<PreviewPane
collection={collection}
entry={entry}
getMedia={getMedia}
/>
</div>
</div>
</ScrollSync>
<div className={styles.footer}>
<button onClick={onPersist}>Save</button>
2016-05-30 16:55:32 -07:00
</div>
</div>
);
2016-05-30 16:55:32 -07:00
}
EntryEditor.propTypes = {
collection: ImmutablePropTypes.map.isRequired,
entry: ImmutablePropTypes.map.isRequired,
getMedia: PropTypes.func.isRequired,
onAddMedia: PropTypes.func.isRequired,
onChange: PropTypes.func.isRequired,
onPersist: PropTypes.func.isRequired,
onRemoveMedia: PropTypes.func.isRequired,
};