From e9641b03bd7a3c7ec2706f8e75eb1262aa662e39 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 18 Aug 2018 14:02:43 -0400 Subject: [PATCH] Improve version cards with general version and detailed version info The versions page is more responsive as well. Signed-off-by: Mcat12 --- src/components/settings/VersionCard.js | 72 ++++++++++++++++++-------- src/components/settings/VersionInfo.js | 8 +-- 2 files changed, 55 insertions(+), 25 deletions(-) diff --git a/src/components/settings/VersionCard.js b/src/components/settings/VersionCard.js index 666f059..b2530fc 100644 --- a/src/components/settings/VersionCard.js +++ b/src/components/settings/VersionCard.js @@ -8,28 +8,58 @@ * This file is copyright under the latest version of the EUPL. * Please see LICENSE file for your rights under this license. */ -import React from 'react'; -import { translate } from 'react-i18next'; -import PropTypes from 'prop-types'; +import React, { Component } from "react"; +import { translate } from "react-i18next"; +import PropTypes from "prop-types"; +import { Collapse } from "reactstrap"; -const VersionCard = props => ( -
-
-
- +class VersionCard extends Component { + state = { + collapsed: true + }; + + render() { + const { t } = this.props; + + return ( +
+
+
+ +
+
+
+

{this.props.name}

+

+ {t("Version")}: {this.props.branch === "master" ? this.props.tag : "vDev"} +

+ + + + + + + + + + + + + + + +
{t("Branch")}{this.props.branch}
{t("Tag")}{this.props.tag}
{t("Hash")}{this.props.hash}
+
+
-
-
-

{props.name}

-
-        
- {props.t("Branch")}: {props.branch}
- {props.t("Hash")}: {props.hash}
- {props.t("Tag")}: {props.tag}
-
-
-
-); + ); + } +} VersionCard.propTypes = { branch: PropTypes.string.isRequired, @@ -38,4 +68,4 @@ VersionCard.propTypes = { tag: PropTypes.string.isRequired }; -export default translate(['settings'])(VersionCard); +export default translate(["common", "settings"])(VersionCard); diff --git a/src/components/settings/VersionInfo.js b/src/components/settings/VersionInfo.js index bd9f3d3..cf27e51 100644 --- a/src/components/settings/VersionInfo.js +++ b/src/components/settings/VersionInfo.js @@ -87,19 +87,19 @@ class VersionInfo extends Component { return (
-
+
-
+
-
+
-
+