Skip to content

Commit 2f570b6

Browse files
committed
migrate placeholders to ts
1 parent 97bc47c commit 2f570b6

5 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/cards/ProductHuntCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import PreferencesContext from '../preferences/PreferencesContext'
88
import CardLink from '../components/CardLink'
99
import CardItemWithActions from '../components/CardItemWithActions'
1010
import producthuntApi from '../services/producthunt'
11-
import ProductHuntPlaceholder from '../components/ProductHuntPlaceholder'
11+
import { ProductHuntPlaceholder } from '../components/placeholders'
1212
import { Attributes } from 'src/lib/analytics'
1313

1414
const ProductItem = ({ item, index }) => {

src/components/ListComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState, useEffect } from 'react'
22
import CarbonAd from '../features/carbonAds/components/CarbonAd'
3-
import Placeholder from './Placeholder'
3+
import { Placeholder } from 'src/components/placeholders'
44

55
function ListComponent({ fetchData, refresh, renderItem, withAds, placeholder = <Placeholder /> }) {
66
const [items, setItems] = useState([])

src/components/Placeholder.js renamed to src/components/placeholders/Placeholder.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22

3-
function Placeholder() {
3+
export const Placeholder = () => {
44
return (
55
<div className="cardPlaceholder">
66
<span className="line"></span>
@@ -13,5 +13,3 @@ function Placeholder() {
1313
</div>
1414
)
1515
}
16-
17-
export default Placeholder

src/components/ProductHuntPlaceholder.js renamed to src/components/placeholders/ProductHuntPlaceholder.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22

3-
function ProductHuntPlaceholder() {
3+
export const ProductHuntPlaceholder = () => {
44
return (
55
<div className="cardPlaceholder mediaCardPlaceholder">
66
<span className="media" />
@@ -16,5 +16,3 @@ function ProductHuntPlaceholder() {
1616
</div>
1717
)
1818
}
19-
20-
export default ProductHuntPlaceholder
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./Placeholder"
2+
export * from "./ProductHuntPlaceholder"

0 commit comments

Comments
 (0)