diff --git a/.changeset/pretty-months-mix.md b/.changeset/pretty-months-mix.md new file mode 100644 index 0000000..aae8c4c --- /dev/null +++ b/.changeset/pretty-months-mix.md @@ -0,0 +1,5 @@ +--- +"saleor-app-products-feed": patch +--- + +Update the UI to the common theme diff --git a/apps/products-feed/src/modules/app-configuration/ui/channels-configuration.tsx b/apps/products-feed/src/modules/app-configuration/ui/channels-configuration.tsx index ac60f2c..6ca69f7 100644 --- a/apps/products-feed/src/modules/app-configuration/ui/channels-configuration.tsx +++ b/apps/products-feed/src/modules/app-configuration/ui/channels-configuration.tsx @@ -1,22 +1,22 @@ import { trpcClient } from "../../trpc/trpc-client"; import { LinearProgress, Paper } from "@material-ui/core"; import React, { useEffect, useMemo, useState } from "react"; -import { makeStyles } from "@saleor/macaw-ui"; +import { EditIcon, IconButton, makeStyles } from "@saleor/macaw-ui"; import { AppConfigContainer } from "../app-config-container"; import { UrlConfigurationForm } from "./url-configuration-form"; -import { ChannelsList } from "./channels-list"; import { actions, useAppBridge } from "@saleor/app-sdk/app-bridge"; import { AppColumnsLayout } from "../../ui/app-columns-layout"; import { FeedPreviewCard } from "./feed-preview-card"; import { Instructions } from "./instructions"; +import SideMenu from "./side-menu"; const useStyles = makeStyles((theme) => { return { - header: { marginBottom: 20 }, - grid: { display: "grid", gridTemplateColumns: "1fr 1fr", alignItems: "start", gap: 40 }, - formContainer: { - top: 0, - position: "sticky", + grid: { + display: "grid", + gridTemplateColumns: "1fr 1fr", + alignItems: "start", + gap: 40, }, instructionsContainer: { padding: 15, @@ -78,16 +78,30 @@ export const ChannelsConfiguration = () => { return ( - { + appBridge?.dispatch( + actions.Redirect({ + to: `/channels/`, + }) + ); + }} + > + + + } + onClick={(id) => setActiveChannelSlug(id)} + items={channels.data.map((c) => ({ label: c.name, id: c.slug })) || []} /> {activeChannel ? (
- - + { /> {saveError && {saveError.message}} +
) : null} diff --git a/apps/products-feed/src/modules/app-configuration/ui/channels-list.tsx b/apps/products-feed/src/modules/app-configuration/ui/channels-list.tsx deleted file mode 100644 index 4982617..0000000 --- a/apps/products-feed/src/modules/app-configuration/ui/channels-list.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { - makeStyles, - OffsettedList, - OffsettedListBody, - OffsettedListHeader, - OffsettedListItem, - OffsettedListItemCell, -} from "@saleor/macaw-ui"; -import clsx from "clsx"; -import { Typography } from "@material-ui/core"; -import React from "react"; -import { ChannelFragment } from "../../../../generated/graphql"; - -const useStyles = makeStyles((theme) => { - return { - listItem: { - cursor: "pointer", - height: "auto !important", - border: `1px solid transparent`, - }, - listItemActive: { - border: `1px solid ${ - theme.palette.type === "light" ? theme.palette.divider : theme.palette.grey.A200 - }`, - }, - cellSlug: { - fontFamily: "monospace", - opacity: 0.8, - }, - }; -}); - -type Props = { - channels: ChannelFragment[]; - activeChannelSlug: string; - onChannelClick(channelSlug: string): void; -}; - -export const ChannelsList = ({ channels, activeChannelSlug, onChannelClick }: Props) => { - const styles = useStyles(); - - return ( - - - {channels.map((c) => { - return ( - { - onChannelClick(c.slug); - }} - > - - {c.name} - - {c.slug} - - - - ); - })} - - - ); -}; diff --git a/apps/products-feed/src/modules/app-configuration/ui/feed-preview-card.tsx b/apps/products-feed/src/modules/app-configuration/ui/feed-preview-card.tsx index 154d28f..b848f68 100644 --- a/apps/products-feed/src/modules/app-configuration/ui/feed-preview-card.tsx +++ b/apps/products-feed/src/modules/app-configuration/ui/feed-preview-card.tsx @@ -38,8 +38,8 @@ export const FeedPreviewCard = ({ channelSlug }: FeedPreviewCardProps) => { }; return ( - - Your Google Merchant Feed + + Your Google Merchant Feed preview { value={googleFeedUrl} disabled={true} className={styles.field} + helperText="Dedicated URL for your Google Merchant Feed" />