ffdb5abf63
* Save * Save * Add pulse * Adjust footer ad * Adjust tile ad * Adjust tile ad hover * Fix premium badge alignment in tile grid * Adjust livestream icon * Adjust livestream icon * Save scheduled livestreasm & tile ad * Fix scheduled callback * Fix playlist icon size on file page * Fix grid distortion in 3 & 4 column layout * - * Fix grid on category & channel page * Fix Premium Plus Grid * Add custom tile for adblockers * Reset env * Remove collapsed tiles * Remove setLoaded on scheduled livestreams page * - * Make isHidden optional * Remove px * Review adjustments * Inject Premium+ ads * Fix injection * Fix injection when using the last tile * Fix injection when using the last tile * Enable stripe dev * Create PremiumPlusTile component and add list view design * Create PremiumPlusTile component and add list view design * Adjust ads in list view * Remove setState from render loop * Clean code * Fix livestream margin in list view * Rewrite & tune some logic - Homepage & Channel page * Clean details... * Clean details... * Requested review changes Signed-off-by: Raphael Wickihalder <raphael.wickihalder@odysee.com> * Requested review changes Signed-off-by: Raphael Wickihalder <raphael.wickihalder@odysee.com>
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
// @flow
|
|
import * as MODALS from 'constants/modal_types';
|
|
import * as ICONS from 'constants/icons';
|
|
import React from 'react';
|
|
import Button from 'component/button';
|
|
import classnames from 'classnames';
|
|
import Tooltip from 'component/common/tooltip';
|
|
|
|
type Props = {
|
|
uri: string,
|
|
fileAction?: boolean,
|
|
type?: boolean,
|
|
// redux
|
|
streamType: Claim,
|
|
isSaved: boolean,
|
|
doOpenModal: (id: string, {}) => void,
|
|
};
|
|
|
|
export default function CollectionAddButton(props: Props) {
|
|
const { uri, fileAction, type = 'playlist', isSaved, streamType, doOpenModal } = props;
|
|
|
|
const isPlayable = streamType === 'video' || streamType === 'audio';
|
|
|
|
return !isPlayable ? null : (
|
|
<Tooltip title={__('Add this claim to a list')} arrow={false}>
|
|
<Button
|
|
button={!fileAction ? 'alt' : undefined}
|
|
className={classnames({ 'button--file-action': fileAction })}
|
|
icon={fileAction ? (!isSaved ? ICONS.ADD : ICONS.STACK) : ICONS.LIBRARY}
|
|
iconSize={fileAction ? 16 : undefined}
|
|
label={uri ? (!isSaved ? __('Save') : __('Saved')) : __('New List')}
|
|
requiresAuth
|
|
onClick={(e) => {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
doOpenModal(MODALS.COLLECTION_ADD, { uri, type });
|
|
}}
|
|
/>
|
|
</Tooltip>
|
|
);
|
|
}
|