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

Commit 0b9089b

Browse files
clean up and match styles on buttons
1 parent ec1a8ac commit 0b9089b

File tree

7 files changed

+48
-45
lines changed

7 files changed

+48
-45
lines changed

client/web/src/repo/RepoHeader.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class RepoHeaderContributionStore {
2929
constructor(
3030
/** The common ancestor component's setState method. */
3131
private setState: (callback: (previousState: RepoHeaderContribution[]) => RepoHeaderContribution[]) => void
32-
) { }
32+
) {}
3333

3434
private onRepoHeaderContributionAdd(item: RepoHeaderContribution): void {
3535
if (!item.children || typeof item.children !== 'function') {
@@ -115,7 +115,7 @@ export interface RepoHeaderContext {
115115
actionType: 'nav' | 'dropdown'
116116
}
117117

118-
export interface RepoHeaderActionButton extends ActionButtonDescriptor<RepoHeaderContext> { }
118+
export interface RepoHeaderActionButton extends ActionButtonDescriptor<RepoHeaderContext> {}
119119

120120
interface Props extends PlatformContextProps, TelemetryProps, BreadcrumbsProps {
121121
/**
@@ -168,10 +168,6 @@ export const RepoHeader: React.FunctionComponent<React.PropsWithChildren<Props>>
168168
onLifecyclePropsChange(repoHeaderContributionStore.props)
169169
}, [onLifecyclePropsChange, repoHeaderContributionStore.props])
170170

171-
// useEffect(() => {
172-
// console.log(props.breadcrumbs)
173-
// }, [])
174-
175171
const context: Omit<RepoHeaderContext, 'actionType'> = useMemo(
176172
() => ({
177173
repoName: props.repoName,

client/web/src/repo/RepoRevisionSidebar.module.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
height: 2rem;
1616
z-index: 1;
1717
isolation: isolate;
18-
border-bottom-left-radius: 0;
19-
border-top-left-radius: 0;
2018
color: var(--icon-color);
2119
background-color: var(--body-bg);
2220

client/web/src/repo/RepoRevisionSidebar.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ export const RepoRevisionSidebar: FC<RepoRevisionSidebarProps> = props => {
8787
<Button
8888
aria-label="Hide sidebar"
8989
variant="icon"
90-
className={classNames(
91-
'position-absolute border mr-2 mb-1',
92-
styles.toggle
93-
)}
90+
className={classNames('position-absolute border mr-2', styles.toggle)}
9491
onClick={() => props.handleSidebarToggle(false)}
9592
>
9693
<Icon aria-hidden={true} svgPath={mdiPageLayoutSidebarRight} />
@@ -113,9 +110,7 @@ export const RepoRevisionSidebar: FC<RepoRevisionSidebarProps> = props => {
113110
// position, which tree is expanded)
114111
behavior="memoize"
115112
>
116-
<TabList
117-
wrapperClassName="mr-3 ml-5"
118-
>
113+
<TabList wrapperClassName="mr-3 ml-5">
119114
<Tab data-tab-content="files">
120115
<span className="tablist-wrapper--tab-label">Files</span>
121116
</Tab>
@@ -161,8 +156,7 @@ export const RepoRevisionSidebar: FC<RepoRevisionSidebarProps> = props => {
161156
</Tabs>
162157
</div>
163158
</Panel>
164-
)
165-
}
159+
)}
166160

167161
{enableBlobPageSwitchAreasShortcuts && (
168162
<>

client/web/src/repo/RepositoryFileTreePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { FC, useCallback, useState } from 'react'
22

33
import { Navigate, useLocation } from 'react-router-dom'
44

5-
import settingsSchemaJSON from '../../../../schema/settings.schema.json'
65
import { appendLineRangeQueryParameter } from '@sourcegraph/common'
76
import { TraceSpanProvider } from '@sourcegraph/observability-client'
87
import { getModeFromPath } from '@sourcegraph/shared/src/languages'
98
import { isLegacyFragment, parseQueryAndHash, toRepoURL } from '@sourcegraph/shared/src/util/url'
109
import { LoadingSpinner, useLocalStorage, useMatchMedia } from '@sourcegraph/wildcard'
1110

11+
import settingsSchemaJSON from '../../../../schema/settings.schema.json'
1212
import { ErrorBoundary } from '../components/ErrorBoundary'
1313
import type { SourcegraphContext } from '../jscontext'
1414
import type { NotebookProps } from '../notebooks'

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,20 @@ const RenderedNotebookMarkdown = lazyComponent(() => import('./RenderedNotebookM
9191

9292
interface BlobPageProps
9393
extends RepoFile,
94-
ModeSpec,
95-
RepoHeaderContributionsLifecycleProps,
96-
SettingsCascadeProps,
97-
PlatformContextProps,
98-
TelemetryProps,
99-
ExtensionsControllerProps,
100-
HoverThresholdProps,
101-
BreadcrumbSetters,
102-
SearchStreamingProps,
103-
Pick<SearchContextProps, 'searchContextsEnabled'>,
104-
Pick<StreamingSearchResultsListProps, 'fetchHighlightedFileLineRanges'>,
105-
Pick<CodeIntelligenceProps, 'codeIntelligenceEnabled' | 'useCodeIntel'>,
106-
NotebookProps,
107-
OwnConfigProps {
94+
ModeSpec,
95+
RepoHeaderContributionsLifecycleProps,
96+
SettingsCascadeProps,
97+
PlatformContextProps,
98+
TelemetryProps,
99+
ExtensionsControllerProps,
100+
HoverThresholdProps,
101+
BreadcrumbSetters,
102+
SearchStreamingProps,
103+
Pick<SearchContextProps, 'searchContextsEnabled'>,
104+
Pick<StreamingSearchResultsListProps, 'fetchHighlightedFileLineRanges'>,
105+
Pick<CodeIntelligenceProps, 'codeIntelligenceEnabled' | 'useCodeIntel'>,
106+
NotebookProps,
107+
OwnConfigProps {
108108
authenticatedUser: AuthenticatedUser | null
109109
isMacPlatform: boolean
110110
isSourcegraphDotCom: boolean
@@ -298,7 +298,7 @@ export const BlobPage: React.FunctionComponent<BlobPageProps> = ({ className, co
298298

299299
const blobInfoOrError = enableLazyBlobSyntaxHighlighting
300300
? // Fallback to formatted blob whilst we do not have the highlighted blob
301-
highlightedBlobInfoOrError || formattedBlobInfoOrError
301+
highlightedBlobInfoOrError || formattedBlobInfoOrError
302302
: highlightedBlobInfoOrError
303303

304304
const onExtendTimeoutClick = useCallback(
@@ -324,9 +324,9 @@ export const BlobPage: React.FunctionComponent<BlobPageProps> = ({ className, co
324324

325325
const isSearchNotebook = Boolean(
326326
blobInfoOrError &&
327-
!isErrorLike(blobInfoOrError) &&
328-
blobInfoOrError.filePath.endsWith(SEARCH_NOTEBOOK_FILE_EXTENSION) &&
329-
props.notebooksEnabled
327+
!isErrorLike(blobInfoOrError) &&
328+
blobInfoOrError.filePath.endsWith(SEARCH_NOTEBOOK_FILE_EXTENSION) &&
329+
props.notebooksEnabled
330330
)
331331

332332
const onCopyNotebook = useCallback(

client/web/src/repo/blob/own/HistoryAndOwnBar.module.scss

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
.history-panel {
1313
padding: 0;
1414
display: flex;
15-
align-items: stretch;
15+
align-items: center;
1616
vertical-align: middle;
1717
font-weight: normal;
1818
letter-spacing: normal;
@@ -28,11 +28,28 @@
2828

2929
.history {
3030
min-width: 0;
31+
justify-content: center;
3132
padding: 0;
3233
font-size: 0.75rem;
3334
flex-shrink: 1000000; // Very high value to shrink this before shrinking the ownership side.
3435
}
3536

37+
.toggle {
38+
display: flex;
39+
justify-content: center;
40+
left: 0;
41+
width: 2rem;
42+
height: 2rem;
43+
z-index: 1;
44+
isolation: isolate;
45+
color: var(--icon-color);
46+
background-color: var(--body-bg);
47+
48+
&:hover {
49+
background-color: var(--color-bg-3);
50+
}
51+
}
52+
3653
.own {
3754
padding: 0;
3855
display: flex;

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,12 @@ export const HistoryAndOwnBar: React.FunctionComponent<{
8989
{history && (
9090
<div className={styles.historyPanel}>
9191
{!sidebarOpen && (
92-
<Tooltip content="Hide sidebar" placement="right">
92+
<Tooltip content="Show sidebar" placement="right">
9393
<Button
94-
aria-label="Hide sidebar"
94+
aria-label="Show sidebar"
9595
variant="icon"
96-
className={classNames(
97-
'p-2 border mr-2 hover:bg-gray',
98-
// styles.toggle
99-
)}
96+
className={classNames(styles.toggle, 'border mr-2 mb-1')}
97+
display="inline"
10098
onClick={() => handleSidebarToggle(true)}
10199
>
102100
<Icon aria-hidden={true} svgPath={mdiPageLayoutSidebarLeft} />
@@ -108,13 +106,13 @@ export const HistoryAndOwnBar: React.FunctionComponent<{
108106
node={history}
109107
extraCompact={true}
110108
hideExpandCommitMessageBody={true}
111-
className={styles.history}
109+
className={classNames(sidebarOpen ? '' : 'mb-1', styles.history)}
112110
/>
113111
<Button
114112
variant="link"
115113
size="sm"
116114
display="inline"
117-
className="pt-0 pb-0 border-0"
115+
className={styles.history}
118116
onClick={openHistoryPanel}
119117
>
120118
Show history

0 commit comments

Comments
 (0)