npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-campaign

v1.0.4

Published

React Campaign for react module

Readme

react-campaign

React Campaign for react module

NPM JavaScript Style Guide

Install

npm install --save react-campaign

Usage

Campaign List

import React, { Component } from 'react'

import { Campaign } from "react-campaign";
import 'react-campaign/dist/index.css'

class Example extends Component {
  render() {
    return <Campaign 
      className=''
      campCreateBtnName="Start a Campaign"
      handleCreateCamp={handleCreateCamp}
      filterOption={filterOption}
      campaignList={campaignList}
      viewCampSummary={viewCampSummary}
      suspendedInfo={suspendedInfo}
      handleTabChange={handleTabChange}
      isActive={isActive}
      content={content}
      langData={langData}
    />
  }
}

Campaign Props

  • campCreateBtnName : add your create button name
  • handleCreateCamp: redirect create account screen routes set
  • filterOption: add your tab filter option
  • campaignList: campaign list data
  • viewCampSummary: redirect to summary page
  • suspendedInfo: suspended Info text
  • handleTabChange: tab value change
  • isActive: active tabe value
  • content: add your other content
  • langData: add your language data

Language file look like

{
  "rc": {
    "VIEW": "View",
    "NO_CAMPAIGN": "No Campaign",
    "CAMPAIGN_STATUS": "Campaign Status",
    "VIEW_CAMP_DETAIL": "View Campaign Detail",
    "END_CAMP": "End Campaign",
    "ARE_YOU_SURE_END_CAMAPIGN": "Are you sure to end this campaign?",
    "CANCEL": "Cancel",
    "OKAY": "Okay",
    "EXPIRY": "Expiry",
    "DEFAULT_CARD": "Default Card",
    "ADD_CARD": "Add Card",
    "EDIT_CARD": "Edit Card",
    "DELETE_CARD": "Delete Card",
    "ARE_YOU_SURE_DELETE_CARD": "Are you sure to delete this card?"
  }
}

array/object required key

const filterOption = [
    {
      id: 1,
      name: "Campaigns - Running",
      value: "active",
      bgColor: "RGB(28 154 108/10%)",
      color: "#1c9a6c",
    },
    ....
]

const campaignList =[
    {
      _id: 20,
      adv_image: advImg,
      adv_text: "test status for adv",
      adv_title: "Test status",
      adv_url: "https://google.com",
      created: "2023-02-28T06:24:00.000Z",
      status: "suspended",
      is_approved: 1,
      timezone: null,
      ....
    },
    ....
]

Campaign Create

import React, { Component } from 'react'

import { CreateCampaign } from "react-campaign";
import 'react-campaign/dist/index.css'

class Example extends Component {
  render() {
    return <CreateCampaign
      className=""
      createCampTitle="Start a Campaign"
      submitCampBtn="Submit Campaign"
      fields={fields}
      content={content}
      langData={langData}
    />
  }
}

Create Campaign Props

  • createCampTitle= campaign title
  • submitCampBtn= campaign submit button name
  • fields={fields}
  • content: add your other content

array/object required key

const fields = [
    {
      id: 1,
      title: "Campaign Display and Linking",
      inputField: [
        {
          inputType: "input",
          type: "input",
          label: "Campaign Title",
          name: "Campaign Title",
          placeholder: "Campaign Title",
          required: true,
          maxLength: 40,
        },
        {
          inputType: "select",
          type: "select",
          label: "Minimum Age",
          name: "Minimum Age",
          placeholder: "Minimum Age",
          required: true,
          options: [
            { label: "Select", value: "" },
          ],
        },
        {
          inputType: "static_content",
          content: [
            {
              info: `advertising charges at Cost Per Unique Click (CPUC). That is, you will only be charged when a user clicks on your ad, if they haven't clicked on your ad previously.`,
            }
          ],
        },
        {
          inputType: "policy_content",
          content: <Policy />,
        },
        ....
      ]
    },
    ....
  ]

inputType: input, textarea, image, select, radio, checkbox, static_content(for static info), policy_content

Campaign Summary

import React, { Component } from 'react'

import { CampSummary } from "react-campaign";
import 'react-campaign/dist/index.css'

class Example extends Component {
  render() {
    return <CampSummary
      summaryData={summaryData}
      summaryDataList={summaryDataList}
      campStatus={campStatus}
      viewCampNav={viewCampNav}
      handleEndCamp={handleEndCamp}
      content={content}
      langData={langData}
    />
  }
}

Campaign Payment Props

  • summaryData= summary data object
  • summaryDataList= show table data
  • campStatus = campaign status
  • viewCampNav = navigate your own path
  • handleEndCamp = end campaign
  • content: add your other content
  let summaryDataList = [
    { name: "Date/Time Ended", value: "Continuous" },
    { name: "Maximum Bid", value: "$1" },
   ....
  ];

  let campStatus =  {
    "id": 1,
    "name": "Current Campaign - Summary",
    "value": "active",
    "bgColor": "RGB(28 154 108/10%)",
    "color": "#1c9a6c"
}

Campaign Payment

import React, { Component } from 'react'

import { PaymentMethod } from "react-campaign";
import 'react-campaign/dist/index.css'

class Example extends Component {
  render() {
    return <PaymentMethod
      className=""
      campPaymentTitle="Payment Methods"
      addBtn="Add a new card"
      cardList={cardList}
      fields={fields}
      handleSubmit={handleSubmit}
      handleDeleteCard={handleDeleteCard}
      content={content}
      langData={langData}
    />
  }
}

Campaign Payment Props

  • campPaymentTitle= campaign Payment title
  • addBtn= add card button name
  • cardList = added your card list
  • handleSubmit = submit card details
  • handleDeleteCard = delete card details
  • content: add your other content
  let cardList = [
     {
      _id: 39,
      card_name: "Test card declined",
      card_no: "4000 **** **** 0341",
      card_type: "visa",
      cvv: "133",
      default: 1,
      exp_date: "2025-05",
      make_default: true,
      ....
    },
   ....
  ];

License

MIT © KaushikJnext