fixed yarn lint errors
This commit is contained in:
parent
a45d91deb5
commit
02600d3bb2
5 changed files with 36 additions and 42 deletions
|
@ -13,30 +13,30 @@ type Props = {
|
|||
doToast: ({ message: string }) => void,
|
||||
};
|
||||
|
||||
|
||||
export default function ClaimRepostButton(props: Props) {
|
||||
const { uri, claim, hasChannels, doOpenModal, doToast } = props;
|
||||
const { uri, claim, hasChannels, doOpenModal, doToast } = props;
|
||||
|
||||
return (
|
||||
<Button
|
||||
button="alt"
|
||||
className="button--file-action"
|
||||
icon={ICONS.REPOST}
|
||||
label={
|
||||
claim.meta.reposted > 1 ? __(`%repost_total% Reposts`, { repost_total: claim.meta.reposted }) : __('Repost')
|
||||
}
|
||||
description={__('Repost')}
|
||||
requiresAuth={IS_WEB}
|
||||
onClick={() => {
|
||||
if (!hasChannels) {
|
||||
doToast({
|
||||
message: __('A channel is required to repost on %SITE_NAME%', { SITE_NAME }),
|
||||
linkText: __('Create Channel'),
|
||||
linkTarget: '/channel/new',
|
||||
});
|
||||
} else {
|
||||
doOpenModal(MODALS.REPOST, { uri })
|
||||
}}}
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<Button
|
||||
button="alt"
|
||||
className="button--file-action"
|
||||
icon={ICONS.REPOST}
|
||||
label={
|
||||
claim.meta.reposted > 1 ? __(`%repost_total% Reposts`, { repost_total: claim.meta.reposted }) : __('Repost')
|
||||
}
|
||||
description={__('Repost')}
|
||||
requiresAuth={IS_WEB}
|
||||
onClick={() => {
|
||||
if (!hasChannels) {
|
||||
doToast({
|
||||
message: __('A channel is required to repost on %SITE_NAME%', { SITE_NAME }),
|
||||
linkText: __('Create Channel'),
|
||||
linkTarget: '/channel/new',
|
||||
});
|
||||
} else {
|
||||
doOpenModal(MODALS.REPOST, { uri });
|
||||
}
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// @flow
|
||||
import { SITE_NAME, ENABLE_FILE_REACTIONS } from 'config';
|
||||
import { ENABLE_FILE_REACTIONS } from 'config';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import * as ICONS from 'constants/icons';
|
||||
|
@ -28,8 +28,6 @@ type Props = {
|
|||
costInfo: ?{ cost: number },
|
||||
renderMode: string,
|
||||
myChannels: ?Array<ChannelClaim>,
|
||||
doToast: ({ message: string }) => void,
|
||||
clearPlayingUri: () => void,
|
||||
hideRepost?: boolean,
|
||||
reactionsDisabled: boolean,
|
||||
download: (string) => void,
|
||||
|
@ -47,14 +45,12 @@ function FileActions(props: Props) {
|
|||
renderMode,
|
||||
prepareEdit,
|
||||
myChannels,
|
||||
clearPlayingUri,
|
||||
doToast,
|
||||
hideRepost,
|
||||
reactionsDisabled,
|
||||
} = props;
|
||||
const {
|
||||
push,
|
||||
location: { pathname, search },
|
||||
location: { search },
|
||||
} = useHistory();
|
||||
const isMobile = useIsMobile();
|
||||
const webShareable = costInfo && costInfo.cost === 0 && RENDER_MODES.WEB_SHAREABLE_MODES.includes(renderMode);
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
import * as ICONS from 'constants/icons';
|
||||
import { MINIMUM_PUBLISH_BID, INVALID_NAME_ERROR } from 'constants/claim';
|
||||
import React from 'react';
|
||||
import { useHistory } from 'react-router';
|
||||
import Card from 'component/common/card';
|
||||
import Button from 'component/button';
|
||||
import ChannelSelector from 'component/channelSelector';
|
||||
|
@ -80,7 +79,6 @@ function RepostCreate(props: Props) {
|
|||
const [repostUri, setRepostUri] = React.useState('');
|
||||
const [contentError, setContentError] = React.useState('');
|
||||
|
||||
const { replace, goBack } = useHistory();
|
||||
const resolvingRepost = isResolvingEnteredRepost || isResolvingPassedRepost;
|
||||
const repostUrlName = `lbry://${incognito || !activeChannelClaim ? '' : `${activeChannelClaim.name}/`}`;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import { doHideModal } from 'redux/actions/app';
|
|||
import ModalRepost from './view';
|
||||
|
||||
const perform = dispatch => ({
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
})
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
});
|
||||
|
||||
export default connect(null, perform)(ModalRepost);
|
||||
|
|
|
@ -9,15 +9,15 @@ type Props = {
|
|||
}
|
||||
|
||||
class ModalRepost extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const { closeModal, uri } = this.props;
|
||||
render() {
|
||||
const { closeModal, uri } = this.props;
|
||||
|
||||
return (
|
||||
<Modal onAborted={closeModal} isOpen type="card">
|
||||
<RepostCreate uri={uri} name={null} onCancel={closeModal} />
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Modal onAborted={closeModal} isOpen type="card">
|
||||
<RepostCreate uri={uri} name={null} onCancel={closeModal} />
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ModalRepost;
|
||||
|
|
Loading…
Add table
Reference in a new issue