diff --git a/package-lock.json b/package-lock.json index 47859894d..a0446d6f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "@material-ui/lab": "^4.0.0-alpha.61", "@material-ui/styles": "^4.11.4", "@reach/auto-id": "^0.16.0", - "@saleor/macaw-ui": "^0.8.0-pre.43", + "@saleor/macaw-ui": "^0.8.0-pre.49", "@saleor/sdk": "^0.4.4", "@sentry/react": "^6.0.0", "@types/faker": "^5.1.6", @@ -7271,9 +7271,9 @@ } }, "node_modules/@saleor/macaw-ui": { - "version": "0.8.0-pre.44", - "resolved": "https://registry.npmjs.org/@saleor/macaw-ui/-/macaw-ui-0.8.0-pre.44.tgz", - "integrity": "sha512-iSygNhSfMxJrmnbXKKmE/iKc7dMq/m996Hqfl5ZFcZ6KpurmI0940AjJcYDMnDXUl+Md6OJyRxv7PKKy8nU+Mg==", + "version": "0.8.0-pre.49", + "resolved": "https://registry.npmjs.org/@saleor/macaw-ui/-/macaw-ui-0.8.0-pre.49.tgz", + "integrity": "sha512-SHUfBE1AaDsam/K3ZcotDtUH6/jcyRR9Gi/Zpvw/cTcwoosq09WcewMWZNdHgY5Fkbgve7HTKb+wCyah+sBO8w==", "dependencies": { "@floating-ui/react-dom-interactions": "^0.5.0", "@radix-ui/react-radio-group": "^1.1.1", @@ -41431,9 +41431,9 @@ } }, "@saleor/macaw-ui": { - "version": "0.8.0-pre.44", - "resolved": "https://registry.npmjs.org/@saleor/macaw-ui/-/macaw-ui-0.8.0-pre.44.tgz", - "integrity": "sha512-iSygNhSfMxJrmnbXKKmE/iKc7dMq/m996Hqfl5ZFcZ6KpurmI0940AjJcYDMnDXUl+Md6OJyRxv7PKKy8nU+Mg==", + "version": "0.8.0-pre.49", + "resolved": "https://registry.npmjs.org/@saleor/macaw-ui/-/macaw-ui-0.8.0-pre.49.tgz", + "integrity": "sha512-SHUfBE1AaDsam/K3ZcotDtUH6/jcyRR9Gi/Zpvw/cTcwoosq09WcewMWZNdHgY5Fkbgve7HTKb+wCyah+sBO8w==", "requires": { "@floating-ui/react-dom-interactions": "^0.5.0", "@radix-ui/react-radio-group": "^1.1.1", diff --git a/package.json b/package.json index 0b825ce71..92c67698b 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@material-ui/lab": "^4.0.0-alpha.61", "@material-ui/styles": "^4.11.4", "@reach/auto-id": "^0.16.0", - "@saleor/macaw-ui": "^0.8.0-pre.43", + "@saleor/macaw-ui": "^0.8.0-pre.49", "@saleor/sdk": "^0.4.4", "@sentry/react": "^6.0.0", "@types/faker": "^5.1.6", diff --git a/src/apps/components/AllAppList/AllAppList.tsx b/src/apps/components/AllAppList/AllAppList.tsx index 5efed94b9..cbf7fcaf6 100644 --- a/src/apps/components/AllAppList/AllAppList.tsx +++ b/src/apps/components/AllAppList/AllAppList.tsx @@ -1,11 +1,11 @@ import { GetV2SaleorAppsResponse } from "@dashboard/apps/marketplace.types"; -import { resolveInstallationOfMarketplaceApp } from "@dashboard/apps/utils"; 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 AppListCard from "../AppListCard"; +import AppListRow from "../AppListRow"; interface AllAppListProps { appList?: GetV2SaleorAppsResponse.SaleorApp[]; @@ -20,28 +20,19 @@ const AllAppList: React.FC = ({ navigateToAppInstallPage, navigateToGithubForkPage, }) => { + const appsPairs = React.useMemo(() => chunk(appList, 2), [appList]); + if (!appList) { return ; } return ( - - {appList.map(app => ( - + {appsPairs.map(appPair => ( + diff --git a/src/apps/components/AppListCard/AppListCard.tsx b/src/apps/components/AppListCard/AppListCard.tsx deleted file mode 100644 index 4b3f80638..000000000 --- a/src/apps/components/AppListCard/AppListCard.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import { useAppListContext } from "@dashboard/apps/context"; -import { GetV2SaleorAppsResponse } from "@dashboard/apps/marketplace.types"; -import { getAppDetails } from "@dashboard/apps/utils"; -import { AppInstallationFragment } from "@dashboard/graphql"; -import { Box } from "@saleor/macaw-ui/next"; -import React from "react"; -import { useIntl } from "react-intl"; - -import AppListCardActions from "./AppListCardActions"; -import AppListCardDescription from "./AppListCardDescription"; -import AppListCardIntegrations from "./AppListCardIntegrations"; -import AppListCardLinks from "./AppListCardLinks"; - -interface AppListCardProps { - app: GetV2SaleorAppsResponse.SaleorApp; - appInstallation?: AppInstallationFragment; - navigateToAppInstallPage?: (manifestUrl: string) => void; - navigateToGithubForkPage?: (githubForkUrl: string) => void; -} - -const AppListCard: React.FC = ({ - app, - appInstallation, - navigateToAppInstallPage, - navigateToGithubForkPage, -}) => { - const intl = useIntl(); - const { retryAppInstallation, removeAppInstallation } = useAppListContext(); - - const details = getAppDetails({ - intl, - app, - appInstallation, - navigateToAppInstallPage, - navigateToGithubForkPage, - retryAppInstallation, - removeAppInstallation, - }); - - return ( - - - - - - - - - - - ); -}; -AppListCard.displayName = "AppListCard"; -export default AppListCard; diff --git a/src/apps/components/AppListCard/index.ts b/src/apps/components/AppListCard/index.ts deleted file mode 100644 index 9e1a6429b..000000000 --- a/src/apps/components/AppListCard/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./AppListCard"; -export { default } from "./AppListCard"; -export * from "./AppLogo"; diff --git a/src/apps/components/AppListPage/AppListPage.tsx b/src/apps/components/AppListPage/AppListPage.tsx index 32e785189..c810ba865 100644 --- a/src/apps/components/AppListPage/AppListPage.tsx +++ b/src/apps/components/AppListPage/AppListPage.tsx @@ -3,7 +3,7 @@ import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import useNavigator from "@dashboard/hooks/useNavigator"; import { sectionNames } from "@dashboard/intl"; import { ListProps } from "@dashboard/types"; -import { Box, Text } from "@saleor/macaw-ui/next"; +import { Box, sprinkles, Text } from "@saleor/macaw-ui/next"; import React, { useCallback } from "react"; import { FormattedMessage, useIntl } from "react-intl"; @@ -114,7 +114,12 @@ export const AppListPage: React.FC = props => { {sectionsAvailability.all && !marketplaceError && ( - + = props => { )} {sectionsAvailability.comingSoon && !marketplaceError && ( - + {intl.formatMessage(messages.comingSoonApps)} = ({ } return ( - + {githubForkHandler && (