From 7febf1929633bc5af74026d37d338b0edf420523 Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 31 Aug 2020 18:11:37 +0200 Subject: [PATCH] =?UTF-8?q?Add=20back=20=E2=80=9CHome=E2=80=9D=20link=20to?= =?UTF-8?q?=20the=20=E2=80=9CGetting=20Started=E2=80=9D=20column=20when=20?= =?UTF-8?q?the=20=E2=80=9CHome=E2=80=9D=20column=20isn't=20mounted=20(#147?= =?UTF-8?q?07)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add back "Home" link to "Getting started" when Home column isn't mounted * Fix keys in getting_started It should not matter much in practice as the list of items will only change extremely rarely, but having a `key` that corresponds to the actual item makes much more sense than having it be the index of the item within the list. --- .../features/getting_started/index.js | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/app/javascript/mastodon/features/getting_started/index.js b/app/javascript/mastodon/features/getting_started/index.js index d9838e1c73..02e1bbba50 100644 --- a/app/javascript/mastodon/features/getting_started/index.js +++ b/app/javascript/mastodon/features/getting_started/index.js @@ -40,6 +40,7 @@ const messages = defineMessages({ const mapStateToProps = state => ({ myAccount: state.getIn(['accounts', me]), + columns: state.getIn(['settings', 'columns']), unreadFollowRequests: state.getIn(['user_lists', 'follow_requests', 'items'], ImmutableList()).size, }); @@ -89,60 +90,66 @@ class GettingStarted extends ImmutablePureComponent { } render () { - const { intl, myAccount, multiColumn, unreadFollowRequests } = this.props; + const { intl, myAccount, columns, multiColumn, unreadFollowRequests } = this.props; const navItems = []; - let i = 1; let height = (multiColumn) ? 0 : 60; if (multiColumn) { navItems.push( - , - , - , + , + , + , ); height += 34 + 48*2; if (profile_directory) { navItems.push( - , + , ); height += 48; } navItems.push( - , + , ); height += 34; } else if (profile_directory) { navItems.push( - , + , ); height += 48; } + if (multiColumn && !columns.find(item => item.get('id') === 'HOME')) { + navItems.push( + , + ); + height += 48; + } + navItems.push( - , - , - , - , + , + , + , + , ); height += 48*4; if (myAccount.get('locked') || unreadFollowRequests > 0) { - navItems.push(); + navItems.push(); height += 48; } if (!multiColumn) { navItems.push( - , - , + , + , ); height += 34 + 48;