@fortawesome/free-regular-svg-icons#faEdit JavaScript Examples

The following examples show how to use @fortawesome/free-regular-svg-icons#faEdit. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LibraryAuthoringPage.jsx    From frontend-app-library-authoring with GNU Affero General Public License v3.0 5 votes vote down vote up
BlockPreviewBase = ({
  intl, block, view, canEdit, showPreviews, showDeleteModal,
  setShowDeleteModal, library, previewKey, editView, isLtiUrlGenerating,
  ...props
}) => (
  <>
    <Navbar className="border">
      <Navbar.Brand>{block.display_name}</Navbar.Brand>
      <Navbar.Collapse className="justify-content-end">
        { library.allow_lti && (
          <>
            <Button disabled={isLtiUrlGenerating} size="lg" className="mr-1" onClick={() => { props.fetchBlockLtiUrl({ blockId: block.id }); }}>
              <FontAwesomeIcon icon={faClipboard} className="pr-1" />
              {intl.formatMessage(messages['library.detail.block.copy_lti_url'])}
            </Button>
          </>
        )}
        <Link to={editView}>
          <Button size="lg" className="mr-1">
            <FontAwesomeIcon icon={faEdit} className="pr-1" />
            {intl.formatMessage(messages['library.detail.block.edit'])}
          </Button>
        </Link>
        { /* Studio has a copy button, but we don't yet. */}
        <Button
          aria-label={intl.formatMessage(messages['library.detail.block.delete'])}
          size="lg"
          onClick={() => setShowDeleteModal(true)}
        >
          <FontAwesomeIcon icon={faTrashAlt} />
        </Button>
      </Navbar.Collapse>
    </Navbar>
    <Modal
      open={showDeleteModal}
      title={intl.formatMessage(messages['library.detail.block.delete.modal.title'])}
      onClose={() => setShowDeleteModal(false)}
      body={(
        <div>
          <p>
            {intl.formatMessage(messages['library.detail.block.delete.modal.body'])}
          </p>
        </div>
      )}
      buttons={[
        <Button
          onClick={() => props.deleteLibraryBlock({ blockId: block.id })}
        >
          {intl.formatMessage(commonMessages['library.common.forms.button.yes'])}
        </Button>,
      ]}
    />
    {showPreviews && (
      <Card>
        <Card.Body>
          <LibraryBlock getHandlerUrl={getHandlerUrl} view={view} key={previewKey} />
        </Card.Body>
      </Card>
    )}
  </>
)