@cloudflare-apps/promotional-elements
Last updated 3 years ago by teffenellis .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @cloudflare-apps/promotional-elements 
SYNC missed versions from official npm registry.

Promotional Elements

Drop in elements to showcase Cloudflare Apps!

Adding elements via Iframe (Recommended)

<iframe
  ref="iframe"
  src="https://promotional-elements.appstore.cfdata.org/pages/related-apps-banner?utm_source=cf-dashboard&app-category=analytics&app-category=make-money-on-your-site"
  seamless
  width="100%"
  height="350"
  frameborder="0"
  style='background-color: transparent; border: 0 none transparent; padding: 0'
  allowTransparency="true" />

Adding iframe via React (Advanced)

This is useful if you have a React app and would like the benefits of iframe seperation, without managing an HTML element via strings.

yarn add @cloudflare-apps/promotional-elements
import React from 'react'
import RelatedAppsBannerIframe from '@cloudflare-apps/promotional-elements/components/related-apps-banner-iframe'

class MyReactApp extends React.Component {
  render () {
    return <div>
      <RelatedAppsBannerIframe categories={['analytics', 'make-money-on-your-site']} />
    </div>
  }
}

Adding specific components via React (Advanced)

Caution: this approach will allow styles from your site to affect the elements.

yarn add @cloudflare-apps/promotional-elements
import React from 'react'
import RelatedAppsBanner from '@cloudflare-apps/promotional-elements/components/related-apps-banner'

class MyReactApp extends React.Component {
  render () {
    return <div>
      <RelatedAppsBanner categories={['analytics', 'make-money-on-your-site']} />
    </div>
  }
}

Development Setup

npm install -g yarn
yarn
yarn start

Testable pages will be logged to the console.

Publishing new React components

Manually bump package.json version number. Then run the publish command:

yarn run publish-package

Deploying the static pages

yarn add @cloudflare-apps/promotional-elements

Static pages are present at node_modules/@cloudflare-apps/promotional-elements/pages You can test these via:

yarn add @cloudflare-apps/promotional-elements
cd node_modules/@cloudflare-apps/promotional-elements
python -m SimpleHTTPServer 8000

http://localhost:8000/pages/related-apps-banner/?app-category=analytics

Current Tags

  • 1.0.8                                ...           latest (3 years ago)

9 Versions

  • 1.0.8                                ...           3 years ago
  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (12)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |