-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename webpack cfgs * Fix middlewares deprecation warning * Fully remove warnings for npm start * Relax browserslist constraints * Enable routes and add bogus song details * Turn titles into hrefs * Rethink components file structure * Provide scaffolded fetch logic for release details
- Loading branch information
1 parent
2cc4875
commit 2ea5536
Showing
16 changed files
with
143 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import { useParams } from 'react-router-dom'; | ||
import { MDBCol, MDBContainer, MDBRow } from 'mdb-react-ui-kit'; | ||
|
||
export function SongDetails() { | ||
|
||
let { songId } = useParams(); | ||
|
||
return ( | ||
<MDBContainer className='mt-5' fluid> | ||
<MDBRow> | ||
<MDBCol md="2" /> | ||
<MDBCol md="8"> | ||
Here lieth song details for release {songId}. | ||
</MDBCol> | ||
<MDBCol md="2" /> | ||
</MDBRow> | ||
</MDBContainer> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { createSlice } from '@reduxjs/toolkit'; | ||
import axios from 'axios'; | ||
|
||
const initialState = { | ||
releaseDetails: {}, | ||
loading: false, | ||
error: null, | ||
}; | ||
|
||
const releaseSlice = createSlice({ | ||
name: 'release', | ||
initialState, | ||
reducers: { | ||
fetchBegin: (state, action) => { | ||
state.loading = true; | ||
state.error = null; | ||
}, | ||
fetchSuccess: (state, action) => { | ||
state.loading = false; | ||
state.releaseDetails = action.payload; | ||
}, | ||
fetchError: (state, action) => { | ||
state.loading = false; | ||
state.error = action.payload.error; | ||
}, | ||
}, | ||
}); | ||
|
||
const { actions, reducer } = releaseSlice; | ||
const { fetchBegin, fetchSuccess, fetchError } = actions; | ||
|
||
export function getReleaseDetails(dispatch, getState, {apiConfig}) { | ||
dispatch(fetchBegin()); | ||
|
||
// TODO: remove hardcoded release id | ||
axios.get(`${apiConfig.url}/releases/12829`) | ||
.then((res) => { | ||
dispatch(fetchSuccess(res.data)); | ||
}) | ||
.catch((error) => { | ||
dispatch(fetchError(error)); | ||
}); | ||
} | ||
|
||
export default reducer; |
Oops, something went wrong.