Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Use libs discprov makeRequest when available (#44)
Browse files Browse the repository at this point in the history
* Clean up dynamic image flashing

* Use libs discprov makeRequest after eager selection

* Fix simplebars
  • Loading branch information
raymondjacobson committed Oct 14, 2020
1 parent 10a2011 commit 8e32340
Show file tree
Hide file tree
Showing 9 changed files with 146 additions and 102 deletions.
4 changes: 4 additions & 0 deletions packages/web/src/components/artist/UserListModal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
opacity: 0.5;
}

.scrollable :global(.simplebar-scrollbar:before) {
width: 6px;
}

.user {
width: 292px;
padding: 11px 0px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
opacity: 0.5;
}

.scrollable :global(.simplebar-scrollbar:before) {
width: 6px;
}

.user {
padding: 14px 0px;
display: flex;
Expand Down
30 changes: 16 additions & 14 deletions packages/web/src/components/dynamic-image/DynamicImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,28 @@ const fadeIn = (
) => {
if (ref.current) {
ref.current.style.zIndex = '2'

if (image === placeholder) {
ref.current.style.backgroundColor = 'unset'
// Apply an empty url here so we can use the background image prop to set a gradient
ref.current.style.backgroundImage = `${image}, url('')`
ref.current.style.transition = 'unset'
ref.current.style.opacity = '1'
return
}

// Set default background color for static images (transparent background defaults)
if (image.includes('/static')) {
ref.current.style.backgroundColor = 'var(--neutral-light-5)'
} else {
// Set default background color for static images (transparent background defaults)
if (image.includes('/static')) {
ref.current.style.backgroundColor = 'var(--neutral-light-5)'
} else {
ref.current.style.backgroundColor = 'unset'
}
// Allow gradient values for 'image' in addition to URIs
ref.current.style.backgroundImage = image.includes('linear-gradient(')
? `${image}, url('')`
: isUrl
? `url(${image})`
: image
ref.current.style.backgroundColor = 'unset'
}
// Allow gradient values for 'image' in addition to URIs
ref.current.style.backgroundImage = image.includes('linear-gradient(')
? `${image}, url('')`
: isUrl
? `url(${image})`
: image
ref.current.style.transition = `opacity ${
immediate ? '0.1s' : '0.5s'
} ease-in-out`
Expand All @@ -79,12 +83,10 @@ const fadeIn = (
const DynamicImage = ({
image,
isUrl,
initialOpacity,
wrapperClassName,
className,
imageStyle,
immediate,
immediatelyLeave,
children,
onClick,
usePlaceholder = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
opacity: 0.5;
}

.tracksContainer :global(.simplebar-scrollbar:before) {
width: 6px;
}

.tracksContainer :global(.simplebar-offset) {
right: 0px !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@
border-radius: 4px;
opacity: 0.5;
}

.simpleBar :global(.simplebar-scrollbar:before) {
width: 6px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
}

.scrollable :global(.simplebar-scrollbar:before) {
width: 6px;
margin-bottom: 20px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
opacity: 0.5;
}

.tracks :global(.simplebar-scrollbar:before) {
width: 6px;
}

.tracks :global(.simplebar-mask) {
border-radius: 0 0 8px 8px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@
border-radius: 4px;
opacity: 0.5;
}

.scrollable :global(.simplebar-scrollbar:before) {
width: 6px;
}
Loading

0 comments on commit 8e32340

Please sign in to comment.