11import Tabs from "../../design/tabs/Tabs" ;
22import { Section , Sections } from "../../components/section/Section" ;
3-
4- import IconSwipeableAds from "../../assets/icon-swipeable-ads.png" ;
5- import PreviewSwipeableAd from "../../assets/preview-swipeable-ad.png" ;
6- import PreviewSwipeableGame from "../../assets/preview-swipeable-game.png" ;
7-
8- import IconCarouselAds from "../../assets/icon-carousel-ads.png" ;
9- import PreviewCarouselAd from "../../assets/preview-carousel-ad.png" ;
10- import PreviewCarouselGame from "../../assets/preview-carousel-game.jpg" ;
11-
12- import IconVideoAds from "../../assets/icon-video-ads.png" ;
13- import PreviewVideoAd from "../../assets/preview-video-ad.png" ;
14- import PreviewVideoGame from "../../assets/preview-video-game.jpg" ;
15-
16- import IconGameController from "../../assets/icon-game-controller.png" ;
17-
18- import IconCheckoutProduct from "../../assets/icon-checkout-product.png" ;
19- import PreviewCheckoutProduct from "../../assets/preview-checkout-product.png" ;
20- import PreviewCheckoutGame from "../../assets/preview-checkout-game.png" ;
3+ import {
4+ IconSwipeableAds ,
5+ IconCarouselAds ,
6+ IconVideoAds ,
7+ IconGameController ,
8+ IconCheckoutProduct ,
9+ PreviewSwipeableAdSrcSet ,
10+ PreviewCarouselAdSrcSet ,
11+ PreviewVideoAdSrcSet ,
12+ PreviewCheckoutProductSrcSet ,
13+ PreviewSwipeableGameSrcSet ,
14+ PreviewCarouselGameSrcSet ,
15+ PreviewVideoGameSrcSet ,
16+ PreviewCheckoutGameSrcSet ,
17+ } from "../../assets/product-images" ;
2118
2219import styles from "./Product.module.css" ;
2320import { Heading1 } from "../../design/heading/Heading" ;
@@ -76,7 +73,10 @@ function AdsProductContent() {
7673 />
7774 }
7875 preview = {
79- < Preview adUrl = { PreviewSwipeableAd } gameUrl = { PreviewSwipeableGame } />
76+ < Preview
77+ adSrcSet = { PreviewSwipeableAdSrcSet }
78+ gameSrcSet = { PreviewSwipeableGameSrcSet }
79+ />
8080 }
8181 />
8282 < Section
@@ -90,7 +90,10 @@ function AdsProductContent() {
9090 />
9191 }
9292 preview = {
93- < Preview adUrl = { PreviewCarouselAd } gameUrl = { PreviewCarouselGame } />
93+ < Preview
94+ adSrcSet = { PreviewCarouselAdSrcSet }
95+ gameSrcSet = { PreviewCarouselGameSrcSet }
96+ />
9497 }
9598 />
9699 < Section
@@ -103,7 +106,12 @@ function AdsProductContent() {
103106 label = "View Experience"
104107 />
105108 }
106- preview = { < Preview adUrl = { PreviewVideoAd } gameUrl = { PreviewVideoGame } /> }
109+ preview = {
110+ < Preview
111+ adSrcSet = { PreviewVideoAdSrcSet }
112+ gameSrcSet = { PreviewVideoGameSrcSet }
113+ />
114+ }
107115 />
108116 </ Sections >
109117 ) ;
@@ -119,20 +127,30 @@ function CheckoutProductContent() {
119127 action = { < CheckoutAction label = "View Experience" /> }
120128 preview = {
121129 < Preview
122- adUrl = { PreviewCheckoutProduct }
123- gameUrl = { PreviewCheckoutGame }
130+ adSrcSet = { PreviewCheckoutProductSrcSet }
131+ gameSrcSet = { PreviewCheckoutGameSrcSet }
124132 />
125133 }
126134 />
127135 </ Sections >
128136 ) ;
129137}
130138
131- function Preview ( { adUrl , gameUrl } : { adUrl : string ; gameUrl : string } ) {
139+ function Preview ( { adSrcSet , gameSrcSet } : { adSrcSet : string ; gameSrcSet : string } ) {
132140 return (
133141 < div className = { styles . preview } >
134- < img src = { adUrl } className = { styles . previewAd } alt = "Preview Ad" />
135- < img src = { gameUrl } className = { styles . previewGame } alt = "Preview Game" />
142+ < img
143+ srcSet = { adSrcSet }
144+ sizes = "300px"
145+ className = { styles . previewAd }
146+ alt = "Preview Ad"
147+ />
148+ < img
149+ srcSet = { gameSrcSet }
150+ sizes = "200px"
151+ className = { styles . previewGame }
152+ alt = "Preview Game"
153+ />
136154 </ div >
137155 ) ;
138156}
0 commit comments