about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/getting_started
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-05-26 02:55:37 +0200
committerThibG <thib@sitedethib.com>2019-06-13 22:15:31 +0200
commitff88387a4afff249c14511780c59e485a49631b8 (patch)
tree356dcddec37a0e28c243ed81e2cb21d1b36e035c /app/javascript/flavours/glitch/features/getting_started
parentd99a661f08398238838bf576e86c4be706ee7aa0 (diff)
[Glitch] Improvements to the single column layout
Port 0e445ebb1392c8dbce320509d219f16c7c221406 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/getting_started')
-rw-r--r--app/javascript/flavours/glitch/features/getting_started/index.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/app/javascript/flavours/glitch/features/getting_started/index.js b/app/javascript/flavours/glitch/features/getting_started/index.js
index 7b645c9d0..b07789562 100644
--- a/app/javascript/flavours/glitch/features/getting_started/index.js
+++ b/app/javascript/flavours/glitch/features/getting_started/index.js
@@ -73,9 +73,15 @@ const badgeDisplay = (number, limit) => {
   }
 };
 
-@connect(makeMapStateToProps, mapDispatchToProps)
-@injectIntl
-export default class GettingStarted extends ImmutablePureComponent {
+const NAVIGATION_PANEL_BREAKPOINT = 600 + (285 * 2) + (10 * 2);
+
+ export default @connect(makeMapStateToProps, mapDispatchToProps)
+ @injectIntl
+ class GettingStarted extends ImmutablePureComponent {
+
+  static contextTypes = {
+    router: PropTypes.object.isRequired,
+  };
 
   static propTypes = {
     intl: PropTypes.object.isRequired,
@@ -97,6 +103,11 @@ export default class GettingStarted extends ImmutablePureComponent {
   componentDidMount () {
     const { myAccount, fetchFollowRequests } = this.props;
 
+    if (window.innerWidth >= NAVIGATION_PANEL_BREAKPOINT) {
+      this.context.router.history.replace('/timelines/home');
+      return;
+    }
+
     if (myAccount.get('locked')) {
       fetchFollowRequests();
     }
@@ -135,7 +146,7 @@ export default class GettingStarted extends ImmutablePureComponent {
     }
 
     if (myAccount.get('locked')) {
-      navItems.push(<ColumnLink key='6' icon='users' text={intl.formatMessage(messages.follow_requests)} badge={badgeDisplay(unreadFollowRequests, 40)} to='/follow_requests' />);
+      navItems.push(<ColumnLink key='6' icon='user-plus' text={intl.formatMessage(messages.follow_requests)} badge={badgeDisplay(unreadFollowRequests, 40)} to='/follow_requests' />);
     }
 
     navItems.push(<ColumnLink key='7' icon='ellipsis-h' text={intl.formatMessage(messages.misc)} to='/getting-started-misc' />);