From 8459d09b6a7cea25f5370179e6ce36046dcbf55e Mon Sep 17 00:00:00 2001 From: Nithin David Thomas Date: Tue, 4 May 2021 19:28:18 +0530 Subject: [PATCH] feat: Add a component to show contact information (#2204) * Feat: Add component to show contact introduction. * fix: Hide sperator if company is not present Co-authored-by: Muhsin Keloth --- .../contact/components/ContactIntro.vue | 122 ++++++++++++++++++ .../contact/stories/ContactIntro.stories.js | 43 ++++++ 2 files changed, 165 insertions(+) create mode 100644 app/javascript/dashboard/modules/contact/components/ContactIntro.vue create mode 100644 app/javascript/dashboard/modules/contact/stories/ContactIntro.stories.js diff --git a/app/javascript/dashboard/modules/contact/components/ContactIntro.vue b/app/javascript/dashboard/modules/contact/components/ContactIntro.vue new file mode 100644 index 000000000..2a92f4a16 --- /dev/null +++ b/app/javascript/dashboard/modules/contact/components/ContactIntro.vue @@ -0,0 +1,122 @@ + + + + diff --git a/app/javascript/dashboard/modules/contact/stories/ContactIntro.stories.js b/app/javascript/dashboard/modules/contact/stories/ContactIntro.stories.js new file mode 100644 index 000000000..b9e284ffa --- /dev/null +++ b/app/javascript/dashboard/modules/contact/stories/ContactIntro.stories.js @@ -0,0 +1,43 @@ +import ContactIntro from '../components/ContactIntro'; +import { action } from '@storybook/addon-actions'; + +export default { + title: 'Components/Contact/ContactIntro', + component: ContactIntro, +}; + +const Template = (args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { ContactIntro }, + template: + '', +}); + +export const DefaultNote = Template.bind({}); +DefaultNote.args = { + contact: { + id: 979442, + name: 'Eden Hazard', + title: 'Playmaker', + thumbnail: 'https://randomuser.me/api/portraits/men/19.jpg', + company: { + id: 10, + name: 'Chelsea', + }, + email: 'hazard@chelsea.com', + availability_status: 'offline', + phone_number: '', + custom_attributes: {}, + additional_attributes: { + description: + 'Known for his dribbling, he is considered to be one of the best players in the world.', + social_profiles: { + twitter: 'hazardeden10', + facebook: 'hazardeden10', + linkedin: 'hazardeden10', + }, + }, + }, + onEdit: action('edit'), + onNewMessage: action('new message 💬'), +};