fix colors when album has no vibrantColor #1
This commit is contained in:
@@ -105,10 +105,17 @@ export default function App() {
|
|||||||
<div
|
<div
|
||||||
key={album.id}
|
key={album.id}
|
||||||
className="flex gap-2 p-2"
|
className="flex gap-2 p-2"
|
||||||
style={{
|
style={
|
||||||
|
album.vibrantColor
|
||||||
|
? {
|
||||||
backgroundColor: album.vibrantColor,
|
backgroundColor: album.vibrantColor,
|
||||||
color: contrastColor,
|
color: contrastColor,
|
||||||
}}
|
}
|
||||||
|
: {
|
||||||
|
backgroundColor: "white",
|
||||||
|
color: "black",
|
||||||
|
}
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={`/cover/${album.cover}`}
|
src={`/cover/${album.cover}`}
|
||||||
@@ -126,7 +133,11 @@ export default function App() {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="cursor-pointer ml-auto mt-auto py-1 px-2"
|
className="cursor-pointer ml-auto mt-auto py-1 px-2"
|
||||||
style={{ backgroundColor: oppositeColor, color: contrastColor }}
|
style={
|
||||||
|
album.vibrantColor
|
||||||
|
? { backgroundColor: oppositeColor, color: contrastColor }
|
||||||
|
: { backgroundColor: "black", color: "white" }
|
||||||
|
}
|
||||||
onClick={() => handleDownloadAlbum(album)}
|
onClick={() => handleDownloadAlbum(album)}
|
||||||
>
|
>
|
||||||
Download
|
Download
|
||||||
|
|||||||
Reference in New Issue
Block a user