-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Addon detail pages * Search * Wire up Popular and trending addons for home page * Linked tags
- Loading branch information
1 parent
5416cef
commit c9bb8f2
Showing
36 changed files
with
1,421 additions
and
4,288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { useState } from 'react'; | ||
|
||
const relatedTags = [ | ||
{ | ||
link: '/notes', | ||
name: '🗒 Notes', | ||
}, | ||
{ | ||
link: '/storybook', | ||
name: '📕 Storybook', | ||
}, | ||
{ | ||
link: '/qa', | ||
name: '🕵️♀️ QA', | ||
}, | ||
{ | ||
link: '/prototype', | ||
name: '✨ Prototype', | ||
}, | ||
{ | ||
link: '/testing', | ||
name: '✅ Testing', | ||
}, | ||
{ | ||
link: '/deploy', | ||
name: '☁️ Deploy', | ||
}, | ||
]; | ||
|
||
export const useAddonsRelatedTags = () => { | ||
return relatedTags; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { useState } from 'react'; | ||
|
||
let search = { isSearching: false, isSearchLoading: false, noResults: false }; | ||
|
||
export const useAddonsSearch = () => { | ||
const [seachData] = useState(search); | ||
|
||
return seachData; | ||
}; | ||
|
||
export const UseAddonsSearchDecorator = (story, context) => { | ||
search = { | ||
query: context.parameters.isSearching ? 'layout' : '', | ||
setQuery: () => {}, | ||
isSearching: context.parameters.isSearching || false, | ||
isSearchLoading: context.parameters.isSearchLoading || false, | ||
results: context.parameters.noResults ? { search: [], relatedTags: [] } : mockResults, | ||
}; | ||
|
||
return story(); | ||
}; | ||
|
||
const mockResults = { | ||
search: [ | ||
{ | ||
id: 'storybook-addon-outline', | ||
name: 'storybook-addon-outline', | ||
displayName: 'Outline', | ||
description: 'Outline all elements with CSS to help with layout placement and alignment', | ||
icon: | ||
'https://user-images.githubusercontent.com/263385/101991674-48355c80-3c7c-11eb-9686-f684e755fcdd.png', | ||
authors: [ | ||
{ | ||
id: 'winkervsbecks', | ||
avatarUrl: '//www.gravatar.com/avatar/dc3909557c0f933a066fe5faea796fdf?s=200', | ||
name: 'winkervsbecks', | ||
}, | ||
], | ||
weeklyDownloads: 65, | ||
repositoryUrl: 'https://github.com/chromaui/storybook-outline', | ||
appearance: 'official', | ||
verifiedCreator: null, | ||
}, | ||
], | ||
relatedTags: [ | ||
{ | ||
name: 'docz', | ||
link: '/addons/docz', | ||
}, | ||
{ | ||
name: 'md', | ||
link: '/addons/md', | ||
}, | ||
{ | ||
name: 'storybook', | ||
link: '/addons/jss', | ||
}, | ||
{ | ||
name: 'addon', | ||
link: '/addons/end-to-end', | ||
}, | ||
{ | ||
name: 'storybookjs', | ||
link: '/addons/hooks', | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.