diff --git a/src/components/App.tsx b/src/components/App.tsx index 8ac1f03..260c7a1 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1,5 +1,5 @@ import React, { useState, useCallback, useEffect } from 'react'; -import { Grommet, Heading } from 'grommet'; +import { Grommet } from 'grommet'; import { debounce } from 'lodash'; import { gql, useLazyQuery } from '@apollo/client'; @@ -50,7 +50,11 @@ export default function App() { const handleSelect = (suggestion: string) => { let updatedArtists: Artists = []; - let suggestedArtists: Artists = data.queryArtists.slice(0, 5); + + let suggestedArtists: Artists = data.queryArtists + .slice(0, 5) + // Map to make a copy of the array, maybe uneeded + .map((artist: Artist) => artist); // Find the selected artist and move it to index 0 for (let i = 0; i < suggestedArtists!.length; i++) { @@ -96,11 +100,7 @@ export default function App() { return ( -
- - Spoti Search - -
+
) => { +export const Header = () => { return ( ) => { background='brand' pad={{ left: 'medium', right: 'small', vertical: 'small' }} style={{ zIndex: 1 }} - {...props} - /> + > + + Spoti Search + + ); }; diff --git a/src/components/Other.tsx b/src/components/Other.tsx index c09835a..af3a372 100644 --- a/src/components/Other.tsx +++ b/src/components/Other.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Box, Heading } from 'grommet'; +import { Box, Text } from 'grommet'; import placeholder from '../assets/placeholder-music.jpg'; @@ -20,20 +20,13 @@ export const Other = ({ return ( handleClick(name)} + width='130px' > - - {name} - + + {name} + ); }; diff --git a/src/components/Results.tsx b/src/components/Results.tsx index 9ed83cd..f7d8d0f 100644 --- a/src/components/Results.tsx +++ b/src/components/Results.tsx @@ -37,11 +37,11 @@ export const Results = ({ {selectedName} - - - - - Other results - - - {(size) => ( - + + + + + + Other results + + {otherArtists.map((artist) => ( ))} - )} - - + + + Discography @@ -98,7 +112,7 @@ export const Results = ({ {selectedAlbums.map((album) => (