diff --git a/client/src/components/molecules/VersionNumbers/VersionStatus.module.scss b/client/src/components/molecules/VersionNumbers/VersionStatus.module.scss
new file mode 100644
index 0000000..18ef84f
--- /dev/null
+++ b/client/src/components/molecules/VersionNumbers/VersionStatus.module.scss
@@ -0,0 +1,36 @@
+@import '../../../styles/variables';
+
+.status {
+ text-align: center;
+ padding-top: $spacer / 2;
+ padding-bottom: $spacer;
+ display: flex;
+ justify-content: space-between;
+}
+
+.element {
+ display: inline-block;
+ margin-left: $spacer / 2;
+ margin-right: $spacer / 2;
+ text-align: center;
+}
+
+.indicator,
+.indicatorActive {
+ display: inline-block;
+ margin-right: $spacer / 4;
+ margin-bottom: -.1rem;
+}
+
+.indicator {
+ composes: statusIndicator from '../AccountStatus/Indicator.module.scss';
+}
+
+.indicatorActive {
+ composes: statusIndicatorActive from '../AccountStatus/Indicator.module.scss';
+}
+
+.indicatorLabel {
+ font-family: $font-family-title;
+ color: $brand-grey;
+}
diff --git a/client/src/components/molecules/VersionNumbers/VersionStatus.tsx b/client/src/components/molecules/VersionNumbers/VersionStatus.tsx
new file mode 100644
index 0000000..4cdc632
--- /dev/null
+++ b/client/src/components/molecules/VersionNumbers/VersionStatus.tsx
@@ -0,0 +1,29 @@
+import React from 'react'
+import styles from './VersionStatus.module.scss'
+
+const VersionStatus = ({
+ status
+}: {
+ status: { ok: boolean; contracts: boolean; network: boolean }
+}) => {
+ return (
+
{Object.entries(data)
- .filter(([key, value]) => key !== 'status')
+ .filter(([key]) => key !== 'status')
.map(([key, value]) => (
-
+
))}
diff --git a/client/src/components/molecules/VersionNumbers/VersionTableRow.module.scss b/client/src/components/molecules/VersionNumbers/VersionTableRow.module.scss
new file mode 100644
index 0000000..22c9340
--- /dev/null
+++ b/client/src/components/molecules/VersionNumbers/VersionTableRow.module.scss
@@ -0,0 +1,19 @@
+@import '../../../styles/variables';
+
+.handle {
+ display: inline-block;
+ border: 0;
+ background: none;
+ box-shadow: none;
+ padding: 0;
+ margin: 0;
+ margin-left: -1rem;
+ padding-right: .5rem;
+ cursor: pointer;
+ color: $brand-grey-light;
+}
+
+.spinner {
+ composes: spinner, small from '../../atoms/Spinner.module.scss';
+ margin-right: $spacer;
+}
diff --git a/client/src/components/molecules/VersionNumbers/VersionTableRow.tsx b/client/src/components/molecules/VersionNumbers/VersionTableRow.tsx
new file mode 100644
index 0000000..a2c5cf0
--- /dev/null
+++ b/client/src/components/molecules/VersionNumbers/VersionTableRow.tsx
@@ -0,0 +1,99 @@
+import React from 'react'
+import useCollapse from 'react-collapsed'
+import { OceanPlatformTechStatus } from '@oceanprotocol/squid'
+import slugify from '@sindresorhus/slugify'
+import Spinner from '../../atoms/Spinner'
+import styles from './VersionTableRow.module.scss'
+import { VersionTableContracts } from './VersionTable'
+
+const VersionNumber = ({
+ name,
+ version,
+ network,
+ status
+}: {
+ name: string
+ version?: string
+ network?: string
+ status: OceanPlatformTechStatus
+}) =>
+ version ? (
+ <>
+
+ v{version}
+
+ {network && `(${network})`}
+ >
+ ) : (
+
+ {status === OceanPlatformTechStatus.Loading ? (
+
+ ) : (
+ status || 'Could not get version'
+ )}
+
+ )
+
+const VersionTableRow = ({ value }: { value: any }) => {
+ const collapseStyles = {
+ transition: '0.01s'
+ }
+
+ const expandStyles = {
+ transition: '0.01s'
+ }
+
+ const { getCollapseProps, getToggleProps, isOpen } = useCollapse({
+ collapseStyles,
+ expandStyles
+ })
+
+ return (
+ <>
+
+
+ {value.contracts && (
+
+ )}
+
+ {value.name}
+
+ |
+
+
+ |
+
+ {value.contracts && (
+
+
+
+ |
+
+ )}
+ >
+ )
+}
+
+export default VersionTableRow
diff --git a/client/src/components/molecules/VersionNumbers/index.tsx b/client/src/components/molecules/VersionNumbers/index.tsx
index 6f48074..a0bd001 100644
--- a/client/src/components/molecules/VersionNumbers/index.tsx
+++ b/client/src/components/molecules/VersionNumbers/index.tsx
@@ -12,6 +12,7 @@ import { faucetUri } from '../../../config'
import { User } from '../../../context'
import VersionTable from './VersionTable'
+import VersionStatus from './VersionStatus'
export const commonsVersion =
process.env.NODE_ENV === 'production' ? version : `${version}-dev`
@@ -63,15 +64,15 @@ export default class VersionNumbers extends PureComponent<
},
status: {
ok: false,
- contracts: false,
- network: false
+ network: false,
+ contracts: false
}
}
// for canceling axios requests
public signal = axios.CancelToken.source()
- public componentDidMount() {
+ public async componentDidMount() {
this.getOceanVersions()
this.getFaucetVersion()
}
@@ -145,8 +146,9 @@ export default class VersionNumbers extends PureComponent<
) : (
- Ocean Components in use
+ Ocean Components Status
+
)
diff --git a/client/src/components/molecules/VersionNumbers/utils.test.ts b/client/src/components/molecules/VersionNumbers/utils.test.ts
deleted file mode 100644
index 0fa7677..0000000
--- a/client/src/components/molecules/VersionNumbers/utils.test.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { isJsonString } from './utils'
-
-describe('isJsonString', () => {
- it('detects json correctly', () => {
- const testJson = isJsonString('{ "hello": "squid" }')
- expect(testJson).toBeTruthy()
-
- const testNonJson = isJsonString('
')
- expect(testNonJson).toBeFalsy()
- })
-})
diff --git a/client/src/components/molecules/VersionNumbers/utils.ts b/client/src/components/molecules/VersionNumbers/utils.ts
deleted file mode 100644
index 0b12378..0000000
--- a/client/src/components/molecules/VersionNumbers/utils.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export function isJsonString(str: string) {
- try {
- JSON.parse(str)
- } catch (e) {
- return false
- }
- return true
-}