Skip to content

Commit 35f19c5

Browse files
committed
Update styles of the artist profile
1 parent 1d73e6a commit 35f19c5

File tree

4 files changed

+42
-37
lines changed

4 files changed

+42
-37
lines changed

public/assets/artist-cover.jpg

75 KB
Loading

src/components/ArtistProfile.js

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,32 @@ import styled from "styled-components";
44

55
import ArtworkList from "./ArtworkList";
66

7+
const ArtistCover = styled.div`
8+
background-image: url("/assets/artist-cover.jpg");
9+
height: 300px;
10+
width: 100%;
11+
`;
12+
713
const ArtistContainer = styled.div`
8-
max-width: 920px;
9-
margin: 0 auto;
10-
h3 {
11-
font-size: 1.5rem;
12-
}
13-
h4 {
14-
color: #828282;
15-
}
14+
max-width: 720px;
15+
margin: -150px;
16+
display: flex;
17+
flex-direction: column;
18+
align-items: center;
1619
`;
1720

18-
const ArtistImage = styled.img`
21+
const ArtistPhoto = styled.img`
1922
width: 300px;
2023
height: 300px;
2124
border-radius: 300px;
2225
object-fit: cover;
2326
`;
2427

28+
const ArtistName = styled.h3`
29+
font-size: 72px;
30+
margin: 0;
31+
`;
32+
2533
const ExhibitionsList = styled.ul`
2634
list-style: none;
2735
padding: 0;
@@ -32,30 +40,29 @@ const ExhibitionsList = styled.ul`
3240

3341
const ArtistProfile = ({ artist }) => {
3442
return (
35-
<ArtistContainer>
36-
<ArtistImage src={artist.photoUrl} alt={artist.name} />
37-
38-
<h3>{artist.name}</h3>
39-
40-
<div>
41-
<h4>About</h4>
42-
<p>{artist.biography.about}</p>
43-
</div>
44-
45-
<div>
46-
<h4>Exhibitions</h4>
47-
<ExhibitionsList>
48-
{artist.biography.exhibitions.map((exhibition, index) => {
49-
return <li key={index}>{exhibition}</li>;
50-
})}
51-
</ExhibitionsList>
52-
</div>
53-
54-
<div>
55-
<h4>Artworks</h4>
56-
<ArtworkList artworks={artist.artworks}></ArtworkList>
57-
</div>
58-
</ArtistContainer>
43+
<>
44+
<ArtistCover></ArtistCover>
45+
<ArtistContainer>
46+
<ArtistPhoto src={artist.photoUrl} alt={artist.name} />
47+
<ArtistName>{artist.name}</ArtistName>
48+
<div>
49+
<h4>About</h4>
50+
<p>{artist.biography.about}</p>
51+
</div>
52+
<div>
53+
<h4>Exhibitions</h4>
54+
<ExhibitionsList>
55+
{artist.biography.exhibitions.map((exhibition, index) => {
56+
return <li key={index}>{exhibition}</li>;
57+
})}
58+
</ExhibitionsList>
59+
</div>
60+
<div>
61+
<h4>Artworks</h4>
62+
<ArtworkList artworks={artist.artworks}></ArtworkList>
63+
</div>
64+
</ArtistContainer>
65+
</>
5966
);
6067
};
6168

src/components/Content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const ContentStyled = styled.div`
66
display: flex;
77
flex-direction: column;
88
align-items: center;
9-
padding: 20px 0;
9+
padding-bottom: 20px;
1010
`;
1111

1212
const Content = ({ children }) => {

src/pages/Artist.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,13 @@ const Artist = ({
3535
return (
3636
<Page>
3737
<Content>
38+
{!isLoading && artist && <ArtistProfile artist={artist} />}
3839
{!isLoading && error && (
3940
<ErrorHeading>Sorry, artist not found.</ErrorHeading>
4041
)}
41-
4242
{isAuthenticated && !isLoading && artist && (
4343
<Button onClick={removeArtistAndRedirect}>Remove Artist</Button>
4444
)}
45-
46-
{!isLoading && artist && <ArtistProfile artist={artist} />}
4745
</Content>
4846
</Page>
4947
);

0 commit comments

Comments
 (0)