diff --git a/src/index.jsx b/src/index.jsx index 2b96580..cab17f3 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -4,6 +4,7 @@ import ReactDOM from 'react-dom'; import './styles/reset.css'; import './styles/main.scss'; +import './styles/grid.scss'; import {Nav} from "./components/Nav"; import {SearchBar} from "./components/SearchBar"; diff --git a/src/styles/grid.scss b/src/styles/grid.scss new file mode 100644 index 0000000..8ae0b81 --- /dev/null +++ b/src/styles/grid.scss @@ -0,0 +1,32 @@ +.grid { + width: 100%; + padding-left: 1em; + padding-right: 1em; + + .row { + display: flex; + & > * { + padding-left: 1em; + padding-right: 1em; + } + + .col, col-1 { + flex: 1 0 0%; + } + .col-2 { + flex: 2 0 0%; + } + .col-3 { + flex: 3 0 0%; + } + .col-4 { + flex: 4 0 0%; + } + .col-5 { + flex: 5 0 0%; + } + .col-6 { + flex: 6 0 0%; + } + } +} diff --git a/src/views/Recomended.jsx b/src/views/Recomended.jsx index ae90494..f4c46e0 100644 --- a/src/views/Recomended.jsx +++ b/src/views/Recomended.jsx @@ -8,15 +8,15 @@ import {CoverArt} from '../components/CoverArt'; const PopularArtists = () => { const artistIDs = ['fa3b825f-7c85-4377-b393-d28a2016e293', 'b2d122f9-eadb-4930-a196-8f221eeb0c66', - '27e2997f-f7a1-4353-bcc4-57b9274fa9a4', '2de794c8-8826-48d0-90e0-6900183ba9e0'] + '27e2997f-f7a1-4353-bcc4-57b9274fa9a4', '2de794c8-8826-48d0-90e0-6900183ba9e0'] let [artists, setArtists] = useState(null); if(!artists) { Promise.all([getArtist(artistIDs[0]), - getArtist(artistIDs[1]), - getArtist(artistIDs[2]), - getArtist(artistIDs[3])]) - .then(artists => setArtists(artists)); + getArtist(artistIDs[1]), + getArtist(artistIDs[2]), + getArtist(artistIDs[3])]) + .then(artists => setArtists(artists)); return }else { const items = artists.map((artist) => ({ @@ -25,52 +25,52 @@ const PopularArtists = () => { 'title': artist.name, 'subtitle': [artist.type, artist.country].filter(Boolean).join(' - '), 'widget': {Math.floor(Math.random() * 1000)} - })); - const list = [{ - 'items': items - }]; - return - } + })); + const list = [{ + 'items': items + }]; + return +} } const PopularDiscs = () => { const discsIDs = ['f5cc15ea-67a8-3c6b-9887-d45ae13a3156', 'db6a41da-710b-36eb-a288-48b4b1c5b130', - 'd9f1ba4b-dfaf-4961-8f97-63c149b361a0', '495ab548-ef52-4dcf-a226-bc70b1ad7c86'] + 'd9f1ba4b-dfaf-4961-8f97-63c149b361a0', '495ab548-ef52-4dcf-a226-bc70b1ad7c86'] let [discs, setDiscs] = useState(null); if(!discs) { Promise.all([getDisc(discsIDs[0]), - getDisc(discsIDs[1]), - getDisc(discsIDs[2]), - getDisc(discsIDs[3])]) - .then(discs => setDiscs(discs)); + getDisc(discsIDs[1]), + getDisc(discsIDs[2]), + getDisc(discsIDs[3])]) + .then(discs => setDiscs(discs)); return }else { const items = discs.map((disc) => ({ 'cover': , - 'link': `/disc/${disc.id}`, - 'title': disc.title, - 'subtitle': disc.artist.name, - 'widget': {Math.floor(Math.random() * 1000)} - })); - const list = [{ - 'items': items - }]; - return - } + 'link': `/disc/${disc.id}`, + 'title': disc.title, + 'subtitle': disc.artist.name, + 'widget': {Math.floor(Math.random() * 1000)} +})); +const list = [{ + 'items': items +}]; +return +} } const PopularSongs = () => { const songsIDs = ['1e49a0d0-372e-459d-9c53-5d864186bb02', '5892ed7d-fed4-4f00-b72e-af1315fcb62d', - '4d6473d8-a21b-47c0-9d2e-00d210d68f3a', '92b00514-f535-4b32-99ea-d74b9ccb416b'] + '4d6473d8-a21b-47c0-9d2e-00d210d68f3a', '92b00514-f535-4b32-99ea-d74b9ccb416b'] let [songs, setSongs] = useState(null); if(!songs) { Promise.all([getSong(songsIDs[0]), - getSong(songsIDs[1]), - getSong(songsIDs[2]), - getSong(songsIDs[3])]) - .then(songs => setSongs(songs)); + getSong(songsIDs[1]), + getSong(songsIDs[2]), + getSong(songsIDs[3])]) + .then(songs => setSongs(songs)); return }else { const items = songs.map((song) => ({ @@ -79,25 +79,35 @@ const PopularSongs = () => { 'title': song.title, 'subtitle': song.artist.name, 'widget': {Math.floor(Math.random() * 1000)} - })); - const list = [{ - 'items': items - }]; - return - } + })); + const list = [{ + 'items': items + }]; + return +} } export const Recomended = () => { // TODO crear una forma de obtener cosas populares // Esto es un por mientras hago todo el resto y la pagina de inicio no se vea tan vacia return ( -
-

Artistas Populares

- -

Discos Populares

- -

Canciones Populares

- +
+
+
+

Artistas Populares

+ +
+
+

Canciones Populares

+ +
+
+
+
+

Discos Populares

+ +
+
) }