UNPKG

@craftercms/studio-ui

Version:

Services, components, models & utils to build CrafterCMS authoring extensions.

70 lines (68 loc) 2.77 kB
/* * Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* * Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import { FormattedMessage } from 'react-intl'; import DialogBody from '../DialogBody/DialogBody'; import NewRemoteRepositoryForm from '../NewRemoteRepositoryForm/NewRemoteRepositoryForm'; import DialogFooter from '../DialogFooter/DialogFooter'; import React from 'react'; import SecondaryButton from '../SecondaryButton'; import PrimaryButton from '../PrimaryButton'; export function NewRemoteRepositoryDialogUI(props) { const { inputs, setInputs, isSubmitting, isValid, onCloseButtonClick, onCreate } = props; const onSubmit = (e) => { e.preventDefault(); onCreate(); }; return React.createElement( 'form', { onSubmit: onSubmit, noValidate: true }, React.createElement( DialogBody, null, React.createElement(NewRemoteRepositoryForm, { inputs: inputs, setInputs: setInputs }) ), React.createElement( DialogFooter, null, React.createElement( SecondaryButton, { onClick: onCloseButtonClick, disabled: isSubmitting }, React.createElement(FormattedMessage, { id: 'words.cancel', defaultMessage: 'Cancel' }) ), React.createElement( PrimaryButton, { type: 'submit', disabled: isSubmitting || !isValid, loading: isSubmitting }, React.createElement(FormattedMessage, { id: 'words.create', defaultMessage: 'Create' }) ) ) ); } export default NewRemoteRepositoryDialogUI;