Skip to content

Commit 83257ad

Browse files
committed
fix showing the ad
1 parent 43beee0 commit 83257ad

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/components/List/ListComponent.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ReactNode } from 'react'
22
import { Placeholder } from 'src/components/placeholders'
33
import { ListComponentPropsType } from './types'
4-
import * as CarbonAd from 'src/features/carbonAds'
4+
import { CarbonAd } from 'src/features/carbonAds'
55

66
export function ListComponent(props: ListComponentPropsType) {
77
const { items, isLoading, error, renderItem, withAds, placeholder = <Placeholder /> } = props
@@ -17,9 +17,9 @@ export function ListComponent(props: ListComponentPropsType) {
1717

1818
return items.map((item, index) => {
1919
let content: ReactNode[] = [renderItem(item, index)]
20-
// if (withAds && index === 0) {
21-
// content.unshift(<CarbonAd key={'carbonAd0'}/>)
22-
// }
20+
if (withAds && index === 0) {
21+
content.unshift(<CarbonAd key={'carbonAd0'} />)
22+
}
2323
return content
2424
})
2525
}

src/features/carbonAds/components/CarbonAd.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import './CarbonAd.css'
22
import { addHttpsProtocol } from 'src/utils/UrlUtils'
33
import { useGetAd } from '../api/getAd'
4-
export default function CarbonAd() {
4+
export const CarbonAd = () => {
55
const { data: ad } = useGetAd()
66

77
if (!ad) {

0 commit comments

Comments
 (0)