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
|
|
|
|
task={{
|
|
|
|
taskID: '1',
|
2020-04-11 04:22:58 +02:00
|
|
|
taskGroup: { taskGroupID: '1' },
|
2020-04-10 21:45:49 +02:00
|
|
|
name: 'Hello, world',
|
|
|
|
position: 1,
|
|
|
|
labels: [],
|
2020-04-10 22:31:12 +02:00
|
|
|
description,
|
2020-04-10 21:45:49 +02:00
|
|
|
}}
|
2020-04-10 22:31:12 +02:00
|
|
|
onTaskDescriptionChange={(_task, desc) => setDescription(desc)}
|
2020-04-11 04:22:58 +02:00
|
|
|
onDeleteTask={action('delete task')}
|
|
|
|
onCloseModal={action('close modal')}
|
2020-04-10 21:45:49 +02:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|