We are not accepting public contributions to this repo at this time.
npm i --save @edx/frontend-component-cookie-policy-banner
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 RepoWe use
semantic-releaseto update the package on NPM.
Please follow semantic-release guidelines on how to structure your commit message when merging a change.
StylingAs noted in a comment in the previous code example, you can import the styles associated with the
CookiePolicyBannercomponent directly (if this is supported by your
webpackconfig) 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
CookiePolicyBannersass file assumes the presence of an @edx/brand theme :---: | :---
Local Testing With Other RepositoriesThe 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
.gitignoreand 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
Note that whenever you make changes on your branch, you will have to rebuild, commit push the resulting build artifacts, and re-run
npm installin the dependent repository.
Storybookis a useful tool for showcasing the expected and potential usage of components.
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
CookiePolicyBannercomponent on port
edX Code of Conduct