Skip to content

Commit fff4d9c

Browse files
author
cvluca
committed
fix layout
1 parent e448f4a commit fff4d9c

File tree

1 file changed

+36
-20
lines changed

1 file changed

+36
-20
lines changed

src/components/Layout/Layout.js

+36-20
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,42 @@ class Layout extends Component {
7373
}
7474
</Row>
7575
</AntdLayout.Header>
76-
{ !sidebarHide && !matches && onPostPage &&
77-
<AntdLayout.Sider>
78-
<ResponsiveSidebar/>
79-
</AntdLayout.Sider>
80-
}
81-
<AntdLayout.Content
82-
style={{
83-
position: "absolute",
84-
left: (sidebarHide || matches) ? 0 : "20%",
85-
right: (anchorHide || matches) ? 0 : "15%",
86-
}}
87-
>
88-
<Container sidebarDocked={!matches} onPostPage={onPostPage}>
89-
{children}
90-
</Container>
91-
</AntdLayout.Content>
92-
{ !anchorHide && !matches && onPostPage &&
93-
<AntdLayout.Sider>
94-
<ResponsiveAnchor />
95-
</AntdLayout.Sider>
76+
{(!matches && onPostPage) ?
77+
<AntdLayout>
78+
{!sidebarHide &&
79+
<AntdLayout.Sider>
80+
<ResponsiveSidebar/>
81+
</AntdLayout.Sider>
82+
}
83+
<AntdLayout.Content
84+
style={{
85+
position: "absolute",
86+
left: "20%",
87+
right: "15%",
88+
}}
89+
>
90+
<Container sidebarDocked={!matches} onPostPage={onPostPage}>
91+
{children}
92+
</Container>
93+
</AntdLayout.Content>
94+
{!anchorHide &&
95+
<AntdLayout.Sider>
96+
<ResponsiveAnchor />
97+
</AntdLayout.Sider>
98+
}
99+
</AntdLayout>
100+
:
101+
<AntdLayout.Content
102+
style={{
103+
position: "absolute",
104+
left: 0,
105+
right: 0,
106+
}}
107+
>
108+
<Container sidebarDocked={!matches} onPostPage={onPostPage}>
109+
{children}
110+
</Container>
111+
</AntdLayout.Content>
96112
}
97113
</AntdLayout>
98114
</>)

0 commit comments

Comments
 (0)