From 5bf65f4e9708ec3968f028cbaa67c04fd05f2b02 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 24 Nov 2019 15:57:27 +0100 Subject: [PATCH] Add moved account warning --- app/javascript/flavours/glitch/features/ui/index.js | 9 +++++++-- .../flavours/glitch/styles/components/index.scss | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js index 646def8f29..b582050d84 100644 --- a/app/javascript/flavours/glitch/features/ui/index.js +++ b/app/javascript/flavours/glitch/features/ui/index.js @@ -51,7 +51,7 @@ import { } from 'flavours/glitch/util/async-components'; import { HotKeys } from 'react-hotkeys'; import { me } from 'flavours/glitch/util/initial_state'; -import { defineMessages, injectIntl } from 'react-intl'; +import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; // Dummy import, to make sure that ends up in the application bundle. // Without this it ends up in ~8 very commonly used bundles. @@ -72,6 +72,7 @@ const mapStateToProps = state => ({ unreadNotifications: state.getIn(['notifications', 'unread']), showFaviconBadge: state.getIn(['local_settings', 'notifications', 'favicon_badge']), hicolorPrivacyIcons: state.getIn(['local_settings', 'hicolor_privacy_icons']), + moved: state.getIn(['accounts', me, 'moved']), }); const keyMap = { @@ -254,6 +255,7 @@ class UI extends React.Component { dropdownMenuIsOpen: PropTypes.bool, unreadNotifications: PropTypes.number, showFaviconBadge: PropTypes.bool, + moved: PropTypes.bool, }; state = { @@ -539,7 +541,7 @@ class UI extends React.Component { render () { const { draggingOver } = this.state; - const { children, layout, isWide, navbarUnder, location, dropdownMenuIsOpen } = this.props; + const { children, layout, isWide, navbarUnder, location, dropdownMenuIsOpen, moved } = this.props; const columnsClass = layout => { switch (layout) { @@ -583,6 +585,9 @@ class UI extends React.Component { return (
+ {moved && (
+ +
)} {children} diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss index ef76cea5ec..5ac2403d18 100644 --- a/app/javascript/flavours/glitch/styles/components/index.scss +++ b/app/javascript/flavours/glitch/styles/components/index.scss @@ -1556,6 +1556,14 @@ } } +.ui .flash-message { + margin-top: 10px; + margin-left: auto; + margin-right: auto; + margin-bottom: 0; + min-width: 75%; +} + ::-webkit-scrollbar-thumb { border-radius: 0; }