From 967456b6a9ef34d8ffc386b89993d790c26089e1 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 19 Jun 2019 23:42:38 +0200 Subject: [Glitch] Add audio uploads Port front-end changes from f7f23b4a19a84371f44ec5297125e96ba81681a1 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/components/status.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index f6d73475a..7bd2bc4a8 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -521,16 +521,16 @@ export default class Status extends ImmutablePureComponent { media={status.get('media_attachments')} /> ); - } else if (attachments.getIn([0, 'type']) === 'video') { // Media type is 'video' - const video = status.getIn(['media_attachments', 0]); + } else if (['video', 'audio'].includes(attachments.getIn([0, 'type']))) { + const attachment = status.getIn(['media_attachments', 0]); media = ( {Component => ( Date: Fri, 21 Jun 2019 22:59:44 +0200 Subject: [Glitch] Add media description as title to links of unknown media attachments Port front-end changes from 49ebda4d49af50b375126e4a8285686fb6448a60 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/components/media_gallery.js | 2 +- app/javascript/flavours/glitch/styles/components/composer.scss | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/media_gallery.js b/app/javascript/flavours/glitch/components/media_gallery.js index 6ef101f11..291caff45 100644 --- a/app/javascript/flavours/glitch/components/media_gallery.js +++ b/app/javascript/flavours/glitch/components/media_gallery.js @@ -177,7 +177,7 @@ class Item extends React.PureComponent { if (attachment.get('type') === 'unknown') { return ( diff --git a/app/javascript/flavours/glitch/styles/components/composer.scss b/app/javascript/flavours/glitch/styles/components/composer.scss index c06d79ffc..3eb5551c6 100644 --- a/app/javascript/flavours/glitch/styles/components/composer.scss +++ b/app/javascript/flavours/glitch/styles/components/composer.scss @@ -370,6 +370,7 @@ border-radius: 4px; height: 140px; width: 100%; + background-color: $base-shadow-color; background-position: center; background-size: cover; background-repeat: no-repeat; -- cgit From 598cdc9542122b6a8ebe2fbffcff864afdc18853 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 24 Jun 2019 16:16:16 +0200 Subject: Use a different icon for audio attachments --- app/javascript/flavours/glitch/components/status.js | 2 +- .../flavours/glitch/features/status/components/detailed_status.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 7bd2bc4a8..ed2623ebb 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -544,7 +544,7 @@ export default class Status extends ImmutablePureComponent { />)} ); - mediaIcon = 'video-camera'; + mediaIcon = attachment.get('type') === 'video' ? 'video-camera' : 'music'; } else { // Media type is 'image' or 'gifv' media = ( 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 91d41d77a..1c2258256 100644 --- a/app/javascript/flavours/glitch/features/status/components/detailed_status.js +++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.js @@ -150,7 +150,7 @@ export default class DetailedStatus extends ImmutablePureComponent { onToggleVisibility={this.props.onToggleMediaVisibility} /> ); - mediaIcon = 'video-camera'; + mediaIcon = attachment.get('type') === 'video' ? 'video-camera' : 'music'; } else { media = (