83dbe8ec7c
* Playlists v2 * Style pass * Change playlist items arrange icon * Playlist card body open by default * Refactor collectionEdit components * Paginate & Refactor bid field * Collection page changes * Add Thumbnail optional * Replace extra info for description on collection page * Playlist card right below video on medium screen * Allow editing private collections * Add edit option to menus * Allow deleting a public playlist but keeping a private version * Add queue to Save menu, remove edit option from Builtin pages, show queue on playlists page * Fix scroll to recent persisting on medium screen * Fix adding to queue from menu * Fixes for delete * PublishList: delay mounting Items tab to prevent lock-up (#1783) For a large list, the playlist publish form is unusable (super-slow typing) due to the entire list being mounted despite the tab is not active. The full solution is still to paginate it, but for now, don't mount the tab until it is selected. Add a spinner to indicate something is loading. It's not prefect, but it's throwaway code anyway. At least we can fill in the fields properly now. * Batch-resolve private collections (#1782) * makeSelectClaimForClaimId --> selectClaimForClaimId Move away from the problematic `makeSelect*`, especially in large loops. * Batch-resolve private collections 1758 This alleviates the lock-up that is caused by large number of invidual resolves. There will still be some minor stutter due to the large DOM that React needs to handle -- that is logged in 1758 and will be handled separately. At least the stutter is short (1-2s) and the app is still usable. Private list items are being resolve individually, super slow if the list is large (>100). Published lists doesn't have this issue. doFetchItemsInCollections contains most of the useful logic, but it isn't called for private/built-in lists because it's not an actual claim. Tweaked doFetchItemsInCollections to handle private (UUID-based) collections. * Use persisted state for floating player playlist card body - I find it annoying being open everytime * Fix removing edits from published playlist * Fix scroll on mobile * Allow going editing items from toast * Fix ClaimShareButton * Prevent edit/publish of builtin * Fix async inside forEach * Fix sync on queue edit * Fix autoplayCountdown replay * Fix deleting an item scrolling the playlist * CreatedAt fixes * Remove repost for now * Anon publish fixes * Fix mature case on floating Co-authored-by: infinite-persistence <64950861+infinite-persistence@users.noreply.github.com>
70 lines
2.1 KiB
JavaScript
70 lines
2.1 KiB
JavaScript
import * as ICONS from 'constants/icons';
|
|
|
|
// ui
|
|
export const ICON_SIZE = 12;
|
|
export const PLACEHOLDER = 'My Awesome Playlist';
|
|
|
|
// see which of these are used
|
|
export const COLLECTION_ID = 'lid';
|
|
export const COLLECTION_INDEX = 'linx';
|
|
|
|
export const COL_TYPE_PLAYLIST = 'playlist';
|
|
export const COL_TYPE_CHANNELS = 'channelList';
|
|
|
|
export const WATCH_LATER_ID = 'watchlater';
|
|
export const WATCH_LATER_NAME = 'Watch Later';
|
|
|
|
export const FAVORITES_ID = 'favorites';
|
|
export const FAVORITES_NAME = 'Favorites';
|
|
|
|
export const QUEUE_ID = 'queue';
|
|
export const QUEUE_NAME = 'Queue';
|
|
|
|
export const BUILTIN_PLAYLISTS = [WATCH_LATER_ID, FAVORITES_ID, QUEUE_ID];
|
|
// export const FAVORITE_CHANNELS_ID = 'favoriteChannels';
|
|
// export const BUILTIN_LISTS = [WATCH_LATER_ID, FAVORITES_ID, FAVORITE_CHANNELS_ID];
|
|
|
|
export const COL_KEY_BUILTIN = 'builtin';
|
|
export const COL_KEY_EDITED = 'edited';
|
|
export const COL_KEY_UNPUBLISHED = 'unpublished';
|
|
export const COL_KEY_PUBLISHED = 'published';
|
|
export const COL_KEY_PENDING = 'pending';
|
|
|
|
export const PLAYLIST_ICONS = {
|
|
[FAVORITES_ID]: ICONS.STAR,
|
|
[WATCH_LATER_ID]: ICONS.TIME,
|
|
[QUEUE_ID]: ICONS.PLAYLIST,
|
|
};
|
|
|
|
export const LIST_TYPE = Object.freeze({ ALL: 'All', PRIVATE: 'Private', PUBLIC: 'Public' });
|
|
export const PLAYLIST_SHOW_COUNT = Object.freeze({ DEFAULT: 12, MOBILE: 6 });
|
|
|
|
export const SORT_ORDER = Object.freeze({
|
|
ASC: 'asc', // ascending
|
|
DESC: 'desc', // descending
|
|
});
|
|
|
|
export const SORT_KEYS = Object.freeze({
|
|
NAME: 'name',
|
|
CREATED_AT: 'createdAt',
|
|
UPDATED_AT: 'updatedAt',
|
|
COUNT: 'count',
|
|
});
|
|
|
|
export const SORT_VALUES = Object.freeze({
|
|
[SORT_KEYS.NAME]: { str: 'Name', orders: { [SORT_ORDER.ASC]: 'A-Z', [SORT_ORDER.DESC]: 'Z-A' } },
|
|
[SORT_KEYS.CREATED_AT]: {
|
|
str: 'Creation Time',
|
|
orders: { [SORT_ORDER.ASC]: 'Newest First', [SORT_ORDER.DESC]: 'Oldest First' },
|
|
},
|
|
[SORT_KEYS.UPDATED_AT]: {
|
|
str: 'Updated Time',
|
|
orders: { [SORT_ORDER.ASC]: 'Newest First', [SORT_ORDER.DESC]: 'Oldest First' },
|
|
},
|
|
[SORT_KEYS.COUNT]: {
|
|
str: 'Video Count',
|
|
orders: { [SORT_ORDER.ASC]: 'Increasing', [SORT_ORDER.DESC]: 'Decreasing' },
|
|
},
|
|
});
|
|
|
|
export const DEFAULT_SORT = { key: 'name', value: SORT_ORDER.ASC };
|