Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@eisberg-labs/mui-next-cookie-consent
Advanced tools
React Material Ui cookie consent dialog, compatible with nextjs cookies.
React Material Ui cookie consent dialog, compatible with Nextjs cookies.
Since this is an extension of mui components, prerequisite is to have material library already installed.
npm i --save @mui/material
npm i --save @eisberg-labs/mui-next-cookie-consent
Just import the template with defaults:
<CookieConsent>This website uses cookies to enhance the user experience.</CookieConsent>
I use it in a nextjs app like this:
const CookieConsent = dynamic(() => import('@eisberg-labs/mui-next-cookie-consent'), {suspense: true});
export default function Layout({ children }) {
return (
<>
<AppHeader />
<div className={styles.wrapper}>{children}</div>
<Suspense><CookieConsent
cookieOptions={{
expires: moment().add(1, 'years').toDate()
}}
confirmText="I agree"
>This website uses cookies to enhance the user experience.</CookieConsent></Suspense>
<Footer />
</>
);
}
You can change the default styling, cookie key, set expires, register callback on Accept.
Name | Type | Default | Description |
---|---|---|---|
defaultName | string | 'CookieConsent' | Cookie key name for cookie consent |
confirmText | React.ReactNode | 'I understand' | Confirm button text |
buttonVariant | 'text', 'outlined', 'contained' | 'text' | Button variant |
cookieOptions | CookieSerializeOptions | e.g. {expires: moment().add(1, 'days').toDate()} | |
onAccept | ()=>void | Optional function that triggers after cookie consent accepted. | |
sx | SxProps | Define styling of the cookie consent container | |
butttonSx | SxProps | Define styling of the button. |
MIT © Eisberg Labs
FAQs
React Material Ui cookie consent dialog, lightweight, compatible with nextjs cookies and tailwind css.
We found that @eisberg-labs/mui-next-cookie-consent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.