How to use the contentful-ui-extensions-sdk.locations.LOCATION_ENTRY_FIELD function in contentful-ui-extensions-sdk

To help you get started, we’ve selected a few contentful-ui-extensions-sdk examples, based on popular ways it is used in public projects.

github contentful / ui-extensions-sdk / test / extensions / test-extension / src / index.js View on Github external
init(sdk => {
  window.sdk = sdk
  if (sdk.location.is(locations.LOCATION_ENTRY_FIELD)) {
    renderExtension(<FieldExtension sdk={sdk} />)
  } else if (sdk.location.is(locations.LOCATION_PAGE)) {
    renderExtension(<PageExtension sdk={sdk} />)
  } else if (sdk.location.is(locations.LOCATION_ENTRY_SIDEBAR)) {
    renderExtension(<SidebarExtension sdk={sdk} />)
  } else if (sdk.location.is(locations.LOCATION_ENTRY_EDITOR)) {
    renderExtension(<EntryEditorExtension sdk={sdk} />)
  } else if (sdk.location.is(locations.LOCATION_DIALOG)) {
    renderExtension(<DialogExtension sdk={sdk} />)
  }
})
github contentful / extensions / lib / shared-dam-app / src / index.tsx View on Github external
init(sdk => {
    const root = document.getElementById('root');

    if (sdk.location.is(locations.LOCATION_DIALOG)) {
      integration.renderDialog(sdk as DialogExtensionSDK);
    }

    if (sdk.location.is(locations.LOCATION_ENTRY_FIELD)) {
      render(
        <Field
          sdk={sdk as FieldExtensionSDK}
          cta={integration.cta}
          logo={integration.logo}
          makeThumbnail={integration.makeThumbnail}
          openDialog={integration.openDialog}
          isDisabled={integration.isDisabled}
        />,
        root
      );
    }

    if (sdk.location.is(locations.LOCATION_APP)) {
      render(
        <AppConfig
github contentful / extensions / marketplace / commercetools-products / src / index.js View on Github external
init(extension => {
  const installationParameters = extension.parameters.installation;
  extension.window.startAutoResizer();

  if (extension.location.is(locations.LOCATION_ENTRY_FIELD)) {
    ReactDOM.render(
      <CommerceToolsField
        extension={extension}
        parameters={installationParameters}
        isSingle={extension.field.type === 'Symbol'}
      />,
      document.getElementById('root')
    );
  } else if (extension.location.is(locations.LOCATION_DIALOG)) {
    ReactDOM.render(
      <CommerceToolsDialog
        extension={extension}
        parameters={installationParameters}
        isSingle={extension.parameters.invocation.isSingle}
      />,
      document.getElementById('root')