- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
feat(dashboard): added details page for promotions + edit sliders (#6882
) * chore: added details page for promotions * chore: add edit rules, edit details and edit campaign pages * chore: change to type button * chore: connection for rules * chore: listing rule labels of multiple modules * chore: add badge summary list * chore: fix campaigns
- Loading branch information
Showing
60 changed files
with
2,803 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"medusa-react": patch | ||
"@medusajs/medusa": patch | ||
--- | ||
|
||
feat(dashboard): added details page for promotions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...ages/admin-next/dashboard/src/components/common/badge-list-summary/badge-list-summary.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { Badge, Tooltip, clx } from "@medusajs/ui" | ||
import { useTranslation } from "react-i18next" | ||
|
||
type BadgeListSummaryProps = { | ||
/** | ||
* Number of initial items to display | ||
* @default 2 | ||
*/ | ||
n?: number | ||
/** | ||
* List of strings to display as abbreviated list | ||
*/ | ||
list: string[] | ||
/** | ||
* Is the summary displayed inline. | ||
* Determines whether the center text is truncated if there is no space in the container | ||
*/ | ||
inline?: boolean | ||
|
||
className?: string | ||
} | ||
|
||
export const BadgeListSummary = ({ | ||
list, | ||
className, | ||
inline, | ||
n = 2, | ||
}: BadgeListSummaryProps) => { | ||
const { t } = useTranslation() | ||
|
||
const title = t("general.plusCount", { | ||
count: list.length - n, | ||
}) | ||
|
||
return ( | ||
<div | ||
className={clx( | ||
"ml-2 text-ui-fg-subtle txt-compact-small gap-x-2 overflow-hidden", | ||
{ | ||
"inline-flex": inline, | ||
flex: !inline, | ||
}, | ||
className | ||
)} | ||
> | ||
{list.slice(0, n).map((item) => { | ||
return ( | ||
<Badge key={item} size="2xsmall"> | ||
{item} | ||
</Badge> | ||
) | ||
})} | ||
|
||
{list.length > n && ( | ||
<div className="whitespace-nowrap"> | ||
<Tooltip | ||
content={ | ||
<ul> | ||
{list.slice(n).map((c) => ( | ||
<li key={c}>{c}</li> | ||
))} | ||
</ul> | ||
} | ||
> | ||
<Badge size="2xsmall" className="cursor-default whitespace-nowrap"> | ||
{title} | ||
</Badge> | ||
</Tooltip> | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
packages/admin-next/dashboard/src/components/common/badge-list-summary/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./badge-list-summary" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.