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>
145 lines
3.3 KiB
JavaScript
145 lines
3.3 KiB
JavaScript
// @flow
|
|
import * as ACTIONS from 'constants/action_types';
|
|
|
|
/*
|
|
Toasts:
|
|
- First-in, first-out queue
|
|
- Simple messages that are shown in response to user interactions
|
|
- Never saved
|
|
- If they are the result of errors, use the isError flag when creating
|
|
- For errors that should interrupt user behavior, use Error
|
|
*/
|
|
declare type ToastParams = {
|
|
message: string,
|
|
subMessage?: string,
|
|
// title?: string,
|
|
linkText?: string,
|
|
linkTarget?: string,
|
|
isError?: boolean,
|
|
duration?: 'default' | 'long',
|
|
actionText?: string,
|
|
action?: () => void,
|
|
secondaryActionText?: string,
|
|
secondaryAction?: () => void,
|
|
};
|
|
|
|
declare type Toast = {
|
|
id: string,
|
|
params: ToastParams,
|
|
};
|
|
|
|
declare type DoToast = {
|
|
type: ACTIONS.CREATE_TOAST,
|
|
data: Toast,
|
|
};
|
|
|
|
/*
|
|
Notifications:
|
|
- List of notifications based on user interactions/app notifications
|
|
- Always saved, but can be manually deleted
|
|
- Can happen in the background, or because of user interaction (ex: publish confirmed)
|
|
*/
|
|
declare type Notification = {
|
|
id: string, // Unique id
|
|
dateCreated: number,
|
|
isRead: boolean, // Used to display "new" notifications that a user hasn't seen yet
|
|
source?: string, // The type/area an notification is from. Used for sorting (ex: publishes, transactions)
|
|
// We may want to use priority/isDismissed in the future to specify how urgent a notification is
|
|
// and if the user should see it immediately
|
|
// isDissmied: boolean,
|
|
// priority?: number
|
|
};
|
|
|
|
declare type DoNotification = {
|
|
type: ACTIONS.CREATE_NOTIFICATION,
|
|
data: Notification,
|
|
};
|
|
|
|
declare type DoEditNotification = {
|
|
type: ACTIONS.EDIT_NOTIFICATION,
|
|
data: {
|
|
notification: Notification,
|
|
},
|
|
};
|
|
|
|
declare type DoDeleteNotification = {
|
|
type: ACTIONS.DELETE_NOTIFICATION,
|
|
data: {
|
|
id: string, // The id to delete
|
|
},
|
|
};
|
|
|
|
/*
|
|
Errors:
|
|
- First-in, first-out queue
|
|
- Errors that should interupt user behavior
|
|
- For errors that can be shown without interrupting a user, use Toast with the isError flag
|
|
*/
|
|
declare type ErrorNotification = {
|
|
title: string,
|
|
text: string,
|
|
};
|
|
|
|
declare type DoError = {
|
|
type: ACTIONS.CREATE_ERROR,
|
|
data: ErrorNotification,
|
|
};
|
|
|
|
declare type DoDismissError = {
|
|
type: ACTIONS.DISMISS_ERROR,
|
|
};
|
|
|
|
/*
|
|
NotificationState
|
|
*/
|
|
declare type NotificationState = {
|
|
notifications: Array<Notification>,
|
|
errors: Array<ErrorNotification>,
|
|
toasts: Array<Toast>,
|
|
};
|
|
|
|
declare type WebNotification = {
|
|
active_at: string,
|
|
created_at: string,
|
|
id: number,
|
|
is_app_readable: boolean,
|
|
is_device_notified: boolean,
|
|
is_emailed: boolean,
|
|
is_read: boolean,
|
|
is_seen: boolean,
|
|
notification_parameters: {
|
|
device: {
|
|
analytics_label: string,
|
|
image_url: string,
|
|
is_data_only: boolean,
|
|
name: string,
|
|
placeholders: ?string,
|
|
target: string,
|
|
text: string,
|
|
title: string,
|
|
type: string,
|
|
},
|
|
dynamic: {
|
|
comment_author: string,
|
|
comment_author_thumbnail?: string,
|
|
reply_author: string,
|
|
hash: string,
|
|
claim_title: string,
|
|
claim_thumbnail?: string,
|
|
comment?: string,
|
|
channel_url: string,
|
|
channel_thumbnail?: string,
|
|
},
|
|
email: {},
|
|
},
|
|
notification_rule: string,
|
|
type: string,
|
|
updated_at: string,
|
|
user_id: number,
|
|
group_count?: number,
|
|
};
|
|
|
|
declare type NotificationCategory = {
|
|
name: string,
|
|
types: ?Array<string>,
|
|
};
|