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 🙏

© 2024 – Pkg Stats / Ryan Hefner

sam-calendar

v0.1.4

Published

A modified version of the infinite calendar that shows a list of events

Downloads

8

Readme

Demo - https://dotunlonge.github.io/Sam-Calendar/

Usage

Install the script with yarn add sam-calendar or npm install sam-calendar

Example Initiationaliztion

import React from "react";
import { render } from "react-dom";	
import MyComponent from "sam-calendar";

class Demo extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      data: [
        {
          title: "rotten-firefox-54",
          date: "2018-07-08T07:00:00.000Z",
          toggled: false,
          description:
            "hot-fly-95 rude-ladybug-55 moody-skunk-73 smooth-turtle-61 popular-yak-26 cowardly-dodo-11 short-cheetah-60"
        },
        {
          title: "angry-sheep-15",
          date: "2018-07-23T07:00:00.000Z",
          toggled: false,
          description:
            "chilly-husky-24 good-cougar-40 heavy-grasshopper-93 tough-bullfrog-63 quiet-treefrog-81 thin-cat-83 soft-dragon-51"
        }
      ]
    };
  }

  handleToggle = event => {
    this.setState(p => {
      let index;

      p.data.map((e, i) => {
        if (e === event.raw) {
          return (index = i);
        }
      });

      p.data[index].toggled = !p.data[index].toggled;
      event.toggled = !event.toggled;

      return {
        data: p.data
      };
    });
  };

  render() {
    const { data } = this.state;

    return (
      <div>
        <h1>Example Of Component</h1>
        <MyComponent
          events={data}
          eventToggled={this.handleToggle}
          height={400}
          width={500}
        />
      </div>
    );
  }
}

render(<Demo />, document.getElementById("app"));

Modified Infinite Calendar

This is a forked npm version of the infinite calendar from https://github.com/clauderic/react-infinite-calendar, It's been modified to have an event view that displays event data for a particular day from a datasource on clicking a date on the calendar.

How it is structured

The source code has two separate parts – the library and the documentation (demo) page. Both are written in ES6 and JSX, and therefore have to be transpiled by Babel but in different ways.

How was it modified

A forked version of the actual infinite calendar in the form of an NPM component had a single line of code modified to allow for a specification to occur . i.e. having a vertically color split date in terms of the calendar.

the specific modification can be seen here: https://github.com/DotunLonge/react-infinite-calendar/commit/6dd888abd3d0b1102fd2038f0038ea6ade6b46d7 and https://github.com/DotunLonge/react-infinite-calendar/commit/fcc9dcbcbe77eee630bdd1b51c42c6b8784a7d18

after this, i commenced building my own npm module utilizing my forked version of the react-inifinite-calendar as a child component. this is done by adding it to my package.json file.