Skip to content

Commit

Permalink
improve Dummy component
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-burel committed Jun 14, 2021
1 parent 6ec59e9 commit 0bd067e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import type { PossibleVulcanComponents } from "./typings";
import { Dummy } from "./Dummy";

// We need this to shut TypeScript up
// You should use the Provider to get the right default values
const Dummy = () => "Dummy component";
export const VulcanComponentsContext =
React.createContext<PossibleVulcanComponents>({
Alert: Dummy,
Expand Down
10 changes: 10 additions & 0 deletions packages/react-ui/components/form/VulcanComponents/Dummy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
export interface DummyProps {}

export const Dummy = () => (
<span>
You have not setup VulcanComponentsProvider. Please add following code in
your app:{" "}
<code>{`import { VulcanComponentsProvider } from "@vulcanjs/react-ui"; const YourApp = <VulcanComponentsProvider>{/* your app */}</VulcanComponentsProvider>;}`}</code>
</span>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import { Story, Meta } from "@storybook/react";
import { Dummy, DummyProps } from "../Dummy";
export default {
component: Dummy,
title: "VulcanComponents/Dummy",
// decorators: [(Story) => <Story />],
args: {},
parameters: { actions: { argTypesRegex: "^.*Callback$" } },
} as Meta<DummyProps>;

const DummyTemplate: Story<DummyProps> = (args) => <Dummy {...args} />;
export const DefaultDummy = DummyTemplate.bind({});

0 comments on commit 0bd067e

Please sign in to comment.