Allow addressing posts to lists

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-09-03 15:18:58 +02:00
parent f3ec08777c
commit 4841c5b0a2
8 changed files with 168 additions and 59 deletions

View File

@@ -1,34 +1,22 @@
import React, { useEffect } from 'react';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
import { createSelector } from 'reselect';
import { setupListAdder, resetListAdder } from 'pl-fe/actions/lists';
import { CardHeader, CardTitle, Modal } from 'pl-fe/components/ui';
import AccountContainer from 'pl-fe/containers/account-container';
import { getOrderedLists } from 'pl-fe/features/lists';
import NewListForm from 'pl-fe/features/lists/components/new-list-form';
import { useAppDispatch, useAppSelector } from 'pl-fe/hooks';
import List from './components/list';
import type { List as ImmutableList } from 'immutable';
import type { List as ListEntity } from 'pl-api';
import type { BaseModalProps } from 'pl-fe/features/ui/components/modal-root';
import type { RootState } from 'pl-fe/store';
const messages = defineMessages({
subheading: { id: 'lists.subheading', defaultMessage: 'Your lists' },
add: { id: 'lists.new.create', defaultMessage: 'Add list' },
});
// hack
const getOrderedLists = createSelector([(state: RootState) => state.lists], lists => {
if (!lists) {
return lists;
}
return lists.toList().filter(item => !!item).sort((a, b) => (a as ListEntity).title.localeCompare((b as ListEntity).title)) as ImmutableList<ListEntity>;
});
interface ListAdderModalProps {
accountId: string;
}