From d97a574b07cb60e9c2bdd98ace5049e73ee9b861 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Fri, 14 Aug 2020 01:47:41 -0500 Subject: [UI] Move notice headers inside a wrapper; add styling for local-only posts --- .../flavours/glitch/components/status.js | 1 + .../flavours/glitch/components/status_content.js | 32 ++++++++++++++++------ .../features/status/components/detailed_status.js | 1 + .../styles/monsterfork/components/status.scss | 14 ++++++++-- 4 files changed, 38 insertions(+), 10 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 4626d1cd8..a94142452 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -676,6 +676,7 @@ class Status extends ImmutablePureComponent { 'data-status-by': `@${status.getIn(['account', 'acct'])}`, 'data-nest-level': status.get('nest_level'), 'data-nest-deep': status.get('nest_level') >= 15, + 'data-local-only': !!status.get('local_only'), }; if (prepend && account) { diff --git a/app/javascript/flavours/glitch/components/status_content.js b/app/javascript/flavours/glitch/components/status_content.js index d3e7b8718..f03072ac8 100644 --- a/app/javascript/flavours/glitch/components/status_content.js +++ b/app/javascript/flavours/glitch/components/status_content.js @@ -277,7 +277,7 @@ export default class StatusContent extends React.PureComponent { const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden; const edited = (status.get('edited') === 0) ? null : ( -
+
+
); + const local_only = (status.get('local_only') === true) && ( +
+ + +
+ ); + + const status_notice_wrapper = ( +
+ {unpublished} + {edited} + {local_only} +
+ ); + const permissions_present = status.get('domain_permissions') && status.get('domain_permissions').size > 0; const status_permission_items = permissions_present && status.get('domain_permissions').map((permission) => ( @@ -390,8 +409,7 @@ export default class StatusContent extends React.PureComponent { return (
- {unpublished} - {edited} + {status_notice_wrapper}
- {unpublished} - {edited} + {status_notice_wrapper}
{media} {permissions} 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 0db0316cc..b042a825a 100644 --- a/app/javascript/flavours/glitch/features/status/components/detailed_status.js +++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.js @@ -255,6 +255,7 @@ export default class DetailedStatus extends ImmutablePureComponent { 'data-status-by': `@${status.getIn(['account', 'acct'])}`, 'data-nest-level': status.get('nest_level'), 'data-nest-deep': status.get('nest_level') >= 15, + 'data-local-only': !!status.get('local_only'), }; return ( diff --git a/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss b/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss index 17b950651..6c14e2b49 100644 --- a/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss +++ b/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss @@ -1,6 +1,12 @@ -.status__edit-notice, .status__unpublished-notice { +.status__notice-wrapper { margin-bottom: 1em; +} + +.status__notice-wrapper:empty { + display: none; +} +.status__notice { & > span { color: $dark-text-color; line-height: normal; @@ -8,7 +14,7 @@ font-size: 12px; padding-left: 8px; position: relative; - bottom: 0.25em; + bottom: 0.2em; } & > i { @@ -66,6 +72,10 @@ background: lighten($ui-base-color, 4%); } } + + &[data-local-only="true"] { + background: lighten($ui-base-color, 4%); + } } div[data-nest-level] { -- cgit