mirror of
https://github.com/Mastermindzh/react-cookie-consent.git
synced 2025-07-30 22:23:32 +02:00
Switched to tsdx and Typescript
Added storybook with examples from readme
This commit is contained in:
11
stories/defaults/intro.tsx
Normal file
11
stories/defaults/intro.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { FunctionComponent } from "react";
|
||||
|
||||
type Props = {};
|
||||
|
||||
export const Intro: FunctionComponent<Props> = () => {
|
||||
return (
|
||||
<h1>
|
||||
<p>Debug is turned on for all stories so that the bar always shows up</p>
|
||||
</h1>
|
||||
);
|
||||
};
|
3
stories/defaults/storyProps.ts
Normal file
3
stories/defaults/storyProps.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { CookieConsentProps, defaultCookieConsentProps } from "../../src/CookieConsent.props";
|
||||
|
||||
export const defaultStoryProps: CookieConsentProps = { ...defaultCookieConsentProps, debug: true };
|
13
stories/defaults/template.tsx
Normal file
13
stories/defaults/template.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Story } from "@storybook/react";
|
||||
import CookieConsent from "../../src";
|
||||
import { Intro } from "./intro";
|
||||
|
||||
export const DefaultTemplate: Story<any> = (args) => (
|
||||
<>
|
||||
<Intro />
|
||||
<CookieConsent {...args}>
|
||||
This website uses cookies to enhance the user experience.
|
||||
<span style={{ fontSize: "10px" }}>This bit of text is smaller :O</span>
|
||||
</CookieConsent>
|
||||
</>
|
||||
);
|
Reference in New Issue
Block a user