Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/recommend-js/src/frequentlyBoughtTogether.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@algolia/recommend-core';
import {
createFrequentlyBoughtTogetherComponent,
FrequentlyBoughtTogetherProps,
FrequentlyBoughtTogetherProps as FrequentlyBoughtTogetherVDOMProps,
} from '@algolia/recommend-vdom';
import { createElement, Fragment, h, render } from 'preact';
import { useEffect, useState } from 'preact/hooks';
Expand Down Expand Up @@ -40,6 +40,11 @@ function useFrequentlyBoughtTogether<TObject>(
return result;
}

type FrequentlyBoughtTogetherProps<
TObject
> = GetFrequentlyBoughtTogetherProps<TObject> &
Omit<FrequentlyBoughtTogetherVDOMProps<TObject>, 'items'>;

function FrequentlyBoughtTogether<TObject>(
props: FrequentlyBoughtTogetherProps<TObject>
) {
Expand Down
5 changes: 4 additions & 1 deletion packages/recommend-js/src/relatedProducts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@algolia/recommend-core';
import {
createRelatedProductsComponent,
RelatedProductsProps,
RelatedProductsProps as RelatedProductsVDOMProps,
} from '@algolia/recommend-vdom';
import { createElement, Fragment, h, render } from 'preact';
import { useEffect, useState } from 'preact/hooks';
Expand Down Expand Up @@ -36,6 +36,9 @@ function useRelatedProducts<TObject>(props: GetRelatedProductsProps<TObject>) {
return result;
}

type RelatedProductsProps<TObject> = GetRelatedProductsProps<TObject> &
Omit<RelatedProductsVDOMProps<TObject>, 'items'>;

function RelatedProducts<TObject>(props: RelatedProductsProps<TObject>) {
const { recommendations } = useRelatedProducts<TObject>(props);

Expand Down
8 changes: 7 additions & 1 deletion packages/recommend-react/src/FrequentlyBoughtTogether.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { GetFrequentlyBoughtTogetherProps } from '@algolia/recommend-core';
import {
createFrequentlyBoughtTogetherComponent,
FrequentlyBoughtTogetherProps,
FrequentlyBoughtTogetherProps as FrequentlyBoughtTogetherVDOMProps,
} from '@algolia/recommend-vdom';
import React, { createElement, Fragment } from 'react';

Expand All @@ -13,6 +14,11 @@ const UncontrolledFrequentlyBoughtTogether = createFrequentlyBoughtTogetherCompo
}
);

type FrequentlyBoughtTogetherProps<
TObject
> = GetFrequentlyBoughtTogetherProps<TObject> &
Omit<FrequentlyBoughtTogetherVDOMProps<TObject>, 'items'>;

export function FrequentlyBoughtTogether<TObject>(
props: FrequentlyBoughtTogetherProps<TObject>
) {
Expand Down
6 changes: 5 additions & 1 deletion packages/recommend-react/src/RelatedProducts.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { GetRelatedProductsProps } from '@algolia/recommend-core';
import {
createRelatedProductsComponent,
RelatedProductsProps,
RelatedProductsProps as RelatedProductsVDOMProps,
} from '@algolia/recommend-vdom';
import React, { createElement, Fragment } from 'react';

Expand All @@ -11,6 +12,9 @@ const UncontrolledRelatedProducts = createRelatedProductsComponent({
Fragment,
});

type RelatedProductsProps<TObject> = GetRelatedProductsProps<TObject> &
Omit<RelatedProductsVDOMProps<TObject>, 'items'>;

export function RelatedProducts<TObject>(props: RelatedProductsProps<TObject>) {
const { recommendations } = useRelatedProducts<TObject>(props);

Expand Down
5 changes: 1 addition & 4 deletions packages/recommend-vdom/src/FrequentlyBoughtTogether.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/** @jsx createElement */
import { GetFrequentlyBoughtTogetherProps } from '@algolia/recommend-core';

import { createDefaultChildrenComponent } from './DefaultChildren';
import { createDefaultFallbackComponent } from './DefaultFallback';
import { createDefaultHeaderComponent } from './DefaultHeader';
Expand All @@ -13,8 +11,7 @@ import {

export type FrequentlyBoughtTogetherProps<
TObject
> = GetFrequentlyBoughtTogetherProps<TObject> &
RecommendComponentProps<TObject>;
> = RecommendComponentProps<TObject>;

export function createFrequentlyBoughtTogetherComponent({
createElement,
Expand Down
5 changes: 1 addition & 4 deletions packages/recommend-vdom/src/RelatedProducts.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/** @jsx createElement */
import { GetRelatedProductsProps } from '@algolia/recommend-core';

import { createDefaultChildrenComponent } from './DefaultChildren';
import { createDefaultFallbackComponent } from './DefaultFallback';
import { createDefaultHeaderComponent } from './DefaultHeader';
Expand All @@ -11,8 +9,7 @@ import {
Renderer,
} from './types';

export type RelatedProductsProps<TObject> = GetRelatedProductsProps<TObject> &
RecommendComponentProps<TObject>;
export type RelatedProductsProps<TObject> = RecommendComponentProps<TObject>;

export function createRelatedProductsComponent({
createElement,
Expand Down