
* Add refactors to apps folder Remove default exports in apps/views Rename apps/views components, ensure they have similar convention Refactor apps indexes files Rename marketplace mentions to appstore Rename useMarketplaceApps to useAppstoreApps Rename some marketplace mentions to appstore fix test * Add changeset
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import { AppstoreApi } from "@dashboard/apps/appstore.types";
|
|
import { AppInstallationFragment } from "@dashboard/graphql";
|
|
import { Skeleton } from "@material-ui/lab";
|
|
import { Box } from "@saleor/macaw-ui/next";
|
|
import chunk from "lodash/chunk";
|
|
import React from "react";
|
|
|
|
import AppListRow from "../AppListRow";
|
|
|
|
interface AllAppListProps {
|
|
appList?: AppstoreApi.SaleorApp[];
|
|
appInstallationList?: AppInstallationFragment[];
|
|
navigateToAppInstallPage?: (manifestUrl: string) => void;
|
|
navigateToGithubForkPage?: (githubForkUrl: string) => void;
|
|
}
|
|
|
|
const AllAppList: React.FC<AllAppListProps> = ({
|
|
appList,
|
|
appInstallationList,
|
|
navigateToAppInstallPage,
|
|
navigateToGithubForkPage,
|
|
}) => {
|
|
const appsPairs = React.useMemo(() => chunk(appList, 2), [appList]);
|
|
|
|
if (!appList) {
|
|
return <Skeleton />;
|
|
}
|
|
|
|
return (
|
|
<Box display="flex" flexDirection="column" gap={5} marginTop={5}>
|
|
{appsPairs.map(appPair => (
|
|
<AppListRow
|
|
key={appPair[0].name.en}
|
|
appPair={appPair}
|
|
appInstallationList={appInstallationList}
|
|
navigateToAppInstallPage={navigateToAppInstallPage}
|
|
navigateToGithubForkPage={navigateToGithubForkPage}
|
|
/>
|
|
))}
|
|
</Box>
|
|
);
|
|
};
|
|
|
|
export default AllAppList;
|