Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updatepackages #217

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions example/AddResourceForm.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React from 'react'
import { Modal, Form, Input, Radio } from 'antd';
import { Modal, Form, Input } from 'antd';
const FormItem = Form.Item;


const AddResourceForm = Form.create()(
(props) => {
const AddResourceForm = (props) => {
const { visible, onCancel, onCreate, form } = props;
const { getFieldDecorator } = form;
return (
<Modal
visible={visible}
Expand All @@ -15,18 +13,13 @@ const AddResourceForm = Form.create()(
onCancel={onCancel}
onOk={onCreate}
>
<Form layout="vertical" >
<FormItem label="Name">
{getFieldDecorator('name', {
rules: [{ required: true, message: 'Please input the name of the resource!' }],
})(
<Input />
)}
<Form layout="vertical" form={form}>
<FormItem label="Name" name="username" message="Please input the name of the resource!" rules={[{ required: true }]}>
<Input />
</FormItem>
</Form>
</Modal>
);
}
);
}

export default AddResourceForm
export default AddResourceForm
11 changes: 10 additions & 1 deletion example/CustomHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import Scheduler, {SchedulerData, ViewTypes, DemoData} from '../src/index'
import Nav from './Nav'
import ViewSrcCode from './ViewSrcCode'
import withDragDropContext from './withDnDContext'
import Col from 'antd/lib/col'
import Row from 'antd/lib/row'

class CustomHeader extends Component{
constructor(props){
Expand All @@ -26,8 +28,13 @@ class CustomHeader extends Component{
);
let rightCustomHeader = (
<div><span style={{fontWeight: 'bold', color: 'red'}}>or here</span></div>
);
let TopLeftCustomHeader = (
<div><span style={{fontWeight: 'bold', color: 'red'}}>Attendance Schedules</span></div>
);
let TopRightCustomHeader = (
<div><span style={{fontWeight: 'bold', color: 'red'}}>Schedule setting</span></div>
);

return (
<div>
<Nav />
Expand All @@ -49,6 +56,8 @@ class CustomHeader extends Component{
newEvent={this.newEvent}
leftCustomHeader={leftCustomHeader}
rightCustomHeader={rightCustomHeader}
TopLeftCustomHeader={TopLeftCustomHeader}
TopRightCustomHeader={TopRightCustomHeader}
toggleExpandFunc={this.toggleExpandFunc}
/>
</div>
Expand Down
13 changes: 10 additions & 3 deletions example/withDnDContext.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import {DragDropContext} from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import * as React from 'react'
import { DndProvider } from 'react-dnd'
import { HTML5Backend } from 'react-dnd-html5-backend';

export default DragDropContext(HTML5Backend);
export default Component => {
return props => (
<DndProvider backend={HTML5Backend}>
<Component {...props} />
</DndProvider>
)
}
Loading