mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
lint fixes
This commit is contained in:
parent
4bf7a2d307
commit
5811332cd7
5 changed files with 20 additions and 20 deletions
|
@ -149,8 +149,8 @@ module.exports.selectMuteStatus = state => get(state, ['session', 'session', 'pe
|
|||
module.exports.selectIsMuted = state => (module.exports.selectMuteStatus(state).muteExpiresAt || 0) * 1000 > Date.now();
|
||||
module.exports.selectNewStudiosLaunched = state => get(state, ['session', 'session', 'flags', 'new_studios_launched'],
|
||||
false);
|
||||
module.exports.selectStudioTransferLaunched = state => get(state, ['session', 'session', 'flags', 'studio_transfer_launched'],
|
||||
false);
|
||||
module.exports.selectStudioTransferLaunched = state => get(state, ['session', 'session', 'flags',
|
||||
'studio_transfer_launched'], false);
|
||||
|
||||
module.exports.selectHasFetchedSession = state => state.session.status === module.exports.Status.FETCHED;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, {useEffect} from 'react';
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {connect} from 'react-redux';
|
||||
import {FormattedMessage} from 'react-intl';
|
||||
|
@ -24,6 +24,9 @@ const TransferOwnershipConfirmation = ({
|
|||
}) => {
|
||||
const currentOwnerUsername = items.find(item => item.id === userId).username;
|
||||
const newOwnerUsername = items.find(item => item.id === selectedId).username;
|
||||
const handleSubmit = formData => {
|
||||
handleTransfer(formData.password, newOwnerUsername, selectedId);
|
||||
};
|
||||
return (<div className="content">
|
||||
<ModalInnerContent
|
||||
className="inner"
|
||||
|
@ -47,9 +50,8 @@ const TransferOwnershipConfirmation = ({
|
|||
<FormattedMessage id="studio.transfer.confirmWithPassword" />
|
||||
</h3>
|
||||
<Form
|
||||
onSubmit={formData => {
|
||||
handleTransfer(formData.password, newOwnerUsername, selectedId);
|
||||
}}
|
||||
|
||||
onSubmit={handleSubmit} // eslint-disable-line react/jsx-no-bind
|
||||
>
|
||||
<Input
|
||||
required
|
||||
|
@ -83,9 +85,6 @@ const TransferOwnershipConfirmation = ({
|
|||
|
||||
TransferOwnershipConfirmation.propTypes = {
|
||||
handleBack: PropTypes.func,
|
||||
handleClose: PropTypes.func,
|
||||
handleNext: PropTypes.func,
|
||||
handleSelected: PropTypes.func,
|
||||
handleTransfer: PropTypes.func,
|
||||
items: PropTypes.arrayOf(PropTypes.shape({
|
||||
id: PropTypes.id,
|
||||
|
@ -96,8 +95,6 @@ TransferOwnershipConfirmation.propTypes = {
|
|||
})
|
||||
})
|
||||
})),
|
||||
moreToLoad: PropTypes.bool,
|
||||
onLoadMore: PropTypes.func,
|
||||
selectedId: PropTypes.number,
|
||||
userId: PropTypes.number
|
||||
};
|
||||
|
|
|
@ -35,18 +35,18 @@ const TransferOwnershipModal = ({
|
|||
/>
|
||||
{step === STEPS.info && <TransferOwnershipInfo
|
||||
handleClose={handleClose}
|
||||
handleNext={() => setStep(STEPS.selection)}
|
||||
handleNext={() => setStep(STEPS.selection)} // eslint-disable-line react/jsx-no-bind
|
||||
/>}
|
||||
{step === STEPS.selection && <TransferOwnershipSelection
|
||||
handleClose={handleClose}
|
||||
handleNext={() => setStep(STEPS.confirmation)}
|
||||
handleBack={() => setStep(STEPS.info)}
|
||||
handleNext={() => setStep(STEPS.confirmation)} // eslint-disable-line react/jsx-no-bind
|
||||
handleBack={() => setStep(STEPS.info)} // eslint-disable-line react/jsx-no-bind
|
||||
handleSelected={setSelectedId}
|
||||
selectedId={selectedId}
|
||||
/>}
|
||||
{step === STEPS.confirmation && <TransferOwnershipConfirmation
|
||||
handleClose={handleClose}
|
||||
handleBack={() => setStep(STEPS.selection)}
|
||||
handleBack={() => setStep(STEPS.selection)} // eslint-disable-line react/jsx-no-bind
|
||||
handleTransfer={handleTransfer}
|
||||
selectedId={selectedId}
|
||||
/>}
|
||||
|
@ -54,7 +54,8 @@ const TransferOwnershipModal = ({
|
|||
};
|
||||
|
||||
TransferOwnershipModal.propTypes = {
|
||||
handleClose: PropTypes.func
|
||||
handleClose: PropTypes.func,
|
||||
handleTransfer: PropTypes.func
|
||||
};
|
||||
|
||||
export default TransferOwnershipModal;
|
||||
|
|
|
@ -17,6 +17,7 @@ const TransferOwnershipSelection = ({
|
|||
handleSelected,
|
||||
handleNext,
|
||||
handleBack,
|
||||
onLoadMore,
|
||||
items,
|
||||
userId,
|
||||
selectedId
|
||||
|
@ -39,7 +40,7 @@ const TransferOwnershipSelection = ({
|
|||
userId !== item.id &&
|
||||
(<TransferOwnershipTile
|
||||
key={item.username}
|
||||
handleSelected={() => handleSelected(item.id)}
|
||||
handleSelected={() => handleSelected(item.id)} // eslint-disable-line react/jsx-no-bind
|
||||
id={item.id}
|
||||
username={item.username}
|
||||
image={item.profile.images['90x90']}
|
||||
|
@ -94,7 +95,7 @@ TransferOwnershipSelection.propTypes = {
|
|||
})
|
||||
})
|
||||
})),
|
||||
moreToLoad: PropTypes.bool,
|
||||
// moreToLoad: PropTypes.bool,
|
||||
onLoadMore: PropTypes.func,
|
||||
selectedId: PropTypes.number,
|
||||
userId: PropTypes.number
|
||||
|
|
|
@ -30,7 +30,8 @@ import removeIcon from './icons/remove-icon.svg';
|
|||
import promoteIcon from './icons/curator-icon.svg';
|
||||
|
||||
const StudioMemberTile = ({
|
||||
canRemove, canPromote, onRemove, canTransferOwnership, onPromote, onTransferOwnership, isCreator, hasReachedManagerLimit, // mapState props
|
||||
canRemove, canPromote, onRemove, canTransferOwnership, onPromote, onTransferOwnership,
|
||||
isCreator, hasReachedManagerLimit, // mapState props
|
||||
username, image // own props
|
||||
}) => {
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
@ -135,7 +136,7 @@ const StudioMemberTile = ({
|
|||
<TransferOwnershipModal
|
||||
handleClose={() => setTransferOwnershipModalOpen(false)}
|
||||
handleTransfer={(password, newOwnerUsername, newOwnerUsernameId) => {
|
||||
onTransferOwnership(/* password, */newOwnerUsername, newOwnerUsernameId)
|
||||
onTransferOwnership(/* password, */ newOwnerUsername, newOwnerUsernameId)
|
||||
.then(() => {
|
||||
setTransferOwnershipModalOpen(false);
|
||||
successAlert({
|
||||
|
|
Loading…
Reference in a new issue