From 264a72b566cabe233bddeb41d4664c50d77d5aa1 Mon Sep 17 00:00:00 2001 From: Erik Ziegler Date: Fri, 15 May 2020 14:30:47 +0200 Subject: [PATCH] Missing file --- .../ui/src/components/StudyItem/StudyItem.mdx | 46 +++++++++++++++++++ .../components/Layout/index.js | 2 +- .../components/Sidebar/index.js | 12 ++--- 3 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 platform/ui/src/components/StudyItem/StudyItem.mdx diff --git a/platform/ui/src/components/StudyItem/StudyItem.mdx b/platform/ui/src/components/StudyItem/StudyItem.mdx new file mode 100644 index 000000000..b94731dad --- /dev/null +++ b/platform/ui/src/components/StudyItem/StudyItem.mdx @@ -0,0 +1,46 @@ +--- +name: StudyItem +menu: General +route: components/studyItem +--- + +import { useState } from 'react'; +import { Playground, Props } from 'docz'; +import { StudyItem } from '@ohif/ui'; + +# StudyItem + +Used to expose study information as a card + +## Import + +```javascript +import { StudyItem } from '@ohif/ui'; +``` + +## Basic usage + + + {() => { + const [studyActive, setStudyActive] = useState(null); + return ( +
+
+ setStudyActive(studyActive === '1' ? null : '1')} + /> +
+
+ ); + }} +
+ +## Properties + + diff --git a/platform/ui/src/gatsby-theme-docz/components/Layout/index.js b/platform/ui/src/gatsby-theme-docz/components/Layout/index.js index 8d82717c8..274f9ad47 100644 --- a/platform/ui/src/gatsby-theme-docz/components/Layout/index.js +++ b/platform/ui/src/gatsby-theme-docz/components/Layout/index.js @@ -15,7 +15,7 @@ export const Layout = ({ children }) => { const nav = useRef(); const handleSidebarToggle = () => { - setSidebarOpen((s) => !s); + setSidebarOpen(s => !s); }; return ( diff --git a/platform/ui/src/gatsby-theme-docz/components/Sidebar/index.js b/platform/ui/src/gatsby-theme-docz/components/Sidebar/index.js index c34861d72..0696513b7 100644 --- a/platform/ui/src/gatsby-theme-docz/components/Sidebar/index.js +++ b/platform/ui/src/gatsby-theme-docz/components/Sidebar/index.js @@ -15,7 +15,7 @@ export const Sidebar = React.forwardRef((props, ref) => { const menus = useMenus({ query }); const currentDoc = useCurrentDoc(); const currentDocRef = useRef(); - const handleChange = (ev) => { + const handleChange = ev => { setQuery(ev.target.value); }; useEffect(() => { @@ -46,20 +46,20 @@ export const Sidebar = React.forwardRef((props, ref) => { }; const renderMenuCategories = () => { - return Object.keys(customMenus).map((menuName) => { + return Object.keys(customMenus).map(menuName => { return (

{menuName}

- {customMenus[menuName].map((item) => item)} + {customMenus[menuName].map(item => item)}
); }); }; - const getMenuCategory = (menuName) => { - return Object.keys(MENU_CATEGORIES).find((category) => { + const getMenuCategory = menuName => { + return Object.keys(MENU_CATEGORIES).find(category => { if (MENU_CATEGORIES[category].includes(menuName)) { return category; } @@ -99,7 +99,7 @@ export const Sidebar = React.forwardRef((props, ref) => { onChange={handleChange} /> {menus && - menus.map((menu) => { + menus.map(menu => { const isGroup = !!menu.menu; const Component = isGroup ? NavGroup : NavLink; const menuCategory = getMenuCategory(menu.name) || null;