Skip to content

Commit

Permalink
fix: sidebar fixed position width
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jun 10, 2020
1 parent 878d2ff commit 3672ade
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ui/app-components/src/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const Sidebar: FC<SidebarProps & BoxProps> = ({
sx={{
position: !responsive ? 'fixed' : undefined,
height: '100vh',
width: 'inherit',
width,
overflowY: 'auto',
a: {
'&.active': {
Expand Down
4 changes: 2 additions & 2 deletions ui/app/src/DocPage/DocPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const BasePage: FC<DocPageProps> = ({ pagesFn }) => {
0,
);
return (
<Flex sx={{ flex: '1 0 auto' }}>
<Box sx={{ flex: '1 0 auto' }}>
<Sidebar />
<Box sx={{ flexGrow: 1 }} id="content">
<Tabs
Expand Down Expand Up @@ -67,7 +67,7 @@ export const BasePage: FC<DocPageProps> = ({ pagesFn }) => {
</Tabs>
</Box>
<SideContext pageRef={pageRef} />
</Flex>
</Box>
);
};

Expand Down
2 changes: 1 addition & 1 deletion ui/app/src/SideContext/SideContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const SideContext: FC<SideContext> = ({ pageRef }) => {
<SidebarContext.Consumer>
{({ SidebarClose, SidebarToggle, collapsed, responsive }) => (
<div>
<AppSidebar width={300} minWidth={250} id="contextbar">
<AppSidebar width={300} id="contextbar">
{responsive && (
<Header shadow={false}>
<SidebarClose />
Expand Down
7 changes: 5 additions & 2 deletions ui/app/src/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export const SidebarBase: FC<SidebarProps> = ({
const { SidebarClose, responsive } = useContext(SidebarContext);
const { storeProvider } = useContext(BlockContext);
const config = storeProvider.config;
const { siteTitle } = config || {};
const { pages = {} } = config || {};
const { label = '' } = pages[type];
const menuItems = useMemo(() => {
if (storeProvider) {
const docs: Pages = storeProvider.getPageList(type);
Expand Down Expand Up @@ -110,7 +111,9 @@ export const SidebarBase: FC<SidebarProps> = ({
</Header>
)}
<Flex sx={{ px: 2, flexDirection: 'column' }}>
<Heading as="h3">{propsTitle || siteTitle}</Heading>
<Heading as="h3" sx={{ textAlign: 'center', py: 2 }}>
{propsTitle || label}
</Heading>
<Box sx={{ py: 2, px: 3 }}>
<Input
placeholder="filter stories..."
Expand Down

0 comments on commit 3672ade

Please sign in to comment.