Remove unused props and selector calls.

This commit is contained in:
infinite-persistence 2021-10-08 13:51:38 +08:00
parent 5bcf89394e
commit aabfc41ce9
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
5 changed files with 5 additions and 12 deletions

View file

@ -2,7 +2,6 @@ import { connect } from 'react-redux';
import {
makeSelectClaimForUri,
makeSelectMetadataForUri,
makeSelectTagsForUri,
makeSelectClaimIsMine,
} from 'redux/selectors/claims';
import { makeSelectPendingAmountByUri } from 'redux/selectors/wallet';
@ -15,7 +14,6 @@ const select = (state, props) => ({
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
metadata: makeSelectMetadataForUri(props.uri)(state),
user: selectUser(state),
tags: makeSelectTagsForUri(props.uri)(state),
pendingAmount: makeSelectPendingAmountByUri(props.uri)(state),
});

View file

@ -16,7 +16,6 @@ type Props = {
claim: StreamClaim,
metadata: StreamMetadata,
user: ?any,
tags: any,
pendingAmount: number,
doOpenModal: (id: string, {}) => void,
claimIsMine: boolean,

View file

@ -8,7 +8,7 @@ import {
selectAbandonClaimSupportError,
} from 'redux/selectors/wallet';
import { makeSelectMetadataForUri, makeSelectClaimForUri } from 'redux/selectors/claims';
import { makeSelectClaimForUri } from 'redux/selectors/claims';
import { doSupportAbandonForClaim } from 'redux/actions/wallet';
import SupportsLiquidate from './view';
@ -19,7 +19,6 @@ const select = (state, props) => ({
supportsBalance: selectSupportsBalance(state) || undefined,
tipsBalance: selectTipsBalance(state) || undefined,
claim: makeSelectClaimForUri(props.uri)(state),
metadata: makeSelectMetadataForUri(props.uri)(state),
abandonClaimError: selectAbandonClaimSupportError(state),
});

View file

@ -15,7 +15,6 @@ type Props = {
supportsBalance: number,
tipsBalance: number,
claim: any,
metaData: any,
handleClose: () => void,
abandonSupportForClaim: (string, string, boolean | string, boolean) => any,
abandonClaimError: ?string,
@ -37,14 +36,14 @@ const SupportsLiquidate = (props: Props) => {
useEffect(() => {
if (claimId && abandonSupportForClaim) {
abandonSupportForClaim(claimId, type, false, true).then(r => {
abandonSupportForClaim(claimId, type, false, true).then((r) => {
setPreviewBalance(r.total_input);
});
}
}, [abandonSupportForClaim, claimId, type, setPreviewBalance]);
function handleSubmit() {
abandonSupportForClaim(claimId, type, keep, false).then(r => {
abandonSupportForClaim(claimId, type, keep, false).then((r) => {
if (r) {
handleClose();
}
@ -141,7 +140,7 @@ const SupportsLiquidate = (props: Props) => {
step={0.01}
max={previewBalance}
value={Number(amount) >= 0 ? amount : previewBalance / 4} // by default, set it to 25% of available
onChange={e => handleChange(e.target.value)}
onChange={(e) => handleChange(e.target.value)}
/>
<label className="range__label">
<span>0</span>
@ -152,7 +151,7 @@ const SupportsLiquidate = (props: Props) => {
type="text"
value={amount >= 0 ? amount || '' : previewBalance && previewBalance / 4}
helper={message}
onChange={e => handleChange(e.target.value)}
onChange={(e) => handleChange(e.target.value)}
/>
</Form>
)}

View file

@ -2,7 +2,6 @@ import { connect } from 'react-redux';
import { doSetContentHistoryItem, doSetPrimaryUri, clearPosition } from 'redux/actions/content';
import { withRouter } from 'react-router-dom';
import {
makeSelectMetadataForUri,
makeSelectClaimIsNsfw,
makeSelectTagInClaimOrChannelForUri,
makeSelectClaimIsStreamPlaceholder,
@ -27,7 +26,6 @@ const select = (state, props) => {
return {
linkedCommentId: urlParams.get('lc'),
costInfo: makeSelectCostInfoForUri(props.uri)(state),
metadata: makeSelectMetadataForUri(props.uri)(state),
obscureNsfw: !selectShowMatureContent(state),
isMature: makeSelectClaimIsNsfw(props.uri)(state),
fileInfo: makeSelectFileInfoForUri(props.uri)(state),