diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-04-20 01:00:45 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-05-21 03:16:22 -0500 |
commit | 87f4b4d230454d4baa7116e55d9aee42199eeb9b (patch) | |
tree | 67ba4a84653cc027a414a60732227abeced2fdc0 /app/javascript/flavours/glitch/features | |
parent | 19b78604e9dd1acb6566edd49f5c59536d5fc209 (diff) |
Implement share keys and related bangtags, add `sharekey`, `network`, and `curated` to the API, remove app info from the UI, and move timestamps to the right.
Diffstat (limited to 'app/javascript/flavours/glitch/features')
-rw-r--r-- | app/javascript/flavours/glitch/features/status/components/detailed_status.js | 38 |
1 files changed, 32 insertions, 6 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 1633d26ee..e9bbcaa90 100644 --- a/app/javascript/flavours/glitch/features/status/components/detailed_status.js +++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.js @@ -15,6 +15,7 @@ import VisibilityIcon from 'flavours/glitch/components/status_visibility_icon'; import scheduleIdleTask from 'flavours/glitch/util/schedule_idle_task'; import classNames from 'classnames'; import PollContainer from 'flavours/glitch/containers/poll_container'; +import { me } from 'flavours/glitch/util/initial_state'; export default class DetailedStatus extends ImmutablePureComponent { @@ -114,10 +115,10 @@ export default class DetailedStatus extends ImmutablePureComponent { let media = null; let mediaIcon = null; - let applicationLink = ''; let reblogLink = ''; let reblogIcon = 'repeat'; let favouriteLink = ''; + let sharekeyLinks = ''; if (this.props.measureHeight) { outerStyle.height = `${this.state.height}px`; @@ -168,10 +169,6 @@ export default class DetailedStatus extends ImmutablePureComponent { mediaIcon = 'link'; } - if (status.get('application')) { - applicationLink = <span> · <a className='detailed-status__application' href={status.getIn(['application', 'website'])} target='_blank' rel='noopener'>{status.getIn(['application', 'name'])}</a></span>; - } - if (status.get('visibility') === 'direct') { reblogIcon = 'envelope'; } else if (status.get('visibility') === 'private') { @@ -194,6 +191,34 @@ export default class DetailedStatus extends ImmutablePureComponent { ); } + if (status.get('sharekey')) { + sharekeyLinks = ( + <span> + <a href={`${status.get('url')}?key=${status.get('sharekey')}`} target='_blank' className='detailed-status__link'> + <i className='fa fa-key' title='Right-click or long press to copy share link with key' /> + </a> + · + <a href={`${status.get('url')}?rekey=1&toweb=1`} className='detailed-status__link'> + <i className='fa fa-user-plus' title='Generate a new share key' /> + </a> + · + <a href={`${status.get('url')}?rekey=0&toweb=1`} className='detailed-status__link'> + <i className='fa fa-user-times' title='Revoke share key' /> + </a> + · + </span> + ); + } else if (status.getIn(['account', 'id']) == me) { + sharekeyLinks = ( + <span> + <a href={`${status.get('url')}?rekey=1&toweb=1`} className='detailed-status__link'> + <i className='fa fa-user-plus' title='Generate a new share key' /> + </a> + · + </span> + ); + } + if (this.context.router) { favouriteLink = ( <Link to={`/statuses/${status.get('id')}/favourites`} className='detailed-status__link'> @@ -229,9 +254,10 @@ export default class DetailedStatus extends ImmutablePureComponent { /> <div className='detailed-status__meta'> + {sharekeyLinks} {reblogLink} · {favouriteLink} · <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>{applicationLink} · {reblogLink} · {favouriteLink} · <VisibilityIcon visibility={status.get('visibility')} /> + </a> </div> </div> </div> |