Skip to content

Commit

Permalink
Improve signature for types
Browse files Browse the repository at this point in the history
  • Loading branch information
timowestnosto committed Jul 22, 2024
1 parent 05a47dc commit 1d5f133
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 41 deletions.
8 changes: 3 additions & 5 deletions spec/category.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ test("Category page render", async () => {
account="shopify-11368366139"
recommendationComponent={<RecommendationComponent />}
>
<>
<NostoPlacement id="categorypage-nosto-1" />
<NostoPlacement id="categorypage-nosto-2" />
<NostoCategory category="Rings" />
</>
<NostoPlacement id="categorypage-nosto-1" />
<NostoPlacement id="categorypage-nosto-2" />
<NostoCategory category="Rings" />
</NostoProvider>
)

Expand Down
10 changes: 4 additions & 6 deletions spec/checkout.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ test("Checkout page render", async () => {
account="shopify-11368366139"
recommendationComponent={<RecommendationComponent />}
>
<>
<NostoPlacement id="cartpage-nosto-1" />
<NostoPlacement id="cartpage-nosto-2" />
<NostoPlacement id="cartpage-nosto-3" />
<NostoCheckout />
</>
<NostoPlacement id="cartpage-nosto-1" />
<NostoPlacement id="cartpage-nosto-2" />
<NostoPlacement id="cartpage-nosto-3" />
<NostoCheckout />
</NostoProvider>
)

Expand Down
8 changes: 3 additions & 5 deletions spec/fohofo.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ test("404 page render", async () => {
account="shopify-11368366139"
recommendationComponent={<RecommendationComponent />}
>
<>
<NostoPlacement id="notfound-nosto-1" />
<NostoPlacement id="notfound-nosto-2" />
<Nosto404 />
</>
<NostoPlacement id="notfound-nosto-1" />
<NostoPlacement id="notfound-nosto-2" />
<Nosto404 />
</NostoProvider>
)

Expand Down
10 changes: 4 additions & 6 deletions spec/home.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ test("Home page render", async () => {
account="shopify-11368366139"
recommendationComponent={<RecommendationComponent />}
>
<>
<NostoPlacement id="frontpage-nosto-1" />
<NostoPlacement id="frontpage-nosto-3" />
<NostoPlacement id="frontpage-nosto-4" />
<NostoHome />
</>
<NostoPlacement id="frontpage-nosto-1" />
<NostoPlacement id="frontpage-nosto-3" />
<NostoPlacement id="frontpage-nosto-4" />
<NostoHome />
</NostoProvider>
)

Expand Down
12 changes: 5 additions & 7 deletions spec/other.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ test("Other page render", async () => {
account="shopify-11368366139"
recommendationComponent={<RecommendationComponent />}
>
<>
<NostoPlacement id="cartpage-nosto-1" />
<NostoPlacement id="categorypage-nosto-1" />
<NostoPlacement id="productpage-nosto-1" />
<NostoPlacement id="productpage-nosto-2" />
<NostoOther />
</>
<NostoPlacement id="cartpage-nosto-1" />
<NostoPlacement id="categorypage-nosto-1" />
<NostoPlacement id="productpage-nosto-1" />
<NostoPlacement id="productpage-nosto-2" />
<NostoOther />
</NostoProvider>
)

Expand Down
10 changes: 4 additions & 6 deletions spec/product.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ test("Product page render", async () => {
account="shopify-11368366139"
recommendationComponent={<RecommendationComponent />}
>
<>
<NostoPlacement id="productpage-nosto-1" />
<NostoPlacement id="productpage-nosto-2" />
<NostoPlacement id="productpage-nosto-3" />
<NostoProduct product="7078777258043" />
</>
<NostoPlacement id="productpage-nosto-1" />
<NostoPlacement id="productpage-nosto-2" />
<NostoPlacement id="productpage-nosto-3" />
<NostoProduct product="7078777258043" />
</NostoProvider>
)

Expand Down
8 changes: 3 additions & 5 deletions spec/search.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ test("Search page render", async () => {
account="shopify-11368366139"
recommendationComponent={<RecommendationComponent />}
>
<>
<NostoPlacement id="searchpage-nosto-1" />
<NostoPlacement id="searchpage-nosto-2" />
<NostoSearch query="" />
</>
<NostoPlacement id="searchpage-nosto-1" />
<NostoPlacement id="searchpage-nosto-2" />
<NostoSearch query="" />
</NostoProvider>
)

Expand Down
5 changes: 4 additions & 1 deletion src/components/NostoProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ export interface NostoProviderProps {
* Indicates an url of a server
*/
host?: string
children: React.ReactElement
/**
* children
*/
children: React.ReactElement | React.ReactElement[]
/**
* Indicates if merchant uses multiple currencies
*/
Expand Down

0 comments on commit 1d5f133

Please sign in to comment.