Skip to content

Commit 2bf53de

Browse files
committed
Merge pull request #107 from durunvo/master
Upgrade react-router to v2
2 parents dfeaab4 + 6b04790 commit 2bf53de

21 files changed

+39
-36
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"react-dnd": "~2.0.2",
2929
"react-dnd-html5-backend": "~2.0.0",
3030
"react-dom": "^0.14.0",
31-
"react-router": "1.0.0-rc1"
31+
"react-router": "2.0.0"
3232
},
3333
"devDependencies": {
3434
"babel-core": "~5.8.12",

src/components/CategoryList/CategoryList.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default class CategoryList extends React.Component {
6161
(this.props.linkPrefix || '') + (c.link || id)
6262
);
6363
return (
64-
<Link title={c.name} to={link} className={className} key={id} >
64+
<Link title={c.name} to={{ pathname: link }} className={className} key={id} >
6565
<span>{count}</span>
6666
<span>{c.name}</span>
6767
</Link>

src/components/FileTree/FileTree.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default class FileTree extends React.Component {
7474
<Link
7575
key={'f_' + f}
7676
className={[styles.file, isCurrent ? styles.current : ''].join(' ')}
77-
to={this.props.linkPrefix + path}>
77+
to={{ pathname: this.props.linkPrefix + path }}>
7878
{f}
7979
</Link>
8080
);

src/components/Popover/Popover.react.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class ContextProxy extends React.Component {
2222
}
2323

2424
ContextProxy.childContextTypes = {
25-
history: React.PropTypes.object
25+
history: React.PropTypes.object,
26+
router: React.PropTypes.object
2627
};
2728

2829
export default class Popover extends React.Component {
@@ -93,5 +94,6 @@ export default class Popover extends React.Component {
9394
}
9495

9596
Popover.contextTypes = {
96-
history: React.PropTypes.object
97+
history: React.PropTypes.object,
98+
router: React.PropTypes.object
9799
};

src/components/Sidebar/AppsSelector.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default class AppsSelector extends React.Component {
5959
if (sections[0] === '') {
6060
sections.shift();
6161
}
62-
history.pushState(null, `/apps/${value}/${sections[2]}`);
62+
history.push(null, `/apps/${value}/${sections[2]}`);
6363
}
6464
});
6565
}

src/components/Sidebar/SidebarHeader.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import styles from 'components/Sidebar/Sidebar.scss';
1313

1414
let SidebarHeader = ({}) =>
1515
<div className={styles.header}>
16-
<Link className={styles.logo} to='/apps'>
16+
<Link className={styles.logo} to={{ pathname: '/apps' }}>
1717
<Icon width={28} height={28} name='infinity' fill={'#ffffff'} />
1818
</Link>
1919
<Link to='/apps'>

src/components/Sidebar/SidebarSection.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let SidebarSection = ({ active, children, name, link, icon, style }) => {
2323
<div className={classes.join(' ')}>
2424
{active ?
2525
<div style={style} className={styles.section_header}>{iconContent}{name}</div> :
26-
<Link style={style} className={styles.section_header} to={link || ''}>{iconContent}{name}</Link>}
26+
<Link style={style} className={styles.section_header} to={{ pathname: link || '' }}>{iconContent}{name}</Link>}
2727

2828
{children ? <div className={styles.section_contents}>{children}</div> : null}
2929
</div>

src/components/Sidebar/SidebarSubItem.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ let SidebarSubItem = ({ active, name, action, link, children }) => {
2828
<div>
2929
<Link
3030
className={styles.subitem}
31-
to={link}>
31+
to={{ pathname: link }}>
3232
{name}
3333
</Link>
3434
</div>

src/dashboard/AppData.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let AppData = React.createClass({
3838
if (current) {
3939
current.setParseKeys();
4040
} else {
41-
history.replaceState(null, '/apps');
41+
history.replace('/apps');
4242
return <div />;
4343
}
4444
return (

src/dashboard/AppSelector.react.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export default class AppSelector extends React.Component {
2626

2727
handleConfirm() {
2828
let newPath = location.pathname.replace(/\/_(\/|$)/, '/' + this.state.slug + '/');
29-
history.pushState(null, newPath);
29+
history.push(newPath);
3030
}
3131

3232
handleCancel() {
33-
history.pushState(null, '/apps');
33+
history.push('/apps');
3434
}
3535

3636
render() {

0 commit comments

Comments
 (0)