From 81842592dfd31210a094873a6fecedc08f5147f5 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Sun, 17 Nov 2019 00:01:44 +0100 Subject: [PATCH] Simple Implementation In Stroybook Of SearchInput By the way, I added *~ to .gitignore, which are the backups of emacs editor. See the Storybook of SearchInput. Problems: * I found no way to separate the heading of the search results from the first item. Do we have to write a complete new component for this? * The incoming data must by sorted by type before passed to the component. I added keys searchType and firstType, to identify the type (post/user) (may be as a locale) and to know when I have to place the heading. --- webapp/components/SearchInput/SearchInput.story.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/webapp/components/SearchInput/SearchInput.story.js b/webapp/components/SearchInput/SearchInput.story.js index 563022877..e833c817e 100644 --- a/webapp/components/SearchInput/SearchInput.story.js +++ b/webapp/components/SearchInput/SearchInput.story.js @@ -6,10 +6,9 @@ import helpers from '~/storybook/helpers' helpers.init() export const results = [ - /* { heading: 'Contributions' - },*/ + }, { id: 'de100841-2336-4b01-a574-f1bd2c0b262a', searchType: 'Contributions', @@ -66,9 +65,9 @@ export const results = [ slug: 'louie', }, }, -/* { + { heading: 'Users' - },*/ + }, { id: 'u1', searchType: 'Users',