jam411 3 лет назад
Родитель
Сommit
c62e7db8e6

+ 2 - 10
packages/app/src/components/PageList/BookmarkList.tsx

@@ -4,7 +4,7 @@ import { useTranslation } from 'next-i18next';
 
 
 import { toastError } from '~/client/util/apiNotification';
 import { toastError } from '~/client/util/apiNotification';
 import { apiv3Get } from '~/client/util/apiv3-client';
 import { apiv3Get } from '~/client/util/apiv3-client';
-import { IPageHasId } from '~/interfaces/page';
+import { BookmarkListPage } from '~/interfaces/bookmark-info';
 import loggerFactory from '~/utils/logger';
 import loggerFactory from '~/utils/logger';
 
 
 import PaginationWrapper from '../PaginationWrapper';
 import PaginationWrapper from '../PaginationWrapper';
@@ -17,19 +17,11 @@ type BookmarkListProps = {
   userId: string
   userId: string
 }
 }
 
 
-type BookmarkListPages = {
-  _id: string,
-  page: IPageHasId,
-  user: string,
-  createdAt: Date,
-}
-
-
 export const BookmarkList = (props: BookmarkListProps): JSX.Element => {
 export const BookmarkList = (props: BookmarkListProps): JSX.Element => {
   const { userId } = props;
   const { userId } = props;
 
 
   const { t } = useTranslation();
   const { t } = useTranslation();
-  const [pages, setPages] = useState<BookmarkListPages[]>([]);
+  const [pages, setPages] = useState<BookmarkListPage[]>([]);
   const [activePage, setActivePage] = useState(1);
   const [activePage, setActivePage] = useState(1);
   const [totalItemsCount, setTotalItemsCount] = useState(0);
   const [totalItemsCount, setTotalItemsCount] = useState(0);
   const [pagingLimit, setPagingLimit] = useState(10);
   const [pagingLimit, setPagingLimit] = useState(10);

+ 8 - 0
packages/app/src/interfaces/bookmark-info.ts

@@ -1,3 +1,4 @@
+import { IPageHasId } from '~/interfaces/page';
 import { IUser } from '~/interfaces/user';
 import { IUser } from '~/interfaces/user';
 
 
 export type IBookmarkInfo = {
 export type IBookmarkInfo = {
@@ -5,3 +6,10 @@ export type IBookmarkInfo = {
   isBookmarked: boolean,
   isBookmarked: boolean,
   bookmarkedUsers: IUser[]
   bookmarkedUsers: IUser[]
 };
 };
+
+export type BookmarkListPage = {
+  _id: string,
+  page: IPageHasId,
+  user: string,
+  createdAt: Date,
+}