Commit cb893d9094958e367034b661d1723f99d10eb677

Authored by Paul Savignano
1 parent a5b247a920
Exists in master

Refactor hrefs to remove page load behavior.

Showing 1 changed file with 7 additions and 11 deletions   Show diff stats
imports/ui/pages/Documents.js
1 import React from 'react'; 1 import React from 'react';
2 import { browserHistory } from 'react-router'; 2 import { Link } from 'react-router';
3 import { Row, Col, Button } from 'react-bootstrap'; 3 import { Row, Col, Button } from 'react-bootstrap';
4 import DocumentsList from '../containers/DocumentsList.js'; 4 import DocumentsList from '../containers/DocumentsList.js';
5 5
6 const buttonNav = (event) => {
7 event.preventDefault();
8 browserHistory.push('/documents/new');
9 }
10
11 const Documents = () => ( 6 const Documents = () => (
12 <div className="Documents"> 7 <div className="Documents">
13 <Row> 8 <Row>
14 <Col xs={ 12 }> 9 <Col xs={ 12 }>
15 <div className="page-header clearfix"> 10 <div className="page-header clearfix">
16 <h4 className="pull-left">Documents</h4> 11 <h4 className="pull-left">Documents</h4>
17 <Button 12 <Link to="/documents/new">
18 bsStyle="success" 13 <Button
19 className="pull-right" 14 bsStyle="success"
20 onClick={ buttonNav } 15 className="pull-right"
21 >New Document</Button> 16 >New Document</Button>
17 </Link>
22 </div> 18 </div>
23 <DocumentsList /> 19 <DocumentsList />
24 </Col> 20 </Col>
25 </Row> 21 </Row>
26 </div> 22 </div>
27 ); 23 );
28 24
29 export default Documents; 25 export default Documents;