Skip to content

Commit

Permalink
fix: sidebar position fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidZORO committed Jun 23, 2020
1 parent 64e7724 commit 5d39d2a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ interface IProps {
export const SubmitBar = (props: IProps) => (
<div
className={cx(
style['wrapper'],
style['submit-bar-wrapper'],
props.className,
{
[style['wrapper--full']]: props.full,
[style['submit-bar-wrapper--full']]: props.full,
},
'g-wrapper--full',
'g-submit-bar-wrapper--full',
)}
>
<div className={style['container']}>{props.children}</div>
<div className={style['submit-bar-container']}>{props.children}</div>
</div>
);
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@import '~@leaa/dashboard/src/styles/variables.less';

.wrapper {
.submit-bar-wrapper {
position: relative;
display: block;
}

.container {
.submit-bar-container {
padding-top: 5px;
margin-bottom: 50px;

Expand All @@ -20,15 +20,15 @@
}
}

.wrapper--full {
.submit-bar-wrapper--full {
position: fixed;
bottom: 0;
left: 0;
right: 0;
transition: all 0.3s;
z-index: 99;

.container {
.submit-bar-container {
padding: 18px;
text-align: center;
background: #fffd;
Expand All @@ -39,20 +39,20 @@

:global {
.g-full-layout-wrapper--mb {
.g-wrapper--full {
.g-submit-bar-wrapper--full {
margin-left: 0;
}
}

.g-full-layout-wrapper--pc {
.g-wrapper--full {
margin-left: 200px;
.g-submit-bar-wrapper--full {
margin-left: @layout-sidebar-width--pc;
}
}

.siderbar-collapsed {
:local {
.wrapper--full {
.submit-bar-wrapper--full {
margin-left: 0;
transition: all 0.3s;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ export const LayoutSidebar = (props: IProps) => {
defaultCollapsed={collapsed}
collapsible
collapsedWidth={0}
className={style['full-layout-sidebar']}
id="full-layout-sidebar"
breakpoint="md"
onCollapse={(isCollapsed, type) => onCollapse(isCollapsed, type)}
trigger={null}
className={style['full-layout-sidebar']}
// breakpoint="md"
>
{!isMobile && (
<div className={style['logo-wrapper']}>
Expand Down Expand Up @@ -125,8 +124,6 @@ export const LayoutSidebar = (props: IProps) => {

const onCallbackSidebarTarget = () => (isMobile ? setDrawer(true) : onCollapse(collapsed, 'clickTrigger'));

console.log(isMobile);

return (
<div className={cx(style['full-layout-sidebar-wrapper'], 'g-full-layout-sidebar-wrapper')}>
<div className={cx(style['target-button-wrapper'], 'target-button-wrapper')}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
}

.full-layout-sidebar-wrapper {
//display: none;
transition: all 0.3s;
transition: all 0.2s;
position: relative;
//height: 100vh;
}

.full-layout-sidebar {
position: relative;
transition: all 0.2s;
position: fixed;
top: 0;
left: 0;
height: 100vh;
overflow-y: auto;
}

.logo-wrapper {
Expand Down Expand Up @@ -153,7 +158,7 @@
}

.ant-layout-sider {
background: transparent;
//background: transparent;
}

.ant-menu-item-selected {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

.full-layout-wrapper {
position: relative;

@media (min-width: @screen-md) {
margin-left: @layout-sidebar-width--pc;
}
}

.full-layout-inner {
Expand Down
1 change: 1 addition & 0 deletions packages/leaa-dashboard/src/styles/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//@page-layout-bg-color: #f6f8fa;
@page-layout-bg-color: #f0f4fa;
@container-ext-width: 280px;
@layout-sidebar-width--pc: 200px;

//
// ANTD
Expand Down

0 comments on commit 5d39d2a

Please sign in to comment.