Switched to tsdx and Typescript

Added storybook with examples from readme
This commit is contained in:
2022-07-31 12:04:58 +02:00
parent c6799ea446
commit c544f19c41
40 changed files with 40964 additions and 5102 deletions

View 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>
);
};

View File

@@ -0,0 +1,3 @@
import { CookieConsentProps, defaultCookieConsentProps } from "../../src/CookieConsent.props";
export const defaultStoryProps: CookieConsentProps = { ...defaultCookieConsentProps, debug: true };

View 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>
</>
);