1.0.8 • Published 3 years ago

@edulib/cookie-manager v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

cookie-manager

Installtion

npx lerna add cookie-manager apps/XXX

Usage

We used styled-components since it was way easier to setup than compiling CSS and make it available for customization.

Here you just have to update theme, and voilà !

import { ThemeProvider } from 'styled-components';
import CookieManager, { theme, Theme } from '@edulib/cookie-manager';

const customTheme: Theme = {
  ...theme,
  main: 'red',
};

const App = () => (
  <ThemeProvider theme={customTheme}>
    {/* ... */}
    <CookieManager />
  </ThemeProvider>
);

Or you also can pass theme directly :

import CookieManager, { theme, Theme } from '@edulib/cookie-manager';

const customTheme: Theme = {
  ...theme,
  main: 'red',
};

const App = () => (
  {/* ... */}
  <CookieManager theme={customTheme} />
);

Definitions

See typings for details about available props and interfaces.

You won't use any other component than PopupSmall and PopupLarge. In a future we won't export PopupLarge since we'll handle it internally.

Theme

interface Theme {
  main: string; // The main color
  mainInactive: string; // The inactive main color. Used for switch disabled color.
  lightGray: string;
  radius: number; // Button radius.
  sm: number; // At this size, we will consider the screen is small
  shadow: string; // Shadow used for popup and switch handle.
}
1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago