diff --git a/package.json b/package.json index d0d29d3..4cb3d1b 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,9 @@ "@mantine/next": "4.2.2", "@mantine/notifications": "4.2.2", "@mantine/prism": "^4.2.11", - "@meemproject/api": "^0.7.11", - "@meemproject/meem-contracts": "^0.7.11", - "@meemproject/react": "^0.7.11", + "@meemproject/api": "^0.8.0", + "@meemproject/meem-contracts": "^0.8.0", + "@meemproject/react": "^0.8.0", "@next/bundle-analyzer": "^12.1.4", "@types/superagent": "^4.1.15", "blob-util": "^2.0.2", @@ -81,7 +81,7 @@ "@zeit/next-source-maps": "^0.0.3", "apollo": "^2.33.10", "eslint": "^8.13.0", - "eslint-config-kengoldfarb": "^1.4.2", + "eslint-config-kengoldfarb": "^1.4.4", "eslint-plugin-react-hooks": "^4.3.0", "fs-extra": "^10.0.0", "jest": "^27.5.1", diff --git a/src/components/Bundles/BundleContainer.tsx b/src/components/Bundles/BundleContainer.tsx index e5ef316..f364ebc 100644 --- a/src/components/Bundles/BundleContainer.tsx +++ b/src/components/Bundles/BundleContainer.tsx @@ -1,21 +1,43 @@ import { useSubscription } from '@apollo/client' import log from '@kengoldfarb/log' -import { Text, Center, Button, Space, Title, Skeleton } from '@mantine/core' +import { + Text, + Center, + Button, + Space, + Title, + Skeleton, + Modal, + createStyles +} from '@mantine/core' import { formList, useForm } from '@mantine/form' import { showNotification } from '@mantine/notifications' import { MeemAPI } from '@meemproject/api' import { makeFetcher } from '@meemproject/react' import { useRouter } from 'next/router' import React, { useEffect, useState } from 'react' -import { SubGetBundleByIdSubscription } from '../../../generated/graphql' +import { + Contracts, + SubGetBundleByIdSubscription +} from '../../../generated/graphql' import { SUB_GET_BUNDLE_BY_ID } from '../../graphql/contracts' import { downloadFile } from '../../lib/utils' import { Page } from '../../styles/Page' import { DemoCode } from '../Atoms/DemoCode' import { BundleForm } from './BundleForm' +import { DeployBundle } from './DeployBundle' + +const useStyles = createStyles(_theme => ({ + row: { + alignItems: 'center', + display: 'flex', + flexDirection: 'row' + } +})) export const BundleContainer: React.FC = () => { const router = useRouter() + const { classes } = useStyles() const bundleId = router.query.bundleId as string const form = useForm({ @@ -29,6 +51,7 @@ export const BundleContainer: React.FC = () => { const [hasInitialized, setHasInitialized] = useState(false) const [isSaving, setIsSaving] = useState(false) + const [isOpen, setIsOpen] = useState(false) const { loading: isLoading, data } = useSubscription(SUB_GET_BUNDLE_BY_ID, { @@ -105,6 +128,15 @@ export const BundleContainer: React.FC = () => { } }, [hasInitialized, form, data]) + const contracts: Contracts[] = [] + if (data?.Bundles[0].BundleContracts) { + data?.Bundles[0].BundleContracts.forEach(bc => { + if (bc.Contract) { + contracts.push(bc.Contract as Contracts) + } + }) + } + return (
handleSave(values))}> @@ -123,35 +155,45 @@ export const BundleContainer: React.FC = () => { } /> - +
+ + + +
{!hasInitialized && ( <> @@ -163,7 +205,11 @@ export const BundleContainer: React.FC = () => { {hasInitialized && ( <> Bundle Info - +