From 5cecb2ef9e257661bfb5a3c01240b15ea1703861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Wed, 20 Apr 2022 19:25:07 +0200 Subject: [PATCH 1/3] SidebarNavigation: Do not show Bookmarks/Lists links if unauthenticated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/components/sidebar-navigation.tsx | 98 ++++++++++--------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/app/soapbox/components/sidebar-navigation.tsx b/app/soapbox/components/sidebar-navigation.tsx index 3f33e6733..eede8c871 100644 --- a/app/soapbox/components/sidebar-navigation.tsx +++ b/app/soapbox/components/sidebar-navigation.tsx @@ -28,60 +28,62 @@ const SidebarNavigation = () => { const makeMenu = (): Menu => { const menu: Menu = []; - if (account?.locked || followRequestsCount > 0) { - menu.push({ - to: '/follow_requests', - text: , - icon: require('@tabler/icons/icons/user-plus.svg'), - // TODO: let menu items have a counter - // count: followRequestsCount, - }); - } + if (account) { + if (account.locked || followRequestsCount > 0) { + menu.push({ + to: '/follow_requests', + text: , + icon: require('@tabler/icons/icons/user-plus.svg'), + // TODO: let menu items have a counter + // count: followRequestsCount, + }); + } - if (features.bookmarks) { - menu.push({ - to: '/bookmarks', - text: , - icon: require('@tabler/icons/icons/bookmark.svg'), - }); - } + if (features.bookmarks) { + menu.push({ + to: '/bookmarks', + text: , + icon: require('@tabler/icons/icons/bookmark.svg'), + }); + } - if (features.lists) { - menu.push({ - to: '/lists', - text: , - icon: require('@tabler/icons/icons/list.svg'), - }); - } + if (features.lists) { + menu.push({ + to: '/lists', + text: , + icon: require('@tabler/icons/icons/list.svg'), + }); + } - if (account && instance.invites_enabled) { - menu.push({ - to: `${baseURL}/invites`, - icon: require('@tabler/icons/icons/mailbox.svg'), - text: , - }); - } + if (instance.invites_enabled) { + menu.push({ + to: `${baseURL}/invites`, + icon: require('@tabler/icons/icons/mailbox.svg'), + text: , + }); + } - if (settings.get('isDeveloper')) { - menu.push({ - to: '/developers', - icon: require('@tabler/icons/icons/code.svg'), - text: , - }); - } + if (settings.get('isDeveloper')) { + menu.push({ + to: '/developers', + icon: require('@tabler/icons/icons/code.svg'), + text: , + }); + } - if (account && account.staff) { - menu.push({ - to: '/admin', - icon: require('@tabler/icons/icons/dashboard.svg'), - text: , - // TODO: let menu items have a counter - // count: dashboardCount, - }); - } + if (account.staff) { + menu.push({ + to: '/admin', + icon: require('@tabler/icons/icons/dashboard.svg'), + text: , + // TODO: let menu items have a counter + // count: dashboardCount, + }); + } - if (features.localTimeline || features.publicTimeline) { - menu.push(null); + if (features.localTimeline || features.publicTimeline) { + menu.push(null); + } } if (features.localTimeline) { From a398f14b2fe9c44e1dda355e5b9b5049866721dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Wed, 20 Apr 2022 19:37:40 +0200 Subject: [PATCH 2/3] Lists links styling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/features/lists/index.tsx | 12 ++++-- .../features/ui/components/column_link.js | 39 ------------------- 2 files changed, 8 insertions(+), 43 deletions(-) delete mode 100644 app/soapbox/features/ui/components/column_link.js diff --git a/app/soapbox/features/lists/index.tsx b/app/soapbox/features/lists/index.tsx index 5b9a0e936..078fbe180 100644 --- a/app/soapbox/features/lists/index.tsx +++ b/app/soapbox/features/lists/index.tsx @@ -2,16 +2,17 @@ import React from 'react'; import { useEffect } from 'react'; import { defineMessages, useIntl, FormattedMessage } from 'react-intl'; import { useDispatch } from 'react-redux'; +import { Link } from 'react-router-dom'; import { createSelector } from 'reselect'; import { fetchLists } from 'soapbox/actions/lists'; +import Icon from 'soapbox/components/icon'; import ScrollableList from 'soapbox/components/scrollable_list'; import { Spinner } from 'soapbox/components/ui'; import { CardHeader, CardTitle } from 'soapbox/components/ui'; import { useAppSelector } from 'soapbox/hooks'; import Column from '../ui/components/column'; -import ColumnLink from '../ui/components/column_link'; import NewListForm from './components/new_list_form'; @@ -66,9 +67,12 @@ const Lists: React.FC = () => { scrollKey='lists' emptyMessage={emptyMessage} > - {lists.map((list: any) => - , - )} + {lists.map((list: any) => ( + + + {list.get('title')} + + ))} ); diff --git a/app/soapbox/features/ui/components/column_link.js b/app/soapbox/features/ui/components/column_link.js deleted file mode 100644 index 9dbdf4c64..000000000 --- a/app/soapbox/features/ui/components/column_link.js +++ /dev/null @@ -1,39 +0,0 @@ -import PropTypes from 'prop-types'; -import React from 'react'; -import { Link } from 'react-router-dom'; - -import Icon from 'soapbox/components/icon'; - -const ColumnLink = ({ icon, src, text, to, href, method, badge }) => { - const badgeElement = typeof badge !== 'undefined' ? {badge} : null; - - if (href) { - return ( - - - {text} - {badgeElement} - - ); - } else { - return ( - - - {text} - {badgeElement} - - ); - } -}; - -ColumnLink.propTypes = { - icon: PropTypes.string, - src: PropTypes.string, - text: PropTypes.string.isRequired, - to: PropTypes.string, - href: PropTypes.string, - method: PropTypes.string, - badge: PropTypes.node, -}; - -export default ColumnLink; From 285b67e390f782f7f8e93d6bab0aa7a0b1fa2220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Wed, 20 Apr 2022 19:40:42 +0200 Subject: [PATCH 3/3] pl translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/locales/pl.json | 1 + 1 file changed, 1 insertion(+) diff --git a/app/soapbox/locales/pl.json b/app/soapbox/locales/pl.json index f5d4ab3fb..0008b827c 100644 --- a/app/soapbox/locales/pl.json +++ b/app/soapbox/locales/pl.json @@ -618,6 +618,7 @@ "login.fields.otp_code_hint": "Wprowadź kod uwierzytelniania dwuetapowego wygenerowany przez aplikację mobilną lub jeden z kodów zapasowych", "login.fields.otp_code_label": "Kod uwierzytelniania dwuetapowego:", "login.fields.password_placeholder": "Hasło", + "login.fields.username_label": "Nazwa użytkownika lub e-mail", "login.fields.username_placeholder": "Nazwa użytkownika", "login.log_in": "Zaloguj się", "login.otp_log_in": "Login OTP",