美文网首页
SoundTab---propTypes

SoundTab---propTypes

作者: hanxianshe_9530 | 来源:发表于2019-10-30 08:25 被阅读0次
    SoundTab.propTypes = {
        dispatchUpdateRestore: PropTypes.func,
        editingTarget: PropTypes.string,
        intl: intlShape,
        isRtl: PropTypes.bool,
        onActivateCostumesTab: PropTypes.func.isRequired,
        onCloseImporting: PropTypes.func.isRequired,
        onNewSoundFromLibraryClick: PropTypes.func.isRequired,
        onNewSoundFromRecordingClick: PropTypes.func.isRequired,
        onRequestCloseSoundLibrary: PropTypes.func.isRequired,
        onShowImporting: PropTypes.func.isRequired,
        soundLibraryVisible: PropTypes.bool,
        soundRecorderVisible: PropTypes.bool,
        sprites: PropTypes.shape({
            id: PropTypes.shape({
                sounds: PropTypes.arrayOf(PropTypes.shape({
                    name: PropTypes.string.isRequired
                }))
            })
        }),
        stage: PropTypes.shape({
            sounds: PropTypes.arrayOf(PropTypes.shape({
                name: PropTypes.string.isRequired
            }))
        }),
        vm: PropTypes.instanceOf(VM).isRequired
    };
    
    const mapStateToProps = state => ({
        editingTarget: state.scratchGui.targets.editingTarget,
        isRtl: state.locales.isRtl,
        sprites: state.scratchGui.targets.sprites,
        stage: state.scratchGui.targets.stage,
        soundLibraryVisible: state.scratchGui.modals.soundLibrary,
        soundRecorderVisible: state.scratchGui.modals.soundRecorder
    });
    
    const mapDispatchToProps = dispatch => ({
        onActivateCostumesTab: () => dispatch(activateTab(COSTUMES_TAB_INDEX)),
        onNewSoundFromLibraryClick: e => {
            e.preventDefault();
            dispatch(openSoundLibrary());
        },
        onNewSoundFromRecordingClick: () => {
            dispatch(openSoundRecorder());
        },
        onRequestCloseSoundLibrary: () => {
            dispatch(closeSoundLibrary());
        },
        dispatchUpdateRestore: restoreState => {
            dispatch(setRestore(restoreState));
        },
        onCloseImporting: () => dispatch(closeAlertWithId('importingAsset')),
        onShowImporting: () => dispatch(showStandardAlert('importingAsset'))
    });
    
    export default errorBoundaryHOC('Sound Tab')(
        injectIntl(connect(
            mapStateToProps,
            mapDispatchToProps
        )(SoundTab))
    );
    

    相关文章

      网友评论

          本文标题:SoundTab---propTypes

          本文链接:https://www.haomeiwen.com/subject/zthnvctx.html