Skip to content

Commit

Permalink
Merge pull request #188 from nukeop/feature/ui-enhancements
Browse files Browse the repository at this point in the history
Feature/ui enhancements
  • Loading branch information
nukeop authored Jan 24, 2019
2 parents 0ae9758 + 9ab1027 commit 4e9e481
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 64 deletions.
52 changes: 26 additions & 26 deletions app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,32 +81,6 @@ class App extends React.Component {
}
}

componentWillMount () {
this.props.actions.readSettings();
this.props.actions.lastFmReadSettings();
this.props.actions.createSearchPlugins(PluginConfig.plugins);
}

render () {
let { settings } = this.props;
let { toggleOption } = this.props.actions;
return (
<div className={styles.app_container}>
{this.renderNavBar()}
<div className={styles.panel_container}>
{this.renderSidebarMenu(settings, toggleOption)}
<VerticalPanel className={styles.center_panel}>
<MainContentContainer />
</VerticalPanel>
{this.renderRightPanel(settings)}
</div>
{this.renderFooter(settings)}
<SoundContainer />
<IpcContainer />
</div>
);
}

renderNavBar () {
return (
<Navbar className={styles.navbar}>
Expand Down Expand Up @@ -270,6 +244,32 @@ class App extends React.Component {
</Navbar>
);
}

componentWillMount () {
this.props.actions.readSettings();
this.props.actions.lastFmReadSettings();
this.props.actions.createSearchPlugins(PluginConfig.plugins);
}

render () {
let { settings } = this.props;
let { toggleOption } = this.props.actions;
return (
<div className={styles.app_container}>
{this.renderNavBar()}
<div className={styles.panel_container}>
{this.renderSidebarMenu(settings, toggleOption)}
<VerticalPanel className={styles.center_panel}>
<MainContentContainer />
</VerticalPanel>
{this.renderRightPanel(settings)}
</div>
{this.renderFooter(settings)}
<SoundContainer />
<IpcContainer />
</div>
);
}
}

function mapStateToProps (state) {
Expand Down
5 changes: 3 additions & 2 deletions app/components/PlayOptionsControls/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import classnames from 'classnames';
import FontAwesome from 'react-fontawesome';
import _ from 'lodash';

import styles from './styles.scss';
import settingsConst from '../../constants/settings';

function renderOptionControl(props, settingName, fontAwesomeName) {
return (
<div
className={classnames('icon', {
className={classnames(styles.icon, {
active: props.settings[settingName]
})}
onClick={() =>
Expand All @@ -25,7 +26,7 @@ function renderOptionControl(props, settingName, fontAwesomeName) {

const PlayOptionsControls = props => {
return (
<div className='play_options_controls'>
<div className={styles.play_options_controls}>
{renderOptionControl(props, 'loopAfterQueueEnd', 'repeat')}
{renderOptionControl(props, 'shuffleQueue', 'random')}
{renderOptionControl(props, 'autoradio', 'magic')}
Expand Down
2 changes: 1 addition & 1 deletion app/components/PlayOptionsControls/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

.play_options_controls {
display: flex;
flex-flow: column;
flex-flow: row;
justify-content: space-between;
align-items: center;
height: 100%;
Expand Down
6 changes: 2 additions & 4 deletions app/components/Seekbar/styles.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
@import "../../vars";

.seekbar_container {
height: 4px;
height: 1em;

cursor: pointer;

background-color: rgba(248, 248, 242, 0.25);
background-color: $background2;

flex: 0 0 auto;
}

.seekbar_fill {
height: 4px;

background-color: $pink;
}
44 changes: 20 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,35 +18,32 @@ import TagViewContainer from '../TagViewContainer';

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

import styles from './styles.scss';

class MainContentContainer extends React.Component {
componentDidMount() {
if (this.props.history
&& this.props.location
&& this.props.location.pathname === '/') {
this.props.history.push('/dashboard');
}
}

render() {
return (
<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.

1 change: 0 additions & 1 deletion app/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
flex: 0 0 auto;
flex-flow: column;

height: 80px;
width: 100%;
max-width: 100%;

Expand Down

3 comments on commit 4e9e481

@trekiteasy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me this commit broke something in the dashboard : when I click on an artist name, the app reloads + error : "TypeError: Cannot read property 'loading' of undefined" at ArtistView/index.js:21

@nukeop
Copy link
Owner Author

@nukeop nukeop commented on 4e9e481 Jan 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look, though I didn't touch that view. There's also a problem with the queue and its popups.

@nukeop
Copy link
Owner Author

@nukeop nukeop commented on 4e9e481 Jan 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bug occurs because of this function: https://github.com/nukeop/nuclear/blame/master/app/components/ArtistView/index.js#L21

For a moment artist is undefined. So trying to access its properties causes a crash. Working on it now.

BTW. the problem with queue popups is solved now.

Please sign in to comment.