@orsetra/shared-ui 1.10.15 → 1.10.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -39,6 +39,15 @@ export interface ProjectSelectorModalProps extends ProjectSelectorProps {
|
|
|
39
39
|
title?: string
|
|
40
40
|
description?: string
|
|
41
41
|
currentProjectId?: string
|
|
42
|
+
/**
|
|
43
|
+
* Escape hatch shown next to "Create & Continue" only in the zero-business-unit state (this
|
|
44
|
+
* dialog otherwise can't be dismissed while no project is selected — see `onInteractOutside`
|
|
45
|
+
* below — so without this a user who can't or doesn't want to create one here has no way out).
|
|
46
|
+
* Omit to keep the dialog exactly as strict as before.
|
|
47
|
+
*/
|
|
48
|
+
escapeHref?: string
|
|
49
|
+
/** Label for `escapeHref`. Defaults to "Go to main app". */
|
|
50
|
+
escapeLabel?: string
|
|
42
51
|
}
|
|
43
52
|
|
|
44
53
|
export function ProjectSelectorModal({
|
|
@@ -50,6 +59,8 @@ export function ProjectSelectorModal({
|
|
|
50
59
|
getProjects,
|
|
51
60
|
createProject,
|
|
52
61
|
doInit,
|
|
62
|
+
escapeHref,
|
|
63
|
+
escapeLabel = "Go to main app",
|
|
53
64
|
}: ProjectSelectorModalProps) {
|
|
54
65
|
const [projects, setProjects] = React.useState<Project[]>([])
|
|
55
66
|
const [loading, setLoading] = React.useState(true)
|
|
@@ -213,6 +224,14 @@ export function ProjectSelectorModal({
|
|
|
213
224
|
)}
|
|
214
225
|
|
|
215
226
|
<div className="flex items-center justify-end gap-3 pt-2">
|
|
227
|
+
{!loading && projects.length === 0 && escapeHref && (
|
|
228
|
+
<a
|
|
229
|
+
href={escapeHref}
|
|
230
|
+
className="inline-flex items-center justify-center rounded-none border border-ibm-gray-30 text-ibm-gray-100 hover:bg-ibm-gray-30 active:bg-ibm-gray-40 font-semibold h-10 px-4 text-base transition-colors mr-auto"
|
|
231
|
+
>
|
|
232
|
+
{escapeLabel}
|
|
233
|
+
</a>
|
|
234
|
+
)}
|
|
216
235
|
<Button
|
|
217
236
|
type="submit"
|
|
218
237
|
className="rounded-none"
|