Revert tips by amount on hyper chat banner (#877)
This commit is contained in:
parent
60d9acfa55
commit
381200800e
1 changed files with 9 additions and 5 deletions
|
@ -83,8 +83,12 @@ export default function LivestreamChatLayout(props: Props) {
|
||||||
const [superchatsAmount, setSuperchatsAmount] = React.useState(false);
|
const [superchatsAmount, setSuperchatsAmount] = React.useState(false);
|
||||||
const [chatElement, setChatElement] = React.useState();
|
const [chatElement, setChatElement] = React.useState();
|
||||||
|
|
||||||
const superChatsByChronologicalOrder =
|
let superChatsByChronologicalOrder = [];
|
||||||
superChatsByAmount && superChatsByAmount.sort((a, b) => b.timestamp - a.timestamp);
|
if (superChatsByAmount) superChatsByAmount.forEach((chat) => superChatsByChronologicalOrder.push(chat));
|
||||||
|
if (superChatsByChronologicalOrder.length > 0) {
|
||||||
|
superChatsByChronologicalOrder.sort((a, b) => b.timestamp - a.timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
const commentsToDisplay =
|
const commentsToDisplay =
|
||||||
viewMode === VIEW_MODES.CHAT ? commentsByChronologicalOrder : superChatsByChronologicalOrder;
|
viewMode === VIEW_MODES.CHAT ? commentsByChronologicalOrder : superChatsByChronologicalOrder;
|
||||||
const commentsLength = commentsToDisplay && commentsToDisplay.length;
|
const commentsLength = commentsToDisplay && commentsToDisplay.length;
|
||||||
|
@ -291,13 +295,13 @@ export default function LivestreamChatLayout(props: Props) {
|
||||||
'livestream-comments__top-actions--mobile': isMobile,
|
'livestream-comments__top-actions--mobile': isMobile,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{isMobile && ((pinnedComment && showPinned) || (superChatsByChronologicalOrder && !superchatsHidden)) && (
|
{isMobile && ((pinnedComment && showPinned) || (superChatsByAmount && !superchatsHidden)) && (
|
||||||
<MobileDrawerTopGradient theme={theme} />
|
<MobileDrawerTopGradient theme={theme} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{viewMode === VIEW_MODES.CHAT && superChatsByChronologicalOrder && (
|
{viewMode === VIEW_MODES.CHAT && superChatsByAmount && (
|
||||||
<LivestreamSuperchats
|
<LivestreamSuperchats
|
||||||
superChats={superChatsByChronologicalOrder}
|
superChats={superChatsByAmount}
|
||||||
toggleSuperChat={toggleSuperChat}
|
toggleSuperChat={toggleSuperChat}
|
||||||
superchatsHidden={superchatsHidden}
|
superchatsHidden={superchatsHidden}
|
||||||
isMobile={isMobile}
|
isMobile={isMobile}
|
||||||
|
|
Loading…
Reference in a new issue