Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-22757 Fix for date toast placement in web mobile view #5090

Merged
merged 8 commits into from
Mar 25, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
* Use className utility
  • Loading branch information
sudheerDev committed Mar 25, 2020
commit 399c36d050a984f87941e40ac36937c1ae3b9b4e
26 changes: 8 additions & 18 deletions components/post_view/floating_timestamp/floating_timestamp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';

import RecentDate from 'components/recent_date';

Expand All @@ -21,11 +22,7 @@ export default class FloatingTimestamp extends React.PureComponent {
render() {
const {isMobile, createAt, isScrolling, isRhsPost, toastPresent} = this.props;

if (!isMobile) {
return null;
}

if (createAt === 0) {
if (!isMobile || createAt === 0) {
return null;
}

Expand All @@ -39,22 +36,15 @@ export default class FloatingTimestamp extends React.PureComponent {
/>
);

let className = 'post-list__timestamp';
if (isScrolling) {
className += ' scrolling';
}

if (isRhsPost) {
className += ' rhs';
}

if (toastPresent) {
className += ' toastAdjustment';
}
const classes = classNames('post-list__timestamp', {
scrolling: isScrolling,
rhs: isRhsPost,
toastAdjustment: toastPresent,
});

return (
<div
className={className}
className={classes}
data-testid='floatingTimestamp'
>
<div>
Expand Down