How to use the scrivito.connect function in scrivito

To help you get started, we’ve selected a few scrivito 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 Scrivito / scrivito_example_app_js / src / Components / Navigation / NavigationSection.js View on Github external
const obj = Scrivito.currentPage();
  if (!obj.get("navigationSection")) {
    return null;
  }

  return (
    
  );
}

export default Scrivito.connect(NavigationSection);
github Scrivito / scrivito_example_app_js / src / Components / Navigation / Nav.js View on Github external
renderChild={child => (
          
        )}
      />
    );
  }
}

export default Scrivito.connect(Nav);
github Scrivito / scrivito_example_app_js / src / Components / Navigation / Logo.js View on Github external
function Logo({ scrolled, navigationStyle }) {
  if (!Scrivito.Obj.root()) {
    return null;
  }

  const logo = logoObj({ scrolled, navigationStyle });

  return (
    
      
    
  );
}

export default Scrivito.connect(Logo);
github Scrivito / scrivito_example_app_js / src / Objs / Job / JobComponent.js View on Github external
);
  }

  return (
    <h2>
      <i title="date" aria-hidden="true">{" "}
      <span>Valid through: </span>
      
        {formatDate(validThrough, "mm/dd/yyyy")}
      
    </i></h2><i title="date" aria-hidden="true">
  );
});

const JobEmploymentTypes = Scrivito.connect(({ employmentTypes }) =&gt; {
  if (!employmentTypes || employmentTypes.length === 0) {
    return (
      
        Select one or more employment types in the job page properties.
      
    );
  }

  const localizations = {
    FULL_TIME: "full-time",
    PART_TIME: "part-time",
    CONTRACTOR: "contractor",
    TEMPORARY: "temporary",
    INTERN: "intern",
    VOLUNTEER: "volunteer",
    PER_DIEM: "per diem",</i>
github Scrivito / scrivito_example_app_js / src / Widgets / EventOverviewWidget / EventOverviewWidgetComponent.js View on Github external
);
  }

  setTag(tag) {
    this.setState({
      currentTag: tag,
    });
  }
}

Scrivito.provideComponent("EventOverviewWidget", EventOverviewWidgetComponent);

const EventItem = Scrivito.connect(({ event }) =&gt; (
  <div>
    
      
        <span>
          {formatDate(event.get("date"), "mm/dd")}</span></div>
github Scrivito / scrivito_example_app_js / src / Widgets / LinkContainerWidget / LinkContainerWidgetComponent.js View on Github external
import InPlaceEditingPlaceholder from "../../Components/InPlaceEditingPlaceholder";
import "./LinkContainerWidget.scss";

Scrivito.provideComponent("LinkContainerWidget", ({ widget }) =&gt; (
  
    
    
  
));

const Headline = Scrivito.connect(({ widget }) =&gt; {
  const headline = widget.get("headline");

  if (!headline) {
    return (
      
        Optional: Provide a headline in the widget properties.
      
    );
  }

  return (
    <div>
      {widget.get("headline")}
    </div>
  );
});
github Scrivito / scrivito_example_app_js / src / Components / BlogPost / BlogPostMorePosts.js View on Github external
return null;
  }

  return (
    <section>
      <div>
        <h1>
          More great blog posts from {author.get("title")}
        </h1>
        
      </div>
    </section>
  );
}

export default Scrivito.connect(BlogPostMorePosts);
github Scrivito / scrivito_example_app_js / src / Components / Navigation / NavChild.js View on Github external
classNames.push("open");
  }
  if (isActive(child)) {
    classNames.push("active");
  }

  return (
    <li>
      
        {child.get("title") || ""}
      
    </li>
  );
});

const Dropdown = Scrivito.connect(
  ({ child, open, toggleDropdown, ...otherProps }) =&gt; {
    const classNames = ["nav-item"];
    if (open) {
      classNames.push("open");
    }
    if (isActive(child)) {
      classNames.push("active");
    }

    return (
      <li>
        </li>
github Scrivito / scrivito_example_app_js / src / Widgets / LinkWidget / LinkWidgetComponent.js View on Github external
Provide a link in the widget properties.
        
      
    );
  }

  return (
    
      
        
      
    
  );
});

const LinkTitle = Scrivito.connect(({ link }) =&gt; {
  if (link.title()) {
    return link.title();
  }

  if (link.isInternal()) {
    return link.obj().get("title");
  }

  return link.url();
});
github Scrivito / scrivito_example_app_js / src / Widgets / ThumbnailGalleryWidget / ThumbnailGalleryWidgetComponent.js View on Github external
onClickNext={this.gotoNext}
            onClickPrev={this.gotoPrevious}
            onClickThumbnail={this.gotoImage}
            onClose={this.closeLightbox}
            showThumbnails
            backdropClosesModal
          /&gt;
        
      
    );
  }
}

Scrivito.provideComponent("ThumbnailGalleryWidget", ThumbnailGalleryComponent);

const Thumbnail = Scrivito.connect(({ widget, openLightbox, currentTag }) =&gt; {
  const title = widget.get("title");
  const subtitle = widget.get("subtitle");
  const image = widget.get("image");
  const tags = widget.get("tags");

  const classNames = [
    "col-md-3",
    "col-sm-4",
    "col-6",
    "gallery-box",
    "gutter0",
  ];
  if (currentTag &amp;&amp; !tags.includes(currentTag)) {
    classNames.push("squeezed");
  }

scrivito

Scrivito is a professional, yet easy to use SaaS Enterprise Content Management Service, built for digital agencies and medium to large businesses. It is completely maintenance-free, cost-effective, and has unprecedented performance and security.

LGPL-3.0
Latest version published 25 days ago

Package Health Score

68 / 100
Full package analysis