taskcafe/web/src/shared/components/TaskDetails/TaskDetails.stories.tsx

82 lines
2.6 KiB
TypeScript
Raw Normal View History

2020-04-10 21:45:49 +02:00
import React, { useState } from 'react';
import { action } from '@storybook/addon-actions';
import NormalizeStyles from 'App/NormalizeStyles';
import BaseStyles from 'App/BaseStyles';
import Modal from 'shared/components/Modal';
2020-04-10 22:31:12 +02:00
import TaskDetails from '.';
2020-04-10 21:45:49 +02:00
export default {
component: TaskDetails,
title: 'TaskDetails',
parameters: {
backgrounds: [
{ name: 'white', value: '#ffffff' },
{ name: 'gray', value: '#cdd3e1', default: true },
],
},
};
export const Default = () => {
const [description, setDescription] = useState('');
return (
<>
<NormalizeStyles />
<BaseStyles />
<Modal
width={1040}
onClose={action('on close')}
renderContent={() => {
return (
<TaskDetails
2020-06-19 01:12:15 +02:00
onDeleteItem={action('delete item')}
onChangeItemName={action('change item name')}
2020-04-10 21:45:49 +02:00
task={{
2020-05-31 06:11:19 +02:00
id: '1',
taskGroup: { name: 'General', id: '1' },
2020-04-10 21:45:49 +02:00
name: 'Hello, world',
position: 1,
2020-05-27 23:18:50 +02:00
labels: [
{
2020-05-31 06:11:19 +02:00
id: 'soft-skills',
assignedDate: new Date().toString(),
projectLabel: {
createdDate: new Date().toString(),
id: 'label-soft-skills',
name: 'Soft Skills',
labelColor: {
id: '1',
name: 'white',
colorHex: '#fff',
position: 1,
},
2020-05-27 23:18:50 +02:00
},
},
],
2020-04-10 22:31:12 +02:00
description,
2020-05-31 06:11:19 +02:00
assigned: [
2020-04-21 01:04:27 +02:00
{
2020-05-31 06:11:19 +02:00
id: '1',
2020-04-21 01:04:27 +02:00
profileIcon: { bgColor: null, url: null, initials: null },
2020-06-13 00:21:58 +02:00
fullName: 'Jordan Knott',
2020-04-21 01:04:27 +02:00
},
],
2020-04-10 21:45:49 +02:00
}}
2020-04-13 00:45:51 +02:00
onTaskNameChange={action('task name change')}
2020-04-10 22:31:12 +02:00
onTaskDescriptionChange={(_task, desc) => setDescription(desc)}
onDeleteTask={action('delete task')}
onCloseModal={action('close modal')}
2020-05-27 02:53:31 +02:00
onMemberProfile={action('profile')}
2020-04-13 00:45:51 +02:00
onOpenAddMemberPopup={action('open add member popup')}
2020-06-19 01:12:15 +02:00
onAddItem={action('add item')}
2020-06-19 23:33:02 +02:00
onToggleTaskComplete={action('toggle task complete')}
2020-06-19 01:12:15 +02:00
onToggleChecklistItem={action('toggle checklist item')}
2020-04-13 00:45:51 +02:00
onOpenAddLabelPopup={action('open add label popup')}
2020-06-16 00:36:59 +02:00
onOpenDueDatePopop={action('open due date popup')}
2020-04-10 21:45:49 +02:00
/>
);
}}
/>
</>
);
};