UNPKG

substance

Version:

Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing system. It is developed to power our online editing platform [Substance](http://substance.io).

17 lines (15 loc) 519 B
import { $$ } from '../dom' import { Form, FormRow, Input, Modal } from '../ui' export default function LinkModal (props) { const { node, mode } = props const confirmLabel = mode === 'edit' ? 'Update Link' : 'Create Link' const value = mode === 'edit' ? node.href : '' const modalProps = { cancelLabel: 'Cancel', confirmLabel, size: 'small' } return $$(Modal, modalProps, $$(Form, {}, $$(FormRow, { label: 'Link URL' }, $$(Input, { autofocus: true, value }).ref('href') ) ) ) }