fix content height is missconfigurated when a profile has no cover

This commit is contained in:
srgooglo 2022-10-06 11:58:47 +02:00
parent e82a2571b1
commit c5d1211e6c

View File

@ -206,6 +206,10 @@ export default class Account extends React.Component {
} }
handleScroll = (e) => { handleScroll = (e) => {
if (!this.state.user?.cover) {
return false
}
// if component scrolled foward set cover height to 0 // if component scrolled foward set cover height to 0
if (e.target.scrollTop > 0) { if (e.target.scrollTop > 0) {
this.coverComponent.current.style.height = "0px" this.coverComponent.current.style.height = "0px"
@ -288,7 +292,13 @@ export default class Account extends React.Component {
</div> </div>
</div> </div>
<div ref={this.contentRef} className="contents" onScroll={this.handleScroll}> <div
ref={this.contentRef}
className="contents"
onScroll={this.handleScroll}
style={{ height: !this.state.user?.cover ? "100vh" : undefined }}
>
<div className="tabMenuWrapper"> <div className="tabMenuWrapper">
<antd.Menu <antd.Menu
className="tabMenu" className="tabMenu"