From 02600d3bb2bb448a3565a5927557077dc11e211c Mon Sep 17 00:00:00 2001 From: Bradley Ray <bradleyr320@gmail.com> Date: Sat, 11 Dec 2021 01:20:19 -0600 Subject: [PATCH] fixed yarn lint errors --- ui/component/claimRepostButton/view.jsx | 48 ++++++++++++------------- ui/component/fileActions/view.jsx | 8 ++--- ui/component/repostCreate/view.jsx | 2 -- ui/modal/modalRepost/index.js | 4 +-- ui/modal/modalRepost/view.jsx | 16 ++++----- 5 files changed, 36 insertions(+), 42 deletions(-) diff --git a/ui/component/claimRepostButton/view.jsx b/ui/component/claimRepostButton/view.jsx index 645e16605..accecf6ff 100644 --- a/ui/component/claimRepostButton/view.jsx +++ b/ui/component/claimRepostButton/view.jsx @@ -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 }); + } + }} + /> + ); } diff --git a/ui/component/fileActions/view.jsx b/ui/component/fileActions/view.jsx index 2ffdafe65..f2c9aeb63 100644 --- a/ui/component/fileActions/view.jsx +++ b/ui/component/fileActions/view.jsx @@ -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); diff --git a/ui/component/repostCreate/view.jsx b/ui/component/repostCreate/view.jsx index b8c7b51b2..09a29f3ab 100644 --- a/ui/component/repostCreate/view.jsx +++ b/ui/component/repostCreate/view.jsx @@ -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}/`}`; diff --git a/ui/modal/modalRepost/index.js b/ui/modal/modalRepost/index.js index 718a3984c..6e3890cac 100644 --- a/ui/modal/modalRepost/index.js +++ b/ui/modal/modalRepost/index.js @@ -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); diff --git a/ui/modal/modalRepost/view.jsx b/ui/modal/modalRepost/view.jsx index e69b2d1d4..e51d34c6e 100644 --- a/ui/modal/modalRepost/view.jsx +++ b/ui/modal/modalRepost/view.jsx @@ -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;