File tree Expand file tree Collapse file tree 4 files changed +16
-3
lines changed Expand file tree Collapse file tree 4 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { TrackingPlacesSearchContext } from "../../../context/TrackingContext"
88import { AggregatePlaceAttributes } from "../../../entities/Place/types"
99import { explorerUrl } from "../../../entities/Place/utils"
1010import { SegmentPlace } from "../../../modules/segment"
11+ import { getImageUrl } from "../../../utils/image"
1112import FavoriteBox from "../../Button/FavoriteBox"
1213import JumpInPositionButton from "../../Button/JumpInPositionButton"
1314import ShareBox from "../../Button/ShareBox"
@@ -60,7 +61,7 @@ export default React.memo(function PlaceDescription(
6061 style = {
6162 ! loading && place ?. image
6263 ? {
63- backgroundImage : `url(${ place . image } )` ,
64+ backgroundImage : `url(${ getImageUrl ( place . image ) } )` ,
6465 }
6566 : { }
6667 }
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { AggregatePlaceAttributes } from "../../../entities/Place/types"
1313import { explorerUrl } from "../../../entities/Place/utils"
1414import locations from "../../../modules/locations"
1515import { SegmentPlace } from "../../../modules/segment"
16+ import { getImageUrl } from "../../../utils/image"
1617import UserCount from "../../Label/UserCount/UserCount"
1718
1819import "./PlaceFeatured.css"
@@ -37,7 +38,9 @@ export default React.memo(function PlaceFeatured(props: PlaceFeaturedProps) {
3738 < div
3839 className = { TokenList . join ( [ "place-featured" , loading && "loading" ] ) }
3940 style = { {
40- backgroundImage : `url("${ item . highlighted_image || item . image } ")` ,
41+ backgroundImage : `url("${ getImageUrl (
42+ item . highlighted_image || item . image
43+ ) } ")`,
4144 } }
4245 >
4346 < div className = "place-featured__overlay" />
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import TokenList from "decentraland-gatsby/dist/utils/dom/TokenList"
77import { AggregatePlaceAttributes } from "../../../entities/Place/types"
88import { explorerUrl } from "../../../entities/Place/utils"
99import { SegmentPlace } from "../../../modules/segment"
10+ import { getImageUrl } from "../../../utils/image"
1011import FavoriteBox from "../../Button/FavoriteBox"
1112import JumpInPositionButton from "../../Button/JumpInPositionButton"
1213import ShareBox from "../../Button/ShareBox"
@@ -58,7 +59,7 @@ export default React.memo(function WorldDescription(
5859 style = {
5960 ! loading && world ?. image
6061 ? {
61- backgroundImage : `url(${ world . image } )` ,
62+ backgroundImage : `url(${ getImageUrl ( world . image ) } )` ,
6263 }
6364 : { }
6465 }
Original file line number Diff line number Diff line change 1+ import env from "decentraland-gatsby/dist/utils/env"
2+
3+ export function getImageUrl ( imageUrl ?: string | null ) {
4+ if ( env ( "NEW_ROLLOUT" ) && imageUrl && imageUrl . startsWith ( "/" ) ) {
5+ return `/places${ imageUrl } `
6+ }
7+ return imageUrl
8+ }
You can’t perform that action at this time.
0 commit comments