fix(dashboard): campaign fixes (#9082)

**What**
- fix campaign dropdown placeholder
- fix create campaign broken modal

---

![Screenshot 2024-09-10 at 14 23 55](https://github.com/user-attachments/assets/279451ec-72f4-49be-8d70-d18bc87e7fc3)

---

FIXES CC-112
This commit is contained in:
Frane Polić
2024-09-10 15:21:06 +02:00
committed by GitHub
parent 3593bdfebe
commit 3e7d4ddcd5
3 changed files with 23 additions and 2 deletions

View File

@@ -1714,7 +1714,11 @@
"campaign": {
"existing": {
"title": "Existing Campaign",
"description": "Add promotion to an existing campaign."
"description": "Add promotion to an existing campaign.",
"placeholder": {
"title": "No existing campaigns",
"desc": "You can create one to track multiple promotions and set budget limits."
}
},
"new": {
"title": "New Campaign",

View File

@@ -78,7 +78,10 @@ export const CreateCampaignForm = () => {
return (
<RouteFocusModal.Form form={form}>
<form onSubmit={handleSubmit} className="flex flex-col overflow-hidden">
<form
onSubmit={handleSubmit}
className="flex size-full flex-col overflow-hidden"
>
<RouteFocusModal.Header />
<RouteFocusModal.Body className="flex size-full flex-col items-center overflow-auto py-16">
<CreateCampaignFormFields form={form} />

View File

@@ -110,6 +110,20 @@ export const AddCampaignPromotionFields = ({
</Select.Trigger>
<Select.Content>
{!campaigns.length && (
<div className="flex h-[120px] flex-col items-center justify-center gap-2 p-2">
<span className="txt-small text-ui-fg-subtle font-medium">
{t(
"promotions.form.campaign.existing.placeholder.title"
)}
</span>
<span className="txt-small text-ui-fg-muted">
{t(
"promotions.form.campaign.existing.placeholder.desc"
)}
</span>
</div>
)}
{campaigns.map((c) => (
<Select.Item key={c.id} value={c.id}>
{c.name?.toUpperCase()}