From af015478c75a2a300de993a8ca66afbca159ab12 Mon Sep 17 00:00:00 2001 From: Clovis Date: Thu, 5 May 2022 22:32:59 +0200 Subject: [PATCH] [CH] Add local and fediverse timeline in thumb menu, move serach icon in top navigation (#13) * Add search Icon in tabs_bar, remove search from thumbs bar * Add local et fediverse timeline access in thumb menu * Change buttons order Co-authored-by: clovis --- app/soapbox/components/thumb_navigation.js | 64 +++++++++++-------- .../features/ui/components/tabs_bar.js | 8 +++ app/styles/components/icon.scss | 8 +++ app/styles/components/tabs-bar.scss | 22 +++++++ 4 files changed, 76 insertions(+), 26 deletions(-) diff --git a/app/soapbox/components/thumb_navigation.js b/app/soapbox/components/thumb_navigation.js index 7234a39b0..4c9ed9fb6 100644 --- a/app/soapbox/components/thumb_navigation.js +++ b/app/soapbox/components/thumb_navigation.js @@ -9,7 +9,6 @@ import { NavLink, withRouter } from 'react-router-dom'; import { getSoapboxConfig } from 'soapbox/actions/soapbox'; import Icon from 'soapbox/components/icon'; import IconWithCounter from 'soapbox/components/icon_with_counter'; -import { isStaff } from 'soapbox/utils/accounts'; import { getFeatures } from 'soapbox/utils/features'; const mapStateToProps = state => { @@ -19,6 +18,7 @@ const mapStateToProps = state => { const instance = state.get('instance'); return { + instance, account: state.getIn(['accounts', me]), logo: getSoapboxConfig(state).get('logo'), notificationCount: state.getIn(['notifications', 'unread']), @@ -40,10 +40,11 @@ class ThumbNavigation extends React.PureComponent { chatsCount: PropTypes.number, features: PropTypes.object.isRequired, location: PropTypes.object, + instance: PropTypes.object.isRequired, } render() { - const { account, notificationCount, chatsCount, dashboardCount, location, features } = this.props; + const { account, notificationCount, chatsCount, location, features, instance } = this.props; return (
@@ -57,28 +58,33 @@ class ThumbNavigation extends React.PureComponent { - - - - - - + {features.federating ? ( + + + + {instance.get('title')} + + + ) : ( + + + + + + + )} - {account && ( - - 0, - })} - count={notificationCount} + {features.federating && ( + + - + )} @@ -108,17 +114,23 @@ class ThumbNavigation extends React.PureComponent { ) )} - {(account && isStaff(account)) && ( - + + {account && ( + 0, + })} + count={notificationCount} /> - + )} +
); } diff --git a/app/soapbox/features/ui/components/tabs_bar.js b/app/soapbox/features/ui/components/tabs_bar.js index 052b91623..22edc729e 100644 --- a/app/soapbox/features/ui/components/tabs_bar.js +++ b/app/soapbox/features/ui/components/tabs_bar.js @@ -140,6 +140,14 @@ class TabsBar extends React.PureComponent { diff --git a/app/styles/components/icon.scss b/app/styles/components/icon.scss index b49c5412e..7a72adfc3 100644 --- a/app/styles/components/icon.scss +++ b/app/styles/components/icon.scss @@ -13,11 +13,19 @@ transition: 0.2s; } + &.svg-icon--fediverse { + color: var(--primary-text-color--faint); + } + &--active { &.svg-icon--home svg { fill: currentColor; } + &.svg-icon--fediverse { + color: var(--primary-text-color); + } + svg.icon-tabler-search, svg.icon-tabler-code { stroke-width: 2.3px; diff --git a/app/styles/components/tabs-bar.scss b/app/styles/components/tabs-bar.scss index 2827206d5..1f5366f3a 100644 --- a/app/styles/components/tabs-bar.scss +++ b/app/styles/components/tabs-bar.scss @@ -110,6 +110,28 @@ } } + &__search { + display: none; + color: var(--foreground-color); + margin-left: 20px; + + .svg-icon { + width: 24px; + height: 24px; + &--active svg{ + fill: var(--foreground-color) !important; + } + } + + @media screen and (max-width: 895px) { + display: block; + } + + @media screen and (max-width: 450px) { + margin-left: auto; + } + } + &__sidebar-btn { display: block; position: absolute;