diff --git a/src/Containers/DraggableRow/DraggableRow.stories.tsx b/src/Containers/DraggableRow/DraggableRow.stories.tsx new file mode 100644 index 00000000..ac856859 --- /dev/null +++ b/src/Containers/DraggableRow/DraggableRow.stories.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import { Story, Meta } from '@storybook/react'; +import { DraggableRow, DraggableRowProps } from '../../index'; +import { createStoryTitle } from '../../Constants'; + +export default { + title: createStoryTitle('Draggable Row'), + component: DraggableRow, + args: { + draggable: true, + templatePrefills: { + TEMPLATE_ITEM: { + caption: 'This is a template caption.' + }, + TEMPLATE_ITEM2: { + caption: 'This is another template caption.' + }, + }, + }, +} as Meta; + +export const Basic: Story = (args) => ( + +); \ No newline at end of file diff --git a/src/Containers/DraggableRow/DraggableRow.tsx b/src/Containers/DraggableRow/DraggableRow.tsx new file mode 100644 index 00000000..f427a481 --- /dev/null +++ b/src/Containers/DraggableRow/DraggableRow.tsx @@ -0,0 +1,25 @@ +import React from 'react'; +import { Template } from './Template'; +import { ITemplatePrefill } from './DraggableRowTypes'; + +export interface DraggableRowProps extends React.HTMLAttributes { + /*Template of a draggable element that can be reordered*/ + templatePrefills: ITemplatePrefill[]; + draggable?: boolean; +} + +export const DraggableRow: React.FC = ({ + templatePrefills, + draggable = true, + ...props +}): React.ReactElement => { + + return ( +
+