diff --git a/public/index.html b/public/index.html index f528475..bd451c7 100644 --- a/public/index.html +++ b/public/index.html @@ -10,20 +10,7 @@ content="A frontend to search for an artist and display its albums" /> - -
- + diff --git a/src/components/Album.tsx b/src/components/Album.tsx new file mode 100644 index 0000000..bab3ed6 --- /dev/null +++ b/src/components/Album.tsx @@ -0,0 +1,18 @@ +import React from 'react'; +import { Box, Heading, Image } from 'grommet'; + +export const Album = ({ image, name }: { image: string; name: string }) => { + return ( + + + + + + {name} + + + ); +}; diff --git a/src/components/Card.tsx b/src/components/Card.tsx deleted file mode 100644 index 01cf181..0000000 --- a/src/components/Card.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { Box, Heading, Image } from 'grommet'; - -export const Card = ({ image, name }: { image: string; name: string }) => { - return ( - - - - - - - - - - {name} - - - - - - ); -}; diff --git a/src/components/Other.tsx b/src/components/Other.tsx new file mode 100644 index 0000000..9773fc8 --- /dev/null +++ b/src/components/Other.tsx @@ -0,0 +1,25 @@ +import React from 'react'; +import { Box, Heading, Image } from 'grommet'; + +export const Other = ({ image, name }: { image: string; name: string }) => { + return ( + + + {name} + + + + ); +}; diff --git a/src/components/Results.tsx b/src/components/Results.tsx index 90fdad1..ef7ad83 100644 --- a/src/components/Results.tsx +++ b/src/components/Results.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { Box, Grid, Avatar, Image, ResponsiveContext, Heading } from 'grommet'; +import { Box, Grid, ResponsiveContext, Heading } from 'grommet'; -import { Card as Album } from './Card'; +import { Album } from './Album'; import { Artists } from '../interfaces'; -import { size } from 'lodash'; +import { Other } from './Other'; export const Results = ({ artists }: { artists: Artists }) => { const { @@ -14,38 +14,72 @@ export const Results = ({ artists }: { artists: Artists }) => { return ( - -

{selectedName}

- -
- -

Other results

- {artists.map((artist) => ( - - -

{artist.name}

+ + {selectedName} + + + + + + Other results + + + {(size) => ( + + {artists.slice(1, artists.length).map((artist) => ( + + ))} - ))} -
+ )} + + + Discography + {(size) => ( - - Discography - {selectedAlbums.map((album) => (