[DE] added document settings controller

This commit is contained in:
Maxim Kadushkin 2020-09-24 11:59:46 +03:00
parent a77aa2fc91
commit 1dab10f1e7
3 changed files with 29 additions and 4 deletions

View file

@ -0,0 +1,24 @@
import React, {Component} from 'react';
import DocumentSettings from '../document-settings/DocumentSettings'
class DocumentSettingsController extends Component {
constructor(props) {
super(props);
console.log('controller created');
}
onPageOrientation(value){
console.log(`changed page orientation: ${value}`);
}
render() {
return (
<DocumentSettings onPageOrientation={this.onPageOrientation} />
)
}
}
export default DocumentSettingsController;

View file

@ -28,8 +28,8 @@ export default class DocumentSettings extends Component {
<Navbar title={textDocumentSettings} backLink={textBack} />
<BlockTitle>{textOrientation}</BlockTitle>
<List>
<ListItem checkbox title={textPortrait} name="orientation-checkbox" defaultChecked></ListItem>
<ListItem checkbox title={textLandscape} name="orientation-checkbox"></ListItem>
<ListItem radio title={textPortrait} name="orientation-checkbox" defaultChecked onChange={e => this.props.onPageOrientation('portrait')}></ListItem>
<ListItem radio title={textLandscape} name="orientation-checkbox" onChange={e => this.props.onPageOrientation('landscape')}></ListItem>
</List>
<BlockTitle>{textFormat}</BlockTitle>
<List mediaList>

View file

@ -1,8 +1,9 @@
import HomePage from '../pages/home.jsx';
import DocumentSettings from "../components/settings/document-settings/DocumentSettings.jsx";
// import DocumentSettings from "../components/settings/document-settings/DocumentSettings.jsx";
import Margins from "../components/settings/document-settings/Margins.jsx";
import DocumentFormats from "../components/settings/document-settings/DocumentFormats.jsx";
import DocumentSettingsController from "../components/settings/controller/DocumentSettings.jsx";
import LeftPage1 from '../pages/left-page-1.jsx';
import LeftPage2 from '../pages/left-page-2.jsx';
@ -18,7 +19,7 @@ var routes = [
},
{
path: '/document-settings/',
component: DocumentSettings,
component: DocumentSettingsController,
},
{
path: '/users/',