From c8cdff8bc40b847b9ae88b60d3f10ee73448c267 Mon Sep 17 00:00:00 2001 From: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com> Date: Wed, 1 Mar 2023 18:26:29 +0530 Subject: [PATCH] feat: Creates component to show contact search results (#6571) * feat: Creates component to show contact search results * Refactors unused code * Review fixes * Update app/javascript/dashboard/modules/search/components/SearchResultContactItem.vue Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> --------- Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> --- .../components/SearchResultContactItem.vue | 83 +++++++++++++++++++ .../SearchResultContactItem.stories.js | 53 ++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 app/javascript/dashboard/modules/search/components/SearchResultContactItem.vue create mode 100644 app/javascript/dashboard/modules/search/stories/SearchResultContactItem.stories.js diff --git a/app/javascript/dashboard/modules/search/components/SearchResultContactItem.vue b/app/javascript/dashboard/modules/search/components/SearchResultContactItem.vue new file mode 100644 index 000000000..cbfb35c83 --- /dev/null +++ b/app/javascript/dashboard/modules/search/components/SearchResultContactItem.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/app/javascript/dashboard/modules/search/stories/SearchResultContactItem.stories.js b/app/javascript/dashboard/modules/search/stories/SearchResultContactItem.stories.js new file mode 100644 index 000000000..bb2723057 --- /dev/null +++ b/app/javascript/dashboard/modules/search/stories/SearchResultContactItem.stories.js @@ -0,0 +1,53 @@ +import SearchResultContactItem from '../components/SearchResultContactItem.vue'; + +export default { + title: 'Components/Search/SearchResultContactItem', + component: SearchResultContactItem, + argTypes: { + id: { + defaultValue: '123', + control: { + type: 'text', + }, + }, + name: { + defaultValue: 'John Doe', + control: { + type: 'text', + }, + }, + email: { + defaultValue: 'johndoe@faster.com', + control: { + type: 'text', + }, + }, + phone: { + defaultValue: '+1 123 456 7890', + control: { + type: 'text', + }, + }, + accountId: { + defaultValue: '7890', + control: { + type: 'text', + }, + }, + thumbnail: { + defaultValue: 'https://randomuser.me/api/portraits/men/62.jpg', + control: { + type: 'text', + }, + }, + }, +}; + +const Template = (args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { SearchResultContactItem }, + template: + '', +}); + +export const ResultContactItem = Template.bind({});