-
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.
- Loading branch information
Showing
9 changed files
with
243 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { StyledGrid } from "../styles"; | ||
|
||
const ArtistsGrid = ({ artists }) => ( | ||
<> | ||
{artists && artists.length ? ( | ||
<StyledGrid type="artist"> | ||
{artists.map((artist, i) => ( | ||
<li className="grid__item" key={i}> | ||
<div className="grid__item__inner"> | ||
{artist.images[0] && ( | ||
<div className="grid__item__img"> | ||
<img src={artist.images[0].url} alt={artist.name} /> | ||
</div> | ||
)} | ||
<h3 className="grid__item__name overflow-ellipsis"> | ||
{artist.name} | ||
</h3> | ||
<p className="grid__item__label">Artist</p> | ||
</div> | ||
</li> | ||
))} | ||
</StyledGrid> | ||
) : ( | ||
<p className="empty-notice">No artists available</p> | ||
)} | ||
</> | ||
); | ||
|
||
export default ArtistsGrid; |
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,36 @@ | ||
import { Link } from "react-router-dom"; | ||
import { StyledSection } from "../styles"; | ||
|
||
const SectionWrapper = ({ children, title, seeAllLink, breadcrumb }) => ( | ||
<StyledSection> | ||
<div className="section__inner"> | ||
<div className="section__top"> | ||
<h2 className="section__heading"> | ||
{breadcrumb && ( | ||
<span className="section__breadcrumb"> | ||
<Link to="/">Profile</Link> | ||
</span> | ||
)} | ||
{title && ( | ||
<> | ||
{seeAllLink ? ( | ||
<Link to={seeAllLink}>{title}</Link> | ||
) : ( | ||
<span>{title}</span> | ||
)} | ||
</> | ||
)} | ||
</h2> | ||
{seeAllLink && ( | ||
<Link to={seeAllLink} className="section__see-all"> | ||
See All | ||
</Link> | ||
)} | ||
</div> | ||
|
||
{children} | ||
</div> | ||
</StyledSection> | ||
); | ||
|
||
export default SectionWrapper; |
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,2 @@ | ||
export { default as ArtistsGrid } from "./ArtistsGrid"; | ||
export { default as SectionWrapper } from "./SectionWrapper"; |
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,79 @@ | ||
import styled from "styled-components/macro"; | ||
|
||
const StyledGrid = styled.ul` | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); | ||
grid-gap: var(--spacing-sm); | ||
@media (min-width: 768px) { | ||
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); | ||
grid-gap: var(--spacing-lg); | ||
} | ||
.grid__item { | ||
background-color: var(--near-black); | ||
border-radius: var(--border-radius-subtle); | ||
transition: background-color 0.3s ease; | ||
cursor: default; | ||
&:hover, | ||
&:focus { | ||
background-color: var(--dark-grey); | ||
img { | ||
box-shadow: 0 8px 24px rgb(0 0 0 / 50%); | ||
} | ||
} | ||
a { | ||
display: block; | ||
width: 100%; | ||
height: 100%; | ||
&:hover, | ||
&:focus { | ||
text-decoration: none; | ||
} | ||
} | ||
} | ||
.grid__item__inner { | ||
padding: var(--spacing-sm); | ||
@media (min-width: 768px) { | ||
padding: var(--spacing-md); | ||
} | ||
} | ||
.grid__item__img { | ||
position: relative; | ||
padding-top: 100%; | ||
margin: 0 auto var(--spacing-lg); | ||
img { | ||
position: absolute; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
background-color: var(--dark-grey); | ||
border-radius: ${(props) => (props.type === "artist" ? "50%" : "2px")}; | ||
} | ||
} | ||
.grid__item__name { | ||
margin: 0 0 var(--spacing-xxs); | ||
font-size: var(--fz-md); | ||
letter-spacing: normal; | ||
} | ||
.grid__item__label { | ||
font-size: var(--fz-sm); | ||
color: var(--light-grey); | ||
} | ||
`; | ||
|
||
export default StyledGrid; |
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,65 @@ | ||
import styled from "styled-components/macro"; | ||
|
||
const StyledSection = styled.section` | ||
&:first-of-type { | ||
.section__inner { | ||
padding-top: 0; | ||
} | ||
} | ||
.section__inner { | ||
width: 100%; | ||
max-width: var(--site-max-width); | ||
margin: 0 auto; | ||
position: relative; | ||
padding: var(--spacing-lg) var(--spacing-md); | ||
@media (min-width: 768px) { | ||
padding: var(--spacing-xl) var(--spacing-xxl); | ||
} | ||
} | ||
.section__top { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: stretch; | ||
margin-bottom: var(--spacing-xl); | ||
} | ||
.section__heading { | ||
display: flex; | ||
margin: 0; | ||
font-size: var(--fz-xxl); | ||
} | ||
.section__breadcrumb { | ||
display: flex; | ||
color: var(--light-grey); | ||
&::after { | ||
content: "/"; | ||
display: block; | ||
margin: 0 var(--spacing-sm); | ||
} | ||
a { | ||
&:hover, | ||
&:focus { | ||
color: var(--white); | ||
} | ||
} | ||
} | ||
.section__see-all { | ||
display: flex; | ||
align-items: flex-end; | ||
text-transform: uppercase; | ||
color: var(--light-grey); | ||
font-size: var(--fz-xxs); | ||
font-weight: 700; | ||
letter-spacing: 0.1em; | ||
padding-bottom: 2px; | ||
} | ||
`; | ||
|
||
export default StyledSection; |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export { default as GlobalStyle } from "./GlobalStyle"; | ||
export { default as StyledGrid } from "./StyledGrid"; | ||
export { default as StyledHeader } from "./StyledHeader"; | ||
export { default as StyledSection } from "./StyledSection"; |
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