Skip to content

Commit

Permalink
Improve UX when loading zones
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoColomb committed Aug 14, 2023
1 parent b8659e8 commit 03932b7
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions pages/app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,35 @@ export default function Index() {
</select>
}
>
{(routingZones: Zone[]) => (
<select
id="zone"
name="zone"
aria-label="Address domain"
required
>
{routingZones.map((zone) => (
<option value={JSON.stringify(zone)} key={zone.id}>
{zone.name}
{(routingZones: Zone[]) =>
routingZones.length ? (
<select
id="zone"
name="zone"
aria-label="Address domain"
required
>
{routingZones.map((zone) => (
<option value={JSON.stringify(zone)} key={zone.id}>
{zone.name}
</option>
))}
</select>
) : (
<select
id="zone"
name="zone"
aria-label="Address domain"
defaultValue=""
aria-invalid="true"
required
>
<option value="">
Unable to find a domain for email routing
</option>
))}
</select>
)}
</select>
)
}
</Await>
</Suspense>
</label>
Expand Down

0 comments on commit 03932b7

Please sign in to comment.