Render disappearing message countdown even if deleted for everyone
This commit is contained in:
parent
c7e7d55af4
commit
6efb6da937
3 changed files with 25 additions and 2 deletions
|
@ -480,6 +480,19 @@ story.add('Deleted', () => {
|
||||||
return renderBothDirections(props);
|
return renderBothDirections(props);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
story.add('Deleted with expireTimer', () => {
|
||||||
|
const props = createProps({
|
||||||
|
timestamp: Date.now() - 60 * 1000,
|
||||||
|
conversationType: 'group',
|
||||||
|
deletedForEveryone: true,
|
||||||
|
expirationLength: 5 * 60 * 1000,
|
||||||
|
expirationTimestamp: Date.now() + 3 * 60 * 1000,
|
||||||
|
status: 'sent',
|
||||||
|
});
|
||||||
|
|
||||||
|
return renderBothDirections(props);
|
||||||
|
});
|
||||||
|
|
||||||
story.add('Can delete for everyone', () => {
|
story.add('Can delete for everyone', () => {
|
||||||
const props = createProps({
|
const props = createProps({
|
||||||
status: 'read',
|
status: 'read',
|
||||||
|
|
|
@ -587,6 +587,7 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
const {
|
const {
|
||||||
attachments,
|
attachments,
|
||||||
collapseMetadata,
|
collapseMetadata,
|
||||||
|
deletedForEveryone,
|
||||||
direction,
|
direction,
|
||||||
expirationLength,
|
expirationLength,
|
||||||
expirationTimestamp,
|
expirationTimestamp,
|
||||||
|
@ -613,6 +614,7 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MessageMetadata
|
<MessageMetadata
|
||||||
|
deletedForEveryone={deletedForEveryone}
|
||||||
direction={direction}
|
direction={direction}
|
||||||
expirationLength={expirationLength}
|
expirationLength={expirationLength}
|
||||||
expirationTimestamp={expirationTimestamp}
|
expirationTimestamp={expirationTimestamp}
|
||||||
|
@ -2080,7 +2082,12 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
const { isTapToView, deletedForEveryone } = this.props;
|
const { isTapToView, deletedForEveryone } = this.props;
|
||||||
|
|
||||||
if (deletedForEveryone) {
|
if (deletedForEveryone) {
|
||||||
return this.renderText();
|
return (
|
||||||
|
<>
|
||||||
|
{this.renderText()}
|
||||||
|
{this.renderMetadata()}
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isTapToView) {
|
if (isTapToView) {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { Timestamp } from './Timestamp';
|
||||||
import { Spinner } from '../Spinner';
|
import { Spinner } from '../Spinner';
|
||||||
|
|
||||||
type PropsType = {
|
type PropsType = {
|
||||||
|
deletedForEveryone?: boolean;
|
||||||
direction: DirectionType;
|
direction: DirectionType;
|
||||||
expirationLength?: number;
|
expirationLength?: number;
|
||||||
expirationTimestamp?: number;
|
expirationTimestamp?: number;
|
||||||
|
@ -28,6 +29,7 @@ type PropsType = {
|
||||||
|
|
||||||
export const MessageMetadata: FunctionComponent<PropsType> = props => {
|
export const MessageMetadata: FunctionComponent<PropsType> = props => {
|
||||||
const {
|
const {
|
||||||
|
deletedForEveryone,
|
||||||
direction,
|
direction,
|
||||||
expirationLength,
|
expirationLength,
|
||||||
expirationTimestamp,
|
expirationTimestamp,
|
||||||
|
@ -130,7 +132,8 @@ export const MessageMetadata: FunctionComponent<PropsType> = props => {
|
||||||
<Spinner svgSize="small" size="14px" direction={direction} />
|
<Spinner svgSize="small" size="14px" direction={direction} />
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{!textPending &&
|
{!deletedForEveryone &&
|
||||||
|
!textPending &&
|
||||||
direction === 'outgoing' &&
|
direction === 'outgoing' &&
|
||||||
status !== 'error' &&
|
status !== 'error' &&
|
||||||
status !== 'partial-sent' ? (
|
status !== 'partial-sent' ? (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue