Skip to content

Commit

Permalink
New default image for learning resources (#1136)
Browse files Browse the repository at this point in the history
* New default image for learning resources

* Update image
  • Loading branch information
jonkafton authored Jun 27, 2024
1 parent 5ef7268 commit e374b4d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
formatDate,
resourceThumbnailSrc,
getReadableResourceType,
DEFAULT_RESOURCE_IMG,
} from "ol-utilities"
import type { EmbedlyConfig } from "ol-utilities"
import { theme } from "../ThemeProvider/ThemeProvider"
Expand Down Expand Up @@ -80,6 +81,7 @@ const Image = styled.img<{ aspect: number }>`
aspect-ratio: ${({ aspect }) => aspect};
border-radius: 8px;
width: 100%;
object-fit: cover;
`

const SkeletonImage = styled(Skeleton)<{ aspect: number }>`
Expand Down Expand Up @@ -169,6 +171,10 @@ const ImageSection: React.FC<{
alt={resource?.image.alt ?? ""}
/>
)
} else if (resource) {
return (
<Image src={DEFAULT_RESOURCE_IMG} aspect={config.width / config.height} />
)
} else {
return (
<SkeletonImage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const embedlyCroppedImage = (
)}&height=${height}&width=${width}&grow=true&animate=false&errorurl=${BLANK_IMAGE}`

const DEFAULT_RESOURCE_IMG = new URL(
"/static/images/default_resource_thumb.jpg",
"/static/images/default_resource.jpg",
window.location.origin,
).toString()

Expand Down

0 comments on commit e374b4d

Please sign in to comment.