2020-07-10 21:49:53 +02:00
|
|
|
import React from 'react';
|
2021-07-13 23:48:16 +02:00
|
|
|
import { Typography, Icon } from '../';
|
|
|
|
|
import PropTypes from 'prop-types';
|
2020-07-10 21:49:53 +02:00
|
|
|
import detect from 'browser-detect';
|
|
|
|
|
|
|
|
|
|
const Link = ({ href, children, showIcon = false }) => {
|
|
|
|
|
return (
|
|
|
|
|
<a href={href} target="_blank" rel="noopener noreferrer">
|
|
|
|
|
<Typography
|
|
|
|
|
variant="subtitle"
|
|
|
|
|
component="p"
|
|
|
|
|
className="flex items-center text-primary-active"
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
{!!showIcon && (
|
2022-02-10 20:08:34 +01:00
|
|
|
<Icon name="external-link" className="w-5 ml-2 text-white" />
|
2020-07-10 21:49:53 +02:00
|
|
|
)}
|
|
|
|
|
</Typography>
|
|
|
|
|
</a>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const Row = ({ title, value, link }) => {
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex mb-4">
|
2022-02-10 20:08:34 +01:00
|
|
|
<Typography variant="subtitle" component="p" className="w-48 text-white">
|
2020-07-10 21:49:53 +02:00
|
|
|
{title}
|
|
|
|
|
</Typography>
|
|
|
|
|
|
|
|
|
|
{link ? (
|
|
|
|
|
<Link href={link}>{value}</Link>
|
|
|
|
|
) : (
|
2022-02-10 20:08:34 +01:00
|
|
|
<Typography
|
|
|
|
|
variant="subtitle"
|
|
|
|
|
component="p"
|
|
|
|
|
className="w-48 text-white"
|
|
|
|
|
>
|
|
|
|
|
{value}
|
|
|
|
|
</Typography>
|
|
|
|
|
)}
|
2020-07-10 21:49:53 +02:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2022-02-10 20:08:34 +01:00
|
|
|
const AboutModal = ({ buildNumber, versionNumber }) => {
|
2020-07-10 21:49:53 +02:00
|
|
|
const { os, version, name } = detect();
|
|
|
|
|
const browser = `${name[0].toUpperCase()}${name.substr(1)} ${version}`;
|
|
|
|
|
|
|
|
|
|
const renderRowTitle = title => (
|
2022-02-10 20:08:34 +01:00
|
|
|
<div className="pb-3 mb-3 border-b-2 border-black">
|
2020-07-10 21:49:53 +02:00
|
|
|
<Typography variant="h6" className="text-primary-light">
|
|
|
|
|
{title}
|
|
|
|
|
</Typography>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{renderRowTitle('Important Links')}
|
|
|
|
|
<div className="flex mb-8">
|
2022-02-10 20:08:34 +01:00
|
|
|
<Link href="https://community.ohif.org/" showIcon={true}>
|
2020-07-10 21:49:53 +02:00
|
|
|
Visit the forum
|
|
|
|
|
</Link>
|
|
|
|
|
<span className="ml-4">
|
|
|
|
|
<Link
|
|
|
|
|
href="https://github.com/OHIF/Viewers/issues/new/choose"
|
|
|
|
|
showIcon={true}
|
|
|
|
|
>
|
|
|
|
|
Report an issue
|
|
|
|
|
</Link>
|
|
|
|
|
</span>
|
|
|
|
|
<span className="ml-4">
|
2021-07-21 12:58:15 +02:00
|
|
|
<Link href="https://ohif.org/" showIcon={true}>
|
2020-07-10 21:49:53 +02:00
|
|
|
More details
|
|
|
|
|
</Link>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{renderRowTitle('Version Information')}
|
|
|
|
|
<div className="flex flex-col">
|
|
|
|
|
<Row
|
|
|
|
|
title="Repository URL"
|
2021-09-08 08:40:25 +02:00
|
|
|
value="https://github.com/OHIF/Viewers/tree/v3-stable"
|
|
|
|
|
link="https://github.com/OHIF/Viewers/tree/v3-stable"
|
2020-07-10 21:49:53 +02:00
|
|
|
/>
|
2021-09-08 08:40:25 +02:00
|
|
|
{/* <Row
|
2020-07-10 21:49:53 +02:00
|
|
|
title="Last Master Commits"
|
2021-09-08 08:40:25 +02:00
|
|
|
value="https://github.com/OHIF/Viewers/tree/v3-stable"
|
|
|
|
|
link="https://github.com/OHIF/Viewers/tree/v3-stable"
|
|
|
|
|
/> */}
|
2021-07-13 23:48:16 +02:00
|
|
|
<Row title="Version number" value={versionNumber} />
|
|
|
|
|
<Row title="Build number" value={buildNumber} />
|
2020-07-10 21:49:53 +02:00
|
|
|
<Row title="Browser" value={browser} />
|
|
|
|
|
<Row title="OS" value={os} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2021-07-13 23:48:16 +02:00
|
|
|
AboutModal.propTypes = {
|
|
|
|
|
buildNumber: PropTypes.string,
|
|
|
|
|
versionNumber: PropTypes.string,
|
2022-02-10 20:08:34 +01:00
|
|
|
};
|
2021-07-13 23:48:16 +02:00
|
|
|
|
2020-07-10 21:49:53 +02:00
|
|
|
export default AboutModal;
|