Skip to content
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
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["es2015", "react"],
"plugins": ["transform-object-rest-spread"]
}
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
node_modules
coverage
.env
npm-debug.log
build
env.js
server/env.js
File renamed without changes.
6 changes: 4 additions & 2 deletions src/components/login.js → app/components/login.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React, { Component } from 'react';
import { Grid, Row, Col, PageHeader, Alert } from 'react-bootstrap';

const server = 'https://cryptify.herokuapp.com';
const redirect = encodeURIComponent(server + '/auth/callback');
const OAuthLink = 'https://accounts.spotify.com/authorize?client_id=49859018c9a4462cbb4336259546f1e9&redirect_uri=' + redirect + '&response_type=code&scope=user-top-read%20user-read-private';

class Login extends Component {
render() {
const redirect = encodeURIComponent('http://localhost:3001/auth/callback');
const OAuthLink = 'https://accounts.spotify.com/authorize?client_id=49859018c9a4462cbb4336259546f1e9&redirect_uri=' + redirect + '&response_type=code&scope=user-top-read%20user-read-private';
return (
<Grid>
<Row>
Expand Down
File renamed without changes.
9 changes: 7 additions & 2 deletions src/components/preview.js → app/components/preview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import React, { Component } from 'react';
import Sound from 'react-sound';

let Sound;

if (global.window) {
Sound = require('react-sound');
}

class Preview extends Component {
render() {
Expand All @@ -8,7 +13,7 @@ class Preview extends Component {
setTrackPlaying
} = this.props;

if (!trackPlaying) return null;
if (!trackPlaying || !global.window) return null;

let playStatus = 'STOPPED';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import Track from './track';

class TracksTable extends Component {
componentDidMount() {
this.props.fetchUserTopTracks();
if (this.props.tracks.length === 0) {
this.props.fetchUserTopTracks();
}
}

render() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions app/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import App from './components/app';
import Login from './components/login';


export default (
<Route path="/">
<IndexRoute component={Login} />
<Route path="home" component={App} />
</Route>
);
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,20 @@ export function fetchPassword(trackId, why) {
}
}

function requestFromApi(type) {
export function requestFromApi(type) {
return {
type
}
}

function receiveFromApi(type, data) {
export function receiveFromApi(type, data) {
return {
type,
data
}
}

function handleError(type, error) {
export function handleError(type, error) {
return {
type,
error
Expand Down
File renamed without changes.
9 changes: 6 additions & 3 deletions src/store/index.js → app/store/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import createLogger from 'redux-logger';

const logger = createLogger();

const store = createStore(
function configureStore(initialState = undefined) {
return createStore(
rootReducer,
initialState,
applyMiddleware(
thunk,
logger
)
);
);
}

export default store;
export default configureStore;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import { render } from 'react-dom';
import { Router, browserHistory } from 'react-router';
import { Provider } from 'react-redux';
import routes from './app/routes';
import configureStore from './app/store/configure';

let initialState = document.getElementById('initial-state').textContent;

if (initialState.length > 0) {
initialState = JSON.parse(initialState);
}

const store = configureStore(initialState);

render((
<Provider store={store}>
<Router history={browserHistory} routes={routes} />
</Provider>
), document.getElementById('root'));
11 changes: 0 additions & 11 deletions build/asset-manifest.json

This file was deleted.

1 change: 0 additions & 1 deletion build/index.html

This file was deleted.

12 changes: 0 additions & 12 deletions build/static/css/main.e9f3838c.css

This file was deleted.

1 change: 0 additions & 1 deletion build/static/css/main.e9f3838c.css.map

This file was deleted.

18 changes: 0 additions & 18 deletions build/static/js/main.54a89d41.js

This file was deleted.

1 change: 0 additions & 1 deletion build/static/js/main.54a89d41.js.map

This file was deleted.

28 changes: 0 additions & 28 deletions config/env.js

This file was deleted.

12 changes: 0 additions & 12 deletions config/jest/cssTransform.js

This file was deleted.

10 changes: 0 additions & 10 deletions config/jest/fileTransform.js

This file was deleted.

45 changes: 0 additions & 45 deletions config/paths.js

This file was deleted.

14 changes: 0 additions & 14 deletions config/polyfills.js

This file was deleted.

Loading