From daf7865fec88d56f87a76ddbd85b206dc5235f27 Mon Sep 17 00:00:00 2001 From: mihaisc Date: Wed, 16 Nov 2022 11:39:28 +0200 Subject: [PATCH] add integration link --- app.config.js | 2 +- .../AssetActions/CalicaIntegration/index.tsx | 21 +++++++++++++++++++ src/components/Asset/AssetActions/index.tsx | 6 ++++-- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 src/components/Asset/AssetActions/CalicaIntegration/index.tsx diff --git a/app.config.js b/app.config.js index 2340747bf..9eabd2c4d 100644 --- a/app.config.js +++ b/app.config.js @@ -8,7 +8,7 @@ module.exports = { metadataCacheUri: process.env.NEXT_PUBLIC_METADATACACHE_URI || 'https://v4.aquarius.oceanprotocol.com', - + calicaUri: 'https://calica.xyz/ocean/contracts', // List of chainIds which metadata cache queries will return by default. // This preselects the Chains user preferences. chainIds: [1, 137, 56, 246, 1285], diff --git a/src/components/Asset/AssetActions/CalicaIntegration/index.tsx b/src/components/Asset/AssetActions/CalicaIntegration/index.tsx new file mode 100644 index 000000000..0ee109f3f --- /dev/null +++ b/src/components/Asset/AssetActions/CalicaIntegration/index.tsx @@ -0,0 +1,21 @@ +import { useAsset } from '@context/Asset' +import React from 'react' +import { useWeb3 } from '@context/Web3' +import { calicaUri } from 'app.config' +export default function CalicaIntegration() { + const { isOwner } = useAsset() + const { accountId } = useWeb3() + + return isOwner ? ( + + Use Calica for revenue split + + ) : ( + <> + ) +} diff --git a/src/components/Asset/AssetActions/index.tsx b/src/components/Asset/AssetActions/index.tsx index 1bedbff62..47648e39b 100644 --- a/src/components/Asset/AssetActions/index.tsx +++ b/src/components/Asset/AssetActions/index.tsx @@ -1,6 +1,6 @@ import React, { ReactElement, useState, useEffect } from 'react' import Compute from './Compute' -import Consume from './Download' +import Download from './Download' import { FileInfo, LoggerInstance, Datatoken } from '@oceanprotocol/lib' import Tabs, { TabsItem } from '@shared/atoms/Tabs' import { compareAsBN } from '@utils/numbers' @@ -16,6 +16,7 @@ import { useFormikContext } from 'formik' import { FormPublishData } from 'src/components/Publish/_types' import { getTokenBalanceFromSymbol } from '@utils/web3' import AssetStats from './AssetStats' +import CalicaIntegration from './CalicaIntegration' export default function AssetActions({ asset @@ -136,7 +137,7 @@ export default function AssetActions({ fileIsLoading={fileIsLoading} /> ) : ( - )} + )