about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/status/components
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-23 16:48:08 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-23 16:48:08 -0500
commit3862f48c34a00691a12c6002abd88b088cf7c13e (patch)
treef1d5d2299de3d470816300221d3dba6ac8ecc30c /app/javascript/flavours/glitch/features/status/components
parent2a6ccce070277c8c278a2e8403f45394eec06f91 (diff)
add self-destructing roars & `live`/`lifespan` bangtags
Diffstat (limited to 'app/javascript/flavours/glitch/features/status/components')
-rw-r--r--app/javascript/flavours/glitch/features/status/components/detailed_status.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.js b/app/javascript/flavours/glitch/features/status/components/detailed_status.js
index e9bbcaa90..f8f5e053c 100644
--- a/app/javascript/flavours/glitch/features/status/components/detailed_status.js
+++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.js
@@ -17,6 +17,15 @@ import classNames from 'classnames';
 import PollContainer from 'flavours/glitch/containers/poll_container';
 import { me } from 'flavours/glitch/util/initial_state';
 
+const dateFormatOptions = {
+  month: 'numeric',
+  day: 'numeric',
+  year: 'numeric',
+  hour12: false,
+  hour: '2-digit',
+  minute: '2-digit',
+};
+
 export default class DetailedStatus extends ImmutablePureComponent {
 
   static contextTypes = {
@@ -119,6 +128,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
     let reblogIcon = 'repeat';
     let favouriteLink = '';
     let sharekeyLinks = '';
+    let destructIcon = '';
 
     if (this.props.measureHeight) {
       outerStyle.height = `${this.state.height}px`;
@@ -233,6 +243,14 @@ export default class DetailedStatus extends ImmutablePureComponent {
       );
     }
 
+    if (status.get('delete_after')) {
+      destructIcon = (
+        <span>
+          <i className='fa fa-clock-o' title={new Date(status.get('delete_after'))} /> ·
+        </span>
+      )
+    }
+
     return (
       <div style={outerStyle}>
         <div ref={this.setRef} className={classNames('detailed-status', { compact })} data-status-by={status.getIn(['account', 'acct'])}>
@@ -254,7 +272,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
           />
 
           <div className='detailed-status__meta'>
-            {sharekeyLinks} {reblogLink} · {favouriteLink} · <VisibilityIcon visibility={status.get('visibility')} />
+            {sharekeyLinks} {reblogLink} · {favouriteLink} · {destructIcon} <VisibilityIcon visibility={status.get('visibility')} />
             <a className='detailed-status__datetime' href={status.get('url')} target='_blank' rel='noopener'>
               <FormattedDate value={new Date(status.get('created_at'))} hour12={false} year='numeric' month='short' day='2-digit' hour='2-digit' minute='2-digit' />
             </a>