diff --git a/platform/ui/src/assets/icons/external-link.svg b/platform/ui/src/assets/icons/external-link.svg new file mode 100644 index 000000000..e2407a154 --- /dev/null +++ b/platform/ui/src/assets/icons/external-link.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/platform/ui/src/components/Icon/getIcon.jsx b/platform/ui/src/components/Icon/getIcon.jsx index bda2d02bf..775eca0ca 100644 --- a/platform/ui/src/components/Icon/getIcon.jsx +++ b/platform/ui/src/components/Icon/getIcon.jsx @@ -12,6 +12,7 @@ import chevronLeft from './../../assets/icons/chevron-left.svg'; import chevronRight from './../../assets/icons/chevron-right.svg'; import eyeVisible from './../../assets/icons/eye-visible.svg'; import eyeHidden from './../../assets/icons/eye-hidden.svg'; +import externalLink from './../../assets/icons/external-link.svg'; import groupLayers from './../../assets/icons/group-layers.svg'; import info from './../../assets/icons/info.svg'; import infoLink from './../../assets/icons/info-link.svg'; @@ -71,6 +72,7 @@ const ICONS = { 'chevron-right': chevronRight, 'eye-visible': eyeVisible, 'eye-hidden': eyeHidden, + 'external-link': externalLink, 'group-layers': groupLayers, info: info, 'info-link': infoLink, @@ -116,7 +118,7 @@ const ICONS = { 'old-angle-left': oldAngleLeft, 'old-reset': oldReset, 'old-circle-o': oldCircleO, - 'old-trash': oldTrash + 'old-trash': oldTrash, }; /** diff --git a/platform/viewer/package.json b/platform/viewer/package.json index b7b7a7665..621cbc0c3 100644 --- a/platform/viewer/package.json +++ b/platform/viewer/package.json @@ -64,6 +64,7 @@ "@ohif/ui": "^1.4.4", "@tanem/react-nprogress": "^1.1.25", "@types/react": "^16.0.0", + "browser-detect": "^0.2.28", "classnames": "^2.2.6", "core-js": "^3.2.1", "cornerstone-math": "^0.1.8", diff --git a/platform/viewer/src/components/PreferencesDropdown/AboutModal.jsx b/platform/viewer/src/components/PreferencesDropdown/AboutModal.jsx new file mode 100644 index 000000000..af06e2bee --- /dev/null +++ b/platform/viewer/src/components/PreferencesDropdown/AboutModal.jsx @@ -0,0 +1,101 @@ +import React from 'react'; +import { Typography, Icon } from '@ohif/ui'; +import detect from 'browser-detect'; + +const Link = ({ href, children, showIcon = false }) => { + return ( + + + {children} + {!!showIcon && ( + + )} + + + ); +}; + +const Row = ({ title, value, link }) => { + return ( +
+ + {title} + + + {link ? ( + {value} + ) : ( + + {value} + + )} +
+ ); +}; + +const AboutModal = () => { + const { os, version, name } = detect(); + const browser = `${name[0].toUpperCase()}${name.substr(1)} ${version}`; + + const renderRowTitle = title => ( +
+ + {title} + +
+ ); + return ( +
+ {renderRowTitle('Important Links')} +
+ + Visit the forum + + + + Report an issue + + + + + More details + + +
+ + {renderRowTitle('Version Information')} +
+ + + + + + +
+
+ ); +}; + +export default AboutModal; diff --git a/platform/viewer/src/components/PreferencesDropdown/PreferencesDropdown.jsx b/platform/viewer/src/components/PreferencesDropdown/PreferencesDropdown.jsx index 791905819..b09188206 100644 --- a/platform/viewer/src/components/PreferencesDropdown/PreferencesDropdown.jsx +++ b/platform/viewer/src/components/PreferencesDropdown/PreferencesDropdown.jsx @@ -1,15 +1,14 @@ import React from 'react'; - +import AboutModal from './AboutModal'; import { Dropdown, IconButton, Icon, useModal } from '@ohif/ui'; const PreferencesDropdown = () => { const { show } = useModal(); const showAboutModal = () => { - const modalComponent = () =>
About modal
; show({ - content: modalComponent, - title: 'About', + content: AboutModal, + title: 'About OHIF Viewer', }); };