Skip to content

Commit

Permalink
Add header and style
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmooney committed Oct 30, 2024
1 parent eb753bb commit 458f112
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 19 deletions.
40 changes: 22 additions & 18 deletions src/components/SubModuleMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
nameClass,
wrapperClass
} from '../style/BranchMenu';
import { subModuleHeaderStyle } from '../style/SubModuleMenuStyle';
import { desktopIcon } from '../style/icons';
import { Git, IGitExtension } from '../tokens';

Expand Down Expand Up @@ -75,24 +76,27 @@ export class SubModuleMenu extends React.Component<
const subModules = this.props.subModules;

return (
<FixedSizeList
height={Math.min(
Math.max(MIN_HEIGHT, subModules.length * ITEM_HEIGHT),
MAX_HEIGHT
)}
itemCount={subModules.length}
itemData={subModules}
itemKey={(index, data) => data[index].name}
itemSize={ITEM_HEIGHT}
style={{
overflowX: 'hidden',
paddingTop: 0,
paddingBottom: 0
}}
width={'auto'}
>
{this._renderItem}
</FixedSizeList>
<>
<div className={subModuleHeaderStyle}>SubModules</div>
<FixedSizeList
height={Math.min(
Math.max(MIN_HEIGHT, subModules.length * ITEM_HEIGHT),
MAX_HEIGHT
)}
itemCount={subModules.length}
itemData={subModules}
itemKey={(index, data) => data[index].name}
itemSize={ITEM_HEIGHT}
style={{
overflowX: 'hidden',
paddingTop: 0,
paddingBottom: 0
}}
width={'auto'}
>
{this._renderItem}
</FixedSizeList>
</>
);
}

Expand Down
1 change: 0 additions & 1 deletion src/components/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export interface IToolbarProps {
/**
* Current list of submodules
*/

subModules: Git.ISubModule[];
}

Expand Down
12 changes: 12 additions & 0 deletions src/style/SubModuleMenuStyle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { style } from 'typestyle';

export const subModuleHeaderStyle = style({
padding: '4px 4px 1px',
margin: '0 6px',
fontWeight: 600,
letterSpacing: '1px',
fontSize: '12px',
overflowY: 'hidden',
borderBottom: '3px solid var(--jp-brand-color1)',
height: '16px'
});

0 comments on commit 458f112

Please sign in to comment.