Skip to content

Commit

Permalink
Remove route transitions - program feels a lot snappier
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeop committed Jan 24, 2019
1 parent db7b382 commit 9ab1027
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 30 deletions.
37 changes: 13 additions & 24 deletions app/containers/MainContentContainer/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { Route, Switch, Link, withRouter } from 'react-router-dom';
import { RouteTransition } from 'react-router-transition';
import { Route, Switch, withRouter } from 'react-router-dom';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as Actions from '../../actions';
Expand All @@ -19,8 +18,6 @@ import TagViewContainer from '../TagViewContainer';

import Downloads from '../../components/Downloads';

import styles from './styles.scss';

class MainContentContainer extends React.Component {
componentDidMount() {
if (this.props.history
Expand All @@ -35,26 +32,18 @@ class MainContentContainer extends React.Component {
<Route render={({location, history, match}) => {
return (
<MainLayout>
<RouteTransition
pathname={location.pathname}
atEnter={{ opacity: 0 }}
atLeave={{ opacity: 0 }}
atActive={{ opacity: 1 }}
className={styles.transition}
>
<Switch key={location.key} location={location}>
<Route path='/album/:albumId' component={AlbumViewContainer} />
<Route path='/artist/:artistId' component={ArtistViewContainer} />
<Route path='/dashboard' component={DashboardContainer} />
<Route path='/downloads' component={Downloads} />
<Route path='/playlists' component={PlaylistsContainer} />
<Route path='/playlist/:playlistId' component={PlaylistViewContainer} />
<Route path='/plugins' component={PluginsContainer} />
<Route path='/settings' component={SettingsContainer} />
<Route path='/tag/:tagName' component={TagViewContainer}/>
<Route path='/search' component={SearchResultsContainer} />
</Switch>
</RouteTransition>
<Switch key={location.key} location={location}>
<Route path='/album/:albumId' component={AlbumViewContainer} />
<Route path='/artist/:artistId' component={ArtistViewContainer} />
<Route path='/dashboard' component={DashboardContainer} />
<Route path='/downloads' component={Downloads} />
<Route path='/playlists' component={PlaylistsContainer} />
<Route path='/playlist/:playlistId' component={PlaylistViewContainer} />
<Route path='/plugins' component={PluginsContainer} />
<Route path='/settings' component={SettingsContainer} />
<Route path='/tag/:tagName' component={TagViewContainer}/>
<Route path='/search' component={SearchResultsContainer} />
</Switch>
</MainLayout>
);
}
Expand Down
6 changes: 0 additions & 6 deletions app/containers/MainContentContainer/styles.scss

This file was deleted.

0 comments on commit 9ab1027

Please sign in to comment.