From 0fc9e9b2fba632d5b6e1edd5bd9e284ef58a1ad5 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 2 Sep 2021 00:05:13 -0400 Subject: [PATCH] Fix UI issues when text is long Fixes #914 --- public/content.css | 11 ++- src/components/NoticeComponent.tsx | 104 +++++++++++++------------ src/components/SkipNoticeComponent.tsx | 2 +- 3 files changed, 61 insertions(+), 56 deletions(-) diff --git a/public/content.css b/public/content.css index b2e4b1e5..a35664da 100644 --- a/public/content.css +++ b/public/content.css @@ -140,7 +140,6 @@ min-width: 350px; max-width: 50%; - border-radius: 5px; border-spacing: 5px 10px; padding-left: 5px; padding-right: 5px; @@ -148,9 +147,14 @@ border-collapse: unset; } -.sponsorSkipNotice { - min-width: 350px; +.sponsorSkipNoticeTableContainer { background-color: rgba(28, 28, 28, 0.9); + border-radius: 5px; + min-width: 100%; +} + +.sponsorSkipNotice { + min-width: calc(100% - 50px); transition: all 0.1s ease-out; } @@ -311,7 +315,6 @@ .sponsorTimesInfoMessage { font-size: 13.3333px; color: rgb(235, 235, 235); - text-align: center; } .voteButton { diff --git a/src/components/NoticeComponent.tsx b/src/components/NoticeComponent.tsx index 4c088258..68c01d05 100644 --- a/src/components/NoticeComponent.tsx +++ b/src/components/NoticeComponent.tsx @@ -102,65 +102,67 @@ class NoticeComponent extends React.Component { onMouseEnter={(e) => this.onMouseEnter(e) } onMouseLeave={() => this.timerMouseLeave()} style={noticeStyle} > - - + + (this.state.startFaded ? " sponsorSkipNoticeFaded" : "") }> +
+ - {/* First row */} - - {/* Left column */} - - - {this.props.firstRow} - - {/* Right column */} - + {/* Left column */} + - + {this.props.firstColumn} + - {this.props.children} + {this.props.firstRow} - {!this.props.smaller && this.props.bottomRow ? - this.props.bottomRow - : null} + {/* Right column */} + -
- {/* Logo */} - - - - - - {this.state.noticeTitle} - - - {this.props.firstColumn} - - - {/* Time left */} - {this.props.timed ? ( - this.toggleManualPause()} - className="sponsorSkipObject sponsorSkipNoticeTimeLeft"> - - {this.getCountdownElements()} + {/* First row */} +
+ {/* Logo */} + + + + + {this.state.noticeTitle} - ) : ""} - - {/* Close button */} - this.close()}> - -
+ + {/* Time left */} + {this.props.timed ? ( + this.toggleManualPause()} + className="sponsorSkipObject sponsorSkipNoticeTimeLeft"> -
+ {this.getCountdownElements()} + + + ) : ""} + + + {/* Close button */} + this.close()}> + + + + + {this.props.children} + + {!this.props.smaller && this.props.bottomRow ? + this.props.bottomRow + : null} + + + + {/* Add as a hidden table to keep the height constant */} {this.props.smaller && this.props.bottomRow ? diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 0af1efad..bacb2b84 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -82,7 +82,7 @@ class SkipNoticeComponent extends React.Component