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

@edx/frontend-component-cookie-policy-banner

v2.6.0

Published

The edX cookie policy banner component implemented in React.

Downloads

10,295

Readme

frontend-component-cookie-policy-banner

Greenkeeper badge npm npm license

We are not accepting public contributions to this repo at this time.

Purpose

edX cookie policy banner React component

Getting Started

Installation

npm i --save @edx/frontend-component-cookie-policy-banner

Usage

import CookiePolicyBanner from '@edx/frontend-component-cookie-policy-banner';

// Can import sass file this way
// Or as an import in one of your sass files with other third party sass files
import '@edx/frontend-component-cookie-policy-banner/build/frontend-component-cookie-policy-banner.scss';

const SomeWrappingComponent = () => (
  <div>
    <span>Blahblablah</span>
    <CookiePolicyBanner />
  </div>
);

Updating the Repo

We use semantic-release to update the package on NPM.

Please follow semantic-release guidelines on how to structure your commit message when merging a change.

Styling

As noted in a comment in the previous code example, you can import the styles associated with the CookiePolicyBanner component directly (if this is supported by your webpack config) or by importing the sass file as part of one of your existing sass files (probably where your other third-party sass files are imported).

Requirement: | The CookiePolicyBanner sass file assumes the presence of an @edx/brand theme :---: | :---

// base.scss
@import 'thirdPartySass';
@import 'anotherThirdPartySass';

// Theme styles
@import '@edx/brand/paragon/fonts';
@import '@edx/brand/paragon/variables';

// Cookie Policy Banner style
@import '@edx/frontend-component-cookie-policy-banner/build/frontend-component-cookie-policy-banner';

Local Testing With Other Repositories

The current build is not included in the git repository so in order to test the component with dependent repositories, you will have to first build the component by running npm run prepublishOnly, then remove build and build/Release from .gitignore and commit the results to your branch. Make sure to remove the change to .gitignore before merging!

Once you've committed and pushed the build to your branch, you can bring it into a dependent repository's package.json by adding

"@edx/frontend-component-cookie-policy-banner": "git+https://github.com/openedx/frontend-component-cookie-policy-banner#<my_branch_name>"

and running npm install.

Note that whenever you make changes on your branch, you will have to rebuild, commit push the resulting build artifacts, and re-run npm install in the dependent repository.

Storybook

storybook

Storybook is a useful tool for showcasing the expected and potential usage of components.

Executing

As of Nov 2020, Storybook isn't compatible with webpack 5, so before running change your webpack version to 4.44.1.

npm run start

locally builds the Storybook for the CookiePolicyBanner component on port 3003.

License

The code in this repository is licensed under the AGPLv3 unless otherwise noted.

Please see LICENSE <LICENSE>_ for details.

edX Code of Conduct

All community members are expected to follow the Open edX Code of Conduct_. https://open.edx.org/code-of-conduct/

Contact

You can contact the edx open-source team at [email protected].

Security reporting information

Please do not report security issues in public. Send security concerns via email to [email protected].