美文网首页
CostumeTab---propTypes

CostumeTab---propTypes

作者: hanxianshe_9530 | 来源:发表于2019-10-30 08:25 被阅读0次
    CostumeTab.propTypes = {
        cameraModalVisible: PropTypes.bool,
        dispatchUpdateRestore: PropTypes.func,
        editingTarget: PropTypes.string,
        intl: intlShape,
        isRtl: PropTypes.bool,
        onActivateSoundsTab: PropTypes.func.isRequired,
        onCloseImporting: PropTypes.func.isRequired,
        onNewCostumeFromCameraClick: PropTypes.func.isRequired,
        onNewLibraryBackdropClick: PropTypes.func.isRequired,
        onNewLibraryCostumeClick: PropTypes.func.isRequired,
        onRequestCloseCameraModal: PropTypes.func.isRequired,
        onShowImporting: PropTypes.func.isRequired,
        sprites: PropTypes.shape({
            id: PropTypes.shape({
                costumes: PropTypes.arrayOf(PropTypes.shape({
                    url: PropTypes.string,
                    name: PropTypes.string.isRequired,
                    skinId: PropTypes.number
                }))
            })
        }),
        stage: PropTypes.shape({
            sounds: PropTypes.arrayOf(PropTypes.shape({
                name: PropTypes.string.isRequired
            }))
        }),
        vm: PropTypes.instanceOf(VM)
    };
    
    const mapStateToProps = state => ({
        editingTarget: state.scratchGui.targets.editingTarget,
        isRtl: state.locales.isRtl,
        sprites: state.scratchGui.targets.sprites,
        stage: state.scratchGui.targets.stage,
        dragging: state.scratchGui.assetDrag.dragging,
        cameraModalVisible: state.scratchGui.modals.cameraCapture
    });
    
    const mapDispatchToProps = dispatch => ({
        onActivateSoundsTab: () => dispatch(activateTab(SOUNDS_TAB_INDEX)),
        onNewLibraryBackdropClick: e => {
            e.preventDefault();
            dispatch(openBackdropLibrary());
        },
        onNewLibraryCostumeClick: e => {
            e.preventDefault();
            dispatch(openCostumeLibrary());
        },
        onNewCostumeFromCameraClick: () => {
            dispatch(openCameraCapture());
        },
        onRequestCloseCameraModal: () => {
            dispatch(closeCameraCapture());
        },
        dispatchUpdateRestore: restoreState => {
            dispatch(setRestore(restoreState));
        },
        onCloseImporting: () => dispatch(closeAlertWithId('importingAsset')),
        onShowImporting: () => dispatch(showStandardAlert('importingAsset'))
    });
    
    export default errorBoundaryHOC('Costume Tab')(
        injectIntl(connect(
            mapStateToProps,
            mapDispatchToProps
        )(CostumeTab))
    );
    

    相关文章

      网友评论

          本文标题:CostumeTab---propTypes

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