@dfosco/storyboard 0.9.2 → 0.9.3
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.
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ import { useState, useEffect, useMemo } from 'react'
|
|
|
11
11
|
import { createPortal } from 'react-dom'
|
|
12
12
|
import { GitBranchIcon } from '@primer/octicons-react'
|
|
13
13
|
import { useBranches } from './useBranches.js'
|
|
14
|
+
import ChromeSlot from '../../core/ui/ChromeSlot.jsx'
|
|
14
15
|
import css from './BranchBar.module.css'
|
|
15
16
|
|
|
16
17
|
/** Check if we're in local dev mode (respects ?prodMode simulation). */
|
|
@@ -78,28 +79,34 @@ export default function BranchBar({ basePath }) {
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
return createPortal(
|
|
81
|
-
<
|
|
82
|
-
<div
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
{
|
|
88
|
-
<span className={css.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
82
|
+
<ChromeSlot id="branch-bar:root" surface="branch-bar" ctx={{ currentBranch, isLocalDev }}>
|
|
83
|
+
<div className={css.bar} data-branch-bar>
|
|
84
|
+
<div
|
|
85
|
+
className={`${css.barInner}${isLocalDev ? '' : ` ${css.barProd}`}`}
|
|
86
|
+
style={domainColor ? { '--sb-branch-bar-bg': domainColor } : undefined}
|
|
87
|
+
>
|
|
88
|
+
<ChromeSlot id="branch-bar:label" surface="branch-bar" ctx={{ currentBranch, isLocalDev }}>
|
|
89
|
+
<span className={css.barLabel}>
|
|
90
|
+
{isLocalDev && window.__SB_DEV_DOMAIN__ && <>
|
|
91
|
+
<span className={css.barDomainName}>⌘ {window.__SB_DEV_DOMAIN__}</span>
|
|
92
|
+
<span className={css.barSeparator}>·</span>
|
|
93
|
+
</>}
|
|
94
|
+
<GitBranchIcon size={12} />
|
|
95
|
+
<span className={css.barBranchName}>{currentBranch}</span>
|
|
96
|
+
{isLocalDev && <>
|
|
97
|
+
<span className={css.barSeparator}>·</span>
|
|
98
|
+
<span>Local development</span>
|
|
99
|
+
</>}
|
|
100
|
+
</span>
|
|
101
|
+
</ChromeSlot>
|
|
102
|
+
<div className={css.barActions}>
|
|
103
|
+
<ChromeSlot id="branch-bar:hide-button" surface="branch-bar" ctx={{ currentBranch, isLocalDev }}>
|
|
104
|
+
<button className={css.barAction} onClick={hideChrome}>Hide</button>
|
|
105
|
+
</ChromeSlot>
|
|
106
|
+
</div>
|
|
100
107
|
</div>
|
|
101
108
|
</div>
|
|
102
|
-
</
|
|
109
|
+
</ChromeSlot>,
|
|
103
110
|
portalContainer
|
|
104
111
|
)
|
|
105
112
|
}
|