@orsetra/shared-ui 1.3.5 → 1.3.7

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.
@@ -92,7 +92,7 @@ export function UserPanel({ main_base_url }: UserPanelProps) {
92
92
  </button>
93
93
  {currentProject && organization && (
94
94
  <a
95
- href={`${main_base_url}/${organization.id}/projects/${currentProject.id}`}
95
+ href={`${main_base_url}/projects/${currentProject.id}`}
96
96
  onClick={close}
97
97
  className="text-xs text-[#0f62fe] hover:underline"
98
98
  >
@@ -17,8 +17,10 @@ export interface DetailPageHeaderTab {
17
17
  }
18
18
 
19
19
  export interface DetailPageHeaderProps {
20
- /** If provided, renders a secondary Back button on the right that calls history.back() */
20
+ /** If provided, renders a secondary Back button. Clicks navigate to backHref if set, otherwise history.back() */
21
21
  backText?: string
22
+ /** Optional explicit back destination. If absent, the back button uses history.back() */
23
+ backHref?: string
22
24
  /** Optional icon rendered in a blue square container */
23
25
  icon?: ReactNode
24
26
  /** Page title */
@@ -41,6 +43,7 @@ export interface DetailPageHeaderProps {
41
43
 
42
44
  export function DetailPageHeader({
43
45
  backText,
46
+ backHref,
44
47
  icon,
45
48
  title,
46
49
  description,
@@ -76,14 +79,26 @@ export function DetailPageHeader({
76
79
  {(backText || actions) && (
77
80
  <div className="flex items-center gap-2 shrink-0">
78
81
  {backText && (
79
- <Button
80
- variant="secondary"
81
- className="h-9"
82
- leftIcon={<ArrowLeft className="h-4 w-4" />}
83
- onClick={() => window.history.back()}
84
- >
85
- {backText}
86
- </Button>
82
+ backHref ? (
83
+ <Link href={backHref}>
84
+ <Button
85
+ variant="secondary"
86
+ className="h-9"
87
+ leftIcon={<ArrowLeft className="h-4 w-4" />}
88
+ >
89
+ {backText}
90
+ </Button>
91
+ </Link>
92
+ ) : (
93
+ <Button
94
+ variant="secondary"
95
+ className="h-9"
96
+ leftIcon={<ArrowLeft className="h-4 w-4" />}
97
+ onClick={() => window.history.back()}
98
+ >
99
+ {backText}
100
+ </Button>
101
+ )
87
102
  )}
88
103
  {actions}
89
104
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orsetra/shared-ui",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "Shared UI components for Orsetra platform",
5
5
  "main": "./index.ts",
6
6
  "types": "./index.ts",