Merge branch 'next' into 'next'

next

See merge request soapbox-pub/soapbox-fe!1245
This commit is contained in:
marcin mikołajczak 2022-04-20 17:55:29 +00:00
commit edd8c2705a
4 changed files with 59 additions and 91 deletions

View File

@ -28,7 +28,8 @@ const SidebarNavigation = () => {
const makeMenu = (): Menu => {
const menu: Menu = [];
if (account?.locked || followRequestsCount > 0) {
if (account) {
if (account.locked || followRequestsCount > 0) {
menu.push({
to: '/follow_requests',
text: <FormattedMessage id='navigation_bar.follow_requests' defaultMessage='Follow requests' />,
@ -54,7 +55,7 @@ const SidebarNavigation = () => {
});
}
if (account && instance.invites_enabled) {
if (instance.invites_enabled) {
menu.push({
to: `${baseURL}/invites`,
icon: require('@tabler/icons/icons/mailbox.svg'),
@ -70,7 +71,7 @@ const SidebarNavigation = () => {
});
}
if (account && account.staff) {
if (account.staff) {
menu.push({
to: '/admin',
icon: require('@tabler/icons/icons/dashboard.svg'),
@ -83,6 +84,7 @@ const SidebarNavigation = () => {
if (features.localTimeline || features.publicTimeline) {
menu.push(null);
}
}
if (features.localTimeline) {
menu.push({

View File

@ -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) =>
<ColumnLink key={list.get('id')} to={`/list/${list.get('id')}`} src={require('@tabler/icons/icons/list.svg')} text={list.get('title')} />,
)}
{lists.map((list: any) => (
<Link key={list.get('id')} to={`/list/${list.get('id')}`} className='flex items-center gap-1.5 p-2 my-2 text-black dark:text-white hover:bg-gray-100 dark:hover:bg-slate-700 rounded-lg'>
<Icon src={require('@tabler/icons/icons/list.svg')} fixedWidth />
{list.get('title')}
</Link>
))}
</ScrollableList>
</Column>
);

View File

@ -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' ? <span className='column-link__badge'>{badge}</span> : null;
if (href) {
return (
<a href={href} className='column-link' data-method={method}>
<Icon id={icon} src={src} fixedWidth className='column-link__icon' />
{text}
{badgeElement}
</a>
);
} else {
return (
<Link to={to} className='column-link'>
<Icon id={icon} src={src} fixedWidth className='column-link__icon' />
{text}
{badgeElement}
</Link>
);
}
};
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;

View File

@ -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",