using dropdown and opening modal for preferences

This commit is contained in:
Rodrigo Antinarelli committed 2020-06-23 00:10:58 -03:00
1 parent 70cf31b449
commit 1441062d95
4 files changed
+97 -23

No files matched your search

@@ -0,0 +1,51 @@
import React from 'react';
import { Dropdown, IconButton, Icon, useModal } from '@ohif/ui';
const PreferencesDropdown = () => {
const { show } = useModal();
const showAboutModal = () => {
const modalComponent = () => <div>About modal</div>;
show({
content: modalComponent,
title: 'About',
});
};
const showPreferencesModal = () => {
const modalComponent = () => <div>Preferences modal</div>;
show({
content: modalComponent,
title: 'Preferences',
});
};
return (
<Dropdown
titleElement={
<IconButton
variant="text"
color="inherit"
size="initial"
className="text-primary-active"
onClick={() => {}}
>
<React.Fragment>
<Icon name="settings" /> <Icon name="chevron-down" />
</React.Fragment>
</IconButton>
}
list={[
{ title: 'About', icon: 'info', onClick: () => showAboutModal() },
{
title: 'Preferences',
icon: 'settings',
onClick: () => showPreferencesModal(),
},
]}
/>
);
};
export default PreferencesDropdown;
@@ -0,0 +1 @@
export { default } from './PreferencesDropdown';