Skip to content

Commit

Permalink
Fix: permanent notification (#1333)
Browse files Browse the repository at this point in the history
Why
When the permanent notification is displayed, a vertical scroll bar
is always displayed because the height of the window is more than
100%

What
Adjust app-container height when the permanent notification is visible
  • Loading branch information
Antonio-Maranhao committed Jan 28, 2022
1 parent 9fc82fb commit 01ebc86
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
11 changes: 8 additions & 3 deletions app/addons/fauxton/appwrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class App extends React.Component {
const mainClass = classNames(
{'closeMenu': this.props.isPrimaryNavMinimized}
);
const appContainerClass = classNames(
{'app-container__with-perm-notification': this.props.isPermanentNotificationShowing}
);
return (
<div>
<ToastContainer
Expand All @@ -96,7 +99,7 @@ class App extends React.Component {
<NotificationPanelContainer />
</div>
<div id="main" className={mainClass}>
<div id="app-container">
<div id="app-container" className={appContainerClass}>
<div className="wrapper">
<div role="main" className="pusher">
<ContentWrapper router={this.props.router} setNavbarActiveLink={this.props.setNavbarActiveLink}/>
Expand All @@ -113,9 +116,11 @@ class App extends React.Component {
}

export default connect(
({ navigation }) => {
({ navigation, notifications }) => {
return {
isPrimaryNavMinimized: navigation.isMinimized};
isPrimaryNavMinimized: navigation.isMinimized,
isPermanentNotificationShowing: notifications.permanentNotificationVisible,
};
},
(dispatch) => {
return {
Expand Down
16 changes: 11 additions & 5 deletions app/addons/fauxton/assets/less/components.less
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,19 @@ button.clipboard-copy-element {

#perma-warning {
background-color: white;
height: 3.5rem;
border-bottom-style: solid;
border-width: 2px;
border-top-style: solid;
border-color: #B11925;
overflow-y: auto;
}

.perma-warning__content {
margin: 4px;
padding: 10px;
margin: 0rem;
padding: 0.5rem 1rem 0.5rem 1rem;
color: #B11925;
outline-style: solid;
outline-color: #B11925;
outline-width: 4px;
top: 50%;
transform: translateY(-50%);
position: relative;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ export default class PermanentNotification extends React.Component {
}

getContent () {
if (!this.props.visible || !this.props.message) {
return null;
}
return (
<p className="perma-warning__content" dangerouslySetInnerHTML={this.getMsg()}></p>
);
}

render () {
if (!this.props.visible || !this.props.message) {
return null;
}
return (
<div id="perma-warning">
{this.getContent()}
Expand Down
4 changes: 4 additions & 0 deletions assets/less/templates.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
height: 100vh;
position: relative;
overflow: hidden;

&.app-container__with-perm-notification {
height: calc(100vh - 3.5rem);
}
}

@media screen and (max-height: 600px) {
Expand Down

0 comments on commit 01ebc86

Please sign in to comment.