You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
1.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import * as requests from "../requests/index.js";
export const SUCCESS = "success";
export const menuDict = [
{
id: 1,
label: "В очередь на чтение",
action: requests.readLater,
value: {
id: 'hasReadLater',
label: true,
}
},
{
id: 2,
label: "Убрать из очереди",
action: requests.removeFromReadLater,
value: {
id: 'hasReadLater',
label: false,
}
},
{
id: 3,
label: "Игнорировать книгу",
action: requests.ignoreBook,
value: {
id: 'isBlocked',
label: true,
}
},
{
id: 4,
label: "Перестать игнорировать книгу",
action: requests.stopIgnoreBook,
value: {
id: 'isBlocked',
label: false,
}
},
{
id: 5,
label: "Авторов в избранное",
action: requests.addAuthorToFavourites,
},
{
id: 6,
label: "Игнорировать авторов",
action: requests.ignoreAuthors,
},
{
id: 7,
label: "Заметка",
action: () => {},
},
{
id: 8,
label: "Поделиться",
action: () => {},
},
];
export const getMenu = ({ isBlocked, hasReadLater }) =>
menuDict
.filter((item) => (isBlocked ? item.id !== 3 : item.id !== 4))
.filter((item) => (hasReadLater ? item.id !== 1 : item.id !== 2));
export const DEFAULT_AUTHOR = {
id: 0,
name: "Неизвестно",
};
export const likeEnum = [
{
id: 0,
label: "Нравится",
action: requests.addBookToFavourites,
},
{
id: 1,
label: "Не нравится",
action: requests.removeBookToFavourites,
},
];

Powered by TurnKey Linux.