Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit ec1a8ac

Browse files
sidebar icon in blob header not visible if sidebar open
1 parent 3f647d2 commit ec1a8ac

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

client/web/src/repo/RepoRevisionSidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const RepoRevisionSidebar: FC<RepoRevisionSidebarProps> = props => {
8888
aria-label="Hide sidebar"
8989
variant="icon"
9090
className={classNames(
91-
'position-absolute border mr-2',
91+
'position-absolute border mr-2 mb-1',
9292
styles.toggle
9393
)}
9494
onClick={() => props.handleSidebarToggle(false)}

client/web/src/repo/RepositoryFileTreePage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export const RepositoryFileTreePage: FC<RepositoryFileTreePageProps> = props =>
132132
fetchHighlightedFileLineRanges={props.fetchHighlightedFileLineRanges}
133133
className={styles.pageContent}
134134
context={globalContext}
135+
sidebarOpen={isVisible}
135136
handleSidebarToggle={handleSidebarToggle}
136137
/>
137138
</TraceSpanProvider>

client/web/src/repo/blob/BlobPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ interface BlobPageProps
111111
repoID?: Scalars['ID']
112112
repoUrl?: string
113113
repoServiceType?: string
114+
sidebarOpen: boolean
114115
handleSidebarToggle: (value: boolean) => void
115116

116117
fetchHighlightedFileLineRanges: (parameters: FetchFileParameters, force?: boolean) => Observable<string[][]>
@@ -455,6 +456,7 @@ export const BlobPage: React.FunctionComponent<BlobPageProps> = ({ className, co
455456
revision={revision}
456457
filePath={filePath}
457458
enableOwnershipPanel={enableOwnershipPanel}
459+
sidebarOpen={props.sidebarOpen}
458460
handleSidebarToggle={props.handleSidebarToggle}
459461
/>
460462
)}

client/web/src/repo/blob/own/HistoryAndOwnBar.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ export const HistoryAndOwnBar: React.FunctionComponent<{
2323
revision?: string
2424
filePath: string
2525
enableOwnershipPanel: boolean
26+
sidebarOpen: boolean
2627
handleSidebarToggle: (value: boolean) => void
27-
}> = ({ repoID, revision, filePath, enableOwnershipPanel, handleSidebarToggle }) => {
28+
}> = ({ repoID, revision, filePath, enableOwnershipPanel, sidebarOpen, handleSidebarToggle }) => {
2829
const navigate = useNavigate()
2930

3031
const openOwnershipPanel = useCallback(() => {
@@ -87,19 +88,22 @@ export const HistoryAndOwnBar: React.FunctionComponent<{
8788
<div className={styles.wrapper}>
8889
{history && (
8990
<div className={styles.historyPanel}>
90-
<Tooltip content="Hide sidebar" placement="right">
91-
<Button
92-
aria-label="Hide sidebar"
93-
variant="icon"
94-
className={classNames(
95-
'border mr-2',
96-
// styles.toggle
97-
)}
98-
onClick={() => handleSidebarToggle(true)}
99-
>
100-
<Icon aria-hidden={true} svgPath={mdiPageLayoutSidebarLeft} />
101-
</Button>
102-
</Tooltip>
91+
{!sidebarOpen && (
92+
<Tooltip content="Hide sidebar" placement="right">
93+
<Button
94+
aria-label="Hide sidebar"
95+
variant="icon"
96+
className={classNames(
97+
'p-2 border mr-2 hover:bg-gray',
98+
// styles.toggle
99+
)}
100+
onClick={() => handleSidebarToggle(true)}
101+
>
102+
<Icon aria-hidden={true} svgPath={mdiPageLayoutSidebarLeft} />
103+
</Button>
104+
</Tooltip>
105+
)}
106+
103107
<GitCommitNode
104108
node={history}
105109
extraCompact={true}

0 commit comments

Comments
 (0)