How to use the @alifd/next.Form.Submit function in @alifd/next

To help you get started, we’ve selected a few @alifd/next examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alibaba / ice / packages / iceworks-client / src / components / CreateProjectModal / index.js View on Github external
import React, { useState, useEffect } from 'react';
import cx from 'classnames';
import socket from '@src/socket';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { Form, Input, Button } from '@alifd/next';
import Modal from '@components/Modal';
import Icon from '@components/Icon';
import SelectWorkFolderModal from '@components/SelectWorkFolderModal';
import useModal from '@hooks/useModal';
import styles from './index.module.scss';

const FormItem = Form.Item;
const FormSubmit = Form.Submit;

const formItemLayout = {
  labelCol: {
    fixedSpan: 5,
  },
};

const CreateProjectModal = ({ on, onCancel, onOk, isBiz, loading }) => {
  const {
    on: onSelectModal,
    setModal: setSelectModal,
  } = useModal();
  const [data, setData] = useState({ name: '', appId: '', changeId: '', path: '', workFolder: '' });

  function onSave(values, errors) {
    if (!errors) {