Feat: Creates add note component for CRM (#2187)

* Feat: Creates add note component for CRM
This commit is contained in:
Sivin Varghese
2021-05-01 19:26:17 +05:30
committed by GitHub
parent 49c7bf5ae4
commit 6a7b98b345
6 changed files with 169 additions and 42 deletions

View File

@@ -0,0 +1,19 @@
import { action } from '@storybook/addon-actions';
import AddNote from '../../app/javascript/dashboard/routes/dashboard/contacts/components/AddNote';
export default {
title: 'Components/Notes/Add',
component: AddNote,
argTypes: {},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { AddNote },
template: '<add-note v-bind="$props" @add="onAdd"></add-note>',
});
export const Add = Template.bind({});
Add.args = {
onAdd: action('Added'),
};

View File

@@ -0,0 +1,47 @@
import { action } from '@storybook/addon-actions';
import ContactNote from '../../app/javascript/dashboard/routes/dashboard/contacts/components/ContactNote';
export default {
title: 'Components/Notes/Note',
component: ContactNote,
argTypes: {
note: {
defaultValue:
'A copy and paste musical notes symbols & music symbols collection for easy access.',
control: {
type: 'text',
},
},
userName: {
defaultValue: 'John Doe',
control: {
type: 'text',
},
},
timeStamp: {
defaultValue: '1618046084',
control: {
type: 'number',
},
},
thumbnail: {
defaultValue: 'https://randomuser.me/api/portraits/men/62.jpg',
control: {
type: 'text',
},
},
},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { ContactNote },
template:
'<contact-note v-bind="$props" @edit="onEdit" @delete="onDelete"></contact-note>',
});
export const Note = Template.bind({});
Note.args = {
onEdit: action('Edit'),
onDelete: action('Delete'),
};

View File

@@ -1,41 +0,0 @@
import { action } from '@storybook/addon-actions';
import Note from '../../app/javascript/dashboard/routes/dashboard/contacts/components/ContactNote';
export default {
title: 'Components/Note',
component: Note,
argTypes: {
note: {
control: {
type: 'text',
},
},
userName: {
control: {
type: 'text',
},
},
timeStamp: {
control: {
type: 'number',
},
},
thumbnail: {
control: {
type: 'text',
},
},
},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Note },
template: '<note v-bind="$props" @edit="onEdit" @delete="onDelete" ></note>',
});
export const DefaultNote = Template.bind({});
DefaultNote.args = {
onEdit: action('Edit'),
onDelete: action('Delete'),
};