fix(medusa, admin-ui, medusa-react): Gift Card update fixes and admin UI cleanup (#3676)

* fix gc domain issues

* add changeset

* update changeset

* more minor fixes, remove breadcrumb

* more cleanup

* address feedback
This commit is contained in:
Kasper Fabricius Kristensen
2023-04-02 19:04:32 +02:00
committed by GitHub
parent a5ad6c0542
commit 788ddc0f43
51 changed files with 997 additions and 709 deletions
@@ -1,22 +1,23 @@
import React from "react"
import React, { PropsWithChildren } from "react"
import Actionables, { ActionType } from "../../molecules/actionables"
type BannerCardProps = {
type BannerCardProps = PropsWithChildren<{
actions?: ActionType[]
title: string
thumbnail: string | null
} & React.RefAttributes<HTMLDivElement>
thumbnail?: string | null
}> &
React.RefAttributes<HTMLDivElement>
type BannerCardDescriptionProps = {
type BannerCardDescriptionProps = PropsWithChildren<{
cta?: {
label: string
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void
}
}
}>
const BannerCard: React.FC<BannerCardProps> & {
Description: React.FC<BannerCardDescriptionProps>
Footer: React.FC
Footer: React.FC<PropsWithChildren>
} = ({ title, thumbnail, actions, children }) => {
return (
<div className="rounded-rounded bg-grey-0 border-grey-20 p-base medium:p-xlarge w-full border">
@@ -63,7 +64,7 @@ const Description: React.FC<BannerCardDescriptionProps> = ({
)
}
const Footer: React.FC = ({ children }) => {
const Footer = ({ children }: PropsWithChildren) => {
return <div className="mt-base">{children}</div>
}
@@ -1,42 +0,0 @@
import clsx from "clsx"
import React from "react"
import { useNavigate } from "react-router-dom"
import ChevronRightIcon from "../../fundamentals/icons/chevron-right-icon"
type BreadcrumbProps = React.HtmlHTMLAttributes<HTMLDivElement> & {
previousRoute?: string
previousBreadcrumb?: string
currentPage: string
}
const Breadcrumb: React.FC<BreadcrumbProps> = ({
previousRoute = "/a/settings",
previousBreadcrumb = "Settings",
currentPage,
className,
...props
}) => {
const navigate = useNavigate()
return (
<div
className={clsx(
"inter-small-semibold text-grey-50 mb-4 flex w-full items-center",
className
)}
{...props}
>
<span
className="text-violet-60 cursor-pointer"
onClick={() => navigate(previousRoute)}
>
{previousBreadcrumb}
</span>
<span className="mx-0.5">
<ChevronRightIcon size={16} />
</span>
<span>{currentPage}</span>
</div>
)
}
export default Breadcrumb