From 5df0ff6c5c69409c71d77b003f9d0154514cc0af Mon Sep 17 00:00:00 2001 From: saviojks Date: Wed, 4 Dec 2024 18:17:44 -0300 Subject: [PATCH] chore: promote to stagin --- src/components/Home/QuickAccess/index.tsx | 19 +++++++--- src/components/Home/QuickAccess/styles.ts | 8 ++-- .../CustomForms/CreateAsset/index.tsx | 37 +++++++++++-------- 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/src/components/Home/QuickAccess/index.tsx b/src/components/Home/QuickAccess/index.tsx index 35b5cc9c..e036edc8 100644 --- a/src/components/Home/QuickAccess/index.tsx +++ b/src/components/Home/QuickAccess/index.tsx @@ -1,4 +1,5 @@ import { Currency, PaperPlus, Token, Transfer } from '@/assets/transaction'; +import { getNetwork } from '@/utils/networkFunctions'; import { useTranslation } from 'next-i18next'; import React, { useState } from 'react'; import { FaRegSnowflake, FaRocket, FaVoteYea } from 'react-icons/fa'; @@ -27,6 +28,7 @@ const QuickAccess: React.FC<{ const [contractType, setContractType] = useState(''); const [openModalTransactions, setOpenModalTransactions] = useState(false); const [titleModal, setTitleModal] = useState(''); + const network = getNetwork(); const quickAccessContract: IShortCutContract[] = [ { @@ -46,12 +48,16 @@ const QuickAccess: React.FC<{ openWiz: () => setWizard('NFT'), icon: , }, - { - title: 'Create SFT', - type: 'CreateAssetContract', - openWiz: () => setWizard('SFT'), - icon: , - }, + ...(network !== 'mainnet' + ? [ + { + title: 'Create SFT', + type: 'CreateAssetContract', + openWiz: () => setWizard('SFT'), + icon: , + }, + ] + : []), { title: 'Create ITO', type: 'ConfigITOContract', @@ -100,6 +106,7 @@ const QuickAccess: React.FC<{ handleClick(contract, e)} + isMainNet={network !== 'mainnet'} > {contract.icon}

{contract.title}

diff --git a/src/components/Home/QuickAccess/styles.ts b/src/components/Home/QuickAccess/styles.ts index b692a169..40350270 100644 --- a/src/components/Home/QuickAccess/styles.ts +++ b/src/components/Home/QuickAccess/styles.ts @@ -39,7 +39,9 @@ export const TitleContainer = styled.div` } `; -export const CardItem = styled.div` +export const CardItem = styled.div<{ + isMainNet: boolean; +}>` ${DefaultCardStyles} display: flex; flex-direction: column; @@ -93,10 +95,10 @@ export const CardItem = styled.div` grid-column: span 2; &:nth-last-child(2) { - grid-column: 0; + grid-column: ${props => (props.isMainNet ? 0 : '1/4')}; } &:nth-last-child(1) { - grid-column: 5/7; + grid-column: ${props => (props.isMainNet ? '5/7' : '4/7')}; } } `; diff --git a/src/components/TransactionForms/CustomForms/CreateAsset/index.tsx b/src/components/TransactionForms/CustomForms/CreateAsset/index.tsx index 11a44db8..f12a4c0a 100644 --- a/src/components/TransactionForms/CustomForms/CreateAsset/index.tsx +++ b/src/components/TransactionForms/CustomForms/CreateAsset/index.tsx @@ -1,4 +1,5 @@ import { parseRoles } from '@/components/Wizard/utils'; +import { getNetwork } from '@/utils/networkFunctions'; import { ICreateAsset } from '@klever/sdk-web'; import React, { PropsWithChildren } from 'react'; import { useFormContext } from 'react-hook-form'; @@ -26,21 +27,6 @@ export interface ISectionProps { precision?: number; } -export const assetTypes = [ - { - label: 'Fungible', - value: 0, - }, - { - label: 'Non Fungible', - value: 1, - }, - { - label: 'Semi Fungible', - value: 2, - }, -]; - export const parseCreateAsset = (data: ICreateAsset) => { const dataCopy = JSON.parse(JSON.stringify(data)); parseTickerName(dataCopy); @@ -61,6 +47,27 @@ export const CreateAsset: React.FC> = ({ const type = watch('type'); + const network = getNetwork(); + + const assetTypes = [ + { + label: 'Fungible', + value: 0, + }, + { + label: 'Non Fungible', + value: 1, + }, + ...(network !== 'Mainnet' + ? [ + { + label: 'Semi Fungible', + value: 2, + }, + ] + : []), + ]; + const isFungible = type === 0; const isNFT = type === 1; const isSFT = type === 2;