diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index 4a8e436bf..906e856f9 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -2625,6 +2625,9 @@ "context": "search", "string": "No results" }, + "HqRNN8": { + "string": "Support" + }, "HqeqEV": { "context": "create gift card product alert message", "string": "Create a gift card product" @@ -7202,6 +7205,9 @@ "rwOx2s": { "string": "Please provide a transaction reference using the input below:" }, + "rxNddi": { + "string": "Homepage" + }, "ryAyPr": { "string": "Requested Invoice was generated. It was added to the top of the invoice list on this view. Enjoy!" }, diff --git a/src/components/AppLayout/TopNav.tsx b/src/components/AppLayout/TopNav.tsx deleted file mode 100644 index 1c54fa6a6..000000000 --- a/src/components/AppLayout/TopNav.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { ArrowLeftIcon, Box, sprinkles, Text } from "@saleor/macaw-ui/next"; -import React, { PropsWithChildren } from "react"; -import { Link } from "react-router-dom"; - -import useAppChannel from "./AppChannelContext"; -import AppChannelSelect from "./AppChannelSelect"; -import { topBarHeight } from "./consts"; - -interface TopNavProps { - title: string | React.ReactNode; - href?: string; -} - -export const TopNav: React.FC> = ({ - title, - href, - children, -}) => { - const { availableChannels, channel, isPickerActive, setChannel } = - useAppChannel(false); - - return ( - - {href && ( - - - - )} - - {title} - - - {isPickerActive && ( - - )} - - {children} - - - ); -}; diff --git a/src/components/AppLayout/TopNav/TopNav.tsx b/src/components/AppLayout/TopNav/TopNav.tsx new file mode 100644 index 000000000..a08ad3feb --- /dev/null +++ b/src/components/AppLayout/TopNav/TopNav.tsx @@ -0,0 +1,40 @@ +import { Box, Text } from "@saleor/macaw-ui/next"; +import React, { PropsWithChildren } from "react"; + +import useAppChannel from "../AppChannelContext"; +import AppChannelSelect from "../AppChannelSelect"; +import { TopNavLink } from "./TopNavLink"; +import { TopNavWrapper } from "./TopNavWrapper"; + +interface TopNavProps { + title: string | React.ReactNode; + href?: string; +} + +export const TopNav: React.FC> = ({ + title, + href, + children, +}) => { + const { availableChannels, channel, isPickerActive, setChannel } = + useAppChannel(false); + + return ( + + {href && } + + {title} + + + {isPickerActive && ( + + )} + {children} + + + ); +}; diff --git a/src/components/AppLayout/TopNav/TopNavLink.tsx b/src/components/AppLayout/TopNav/TopNavLink.tsx new file mode 100644 index 000000000..5aae561ca --- /dev/null +++ b/src/components/AppLayout/TopNav/TopNavLink.tsx @@ -0,0 +1,17 @@ +import { ArrowLeftIcon, Button } from "@saleor/macaw-ui/next"; +import React from "react"; +import { Link } from "react-router-dom"; + +export const TopNavLink: React.FC<{ + to: string; + variant?: "secondary" | "tertiary"; +}> = ({ to, variant = "secondary" }) => ( + + + )} + {homepageUrl && ( + + )} + + + + ); +}; diff --git a/src/new-apps/components/InstalledAppListRow/InstalledAppListRow.tsx b/src/new-apps/components/InstalledAppListRow/InstalledAppListRow.tsx index 069c0b193..4cc677e68 100644 --- a/src/new-apps/components/InstalledAppListRow/InstalledAppListRow.tsx +++ b/src/new-apps/components/InstalledAppListRow/InstalledAppListRow.tsx @@ -15,6 +15,7 @@ import { } from "@saleor/macaw-ui/next"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; +import { useLocation } from "react-router"; import { AppAvatar } from "../AppAvatar/AppAvatar"; import AppPermissions from "../AppPermissions"; @@ -24,10 +25,12 @@ export const InstalledAppListRow: React.FC = props => { const { app, isExternal, logo } = props; const intl = useIntl(); const { openAppSettings } = useAppListContext(); + const location = useLocation(); return ( @@ -46,7 +49,7 @@ export const InstalledAppListRow: React.FC = props => { gap={5} alignItems="center" > - + {app.name} {`v${app.version}`} diff --git a/src/new-apps/components/NotInstalledAppListRow/NotInstalledAppListRow.tsx b/src/new-apps/components/NotInstalledAppListRow/NotInstalledAppListRow.tsx index c86ad3e02..1de27cdcf 100644 --- a/src/new-apps/components/NotInstalledAppListRow/NotInstalledAppListRow.tsx +++ b/src/new-apps/components/NotInstalledAppListRow/NotInstalledAppListRow.tsx @@ -46,7 +46,7 @@ export const NotInstalledAppListRow: React.FC = props => { alignItems="center" justifyContent={{ mobile: "space-between", desktop: "flex-start" }} > - + {appInstallation.appName} {isExternal && (