diff --git a/src/components/Atoms/FacetList.tsx b/src/components/Atoms/FacetList.tsx index 5df5df1..dde36e2 100644 --- a/src/components/Atoms/FacetList.tsx +++ b/src/components/Atoms/FacetList.tsx @@ -36,6 +36,7 @@ export interface IProps { contracts?: Contracts[] isLoading?: boolean isEnabled?: boolean + isDisabled?: boolean } export const FacetList: React.FC = ({ @@ -44,6 +45,7 @@ export const FacetList: React.FC = ({ contractInstances, contracts, isEnabled, + isDisabled, proxyContract }) => { const { classes } = useStyles() @@ -227,7 +229,8 @@ export const FacetList: React.FC = ({ = ({ )} - {isEnabled && ( + {isEnabled && !isDisabled && (
{ const { anonClient } = useMeemApollo() const { classes } = useStyles() const bundleId = router.query.bundleId as string - const { chainId } = useWallet() + const { chainId, accounts } = useWallet() const form = useForm({ initialValues: { @@ -253,17 +253,23 @@ export const BundleContainer: React.FC = () => { form={form} isLoading={isLoading} contracts={contracts} + isDisabled={ + data?.Bundles[0].Creator?.address !== + accounts[0] + } /> -
- -
+ {data?.Bundles[0].Creator?.address === accounts[0] && ( +
+ +
+ )} )} diff --git a/src/components/Bundles/BundleForm.tsx b/src/components/Bundles/BundleForm.tsx index c917265..a3c64f0 100644 --- a/src/components/Bundles/BundleForm.tsx +++ b/src/components/Bundles/BundleForm.tsx @@ -38,11 +38,13 @@ export interface IProps { form: UseFormReturnType contracts: Contracts[] isLoading?: boolean + isDisabled?: boolean } export const BundleForm: React.FC = ({ form, - isLoading: isParentLoading + isLoading: isParentLoading, + isDisabled }) => { const { anonClient } = useMeemApollo() const { classes } = useStyles() @@ -125,13 +127,15 @@ export const BundleForm: React.FC = ({
Facets - + {!isDisabled && ( + + )}
= ({ contracts={data?.Contracts as Contracts[]} isLoading={isLoading} isEnabled + isDisabled={isDisabled} /> { const [isUserMenuOpened, setUserMenuOpened] = useState(false) const { classes, cx } = useStyles() const router = useRouter() - const wallet = useWallet() + const wallet = useAuth() const navigateHome = () => { router.push({ pathname: '/' }) @@ -222,6 +222,22 @@ export const HeaderMenu: React.FC = () => { } > + {wallet.walletType === 'magic' && ( + { + try { + wallet.magic?.wallet.showUI() + } catch (e) { + // eslint-disable-next-line no-console + console.log(e) + } + }} + icon={} + > + Wallet + + )} {