Skip to content

Commit

Permalink
removed chain connection message
Browse files Browse the repository at this point in the history
  • Loading branch information
tenfinney committed Mar 1, 2022
1 parent 5bb8f16 commit 1832d8c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
1 change: 0 additions & 1 deletion packages/web/components/MegaMenu/MegaMenuHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ export const MegaMenuHeader: React.FC = () => {
>
Connect
</MetaButton>
<Text color="red"> Mainnet Required</Text>
</Stack>
)}
</Box>
Expand Down
14 changes: 9 additions & 5 deletions packages/web/components/Setup/WizardPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const WizardPane = <T,>({
} = useForm();
const current = watch(field, existing);
const dirty = current !== existing || dirtyFields[field];
const { connecting, connected, connect } = useWeb3();
const { connecting, connected, connect, chainId } = useWeb3();
const toast = useToast();

useEffect(() => {
Expand Down Expand Up @@ -142,14 +142,18 @@ export const WizardPane = <T,>({
[current, field, setValue],
);

if (!connecting && !connected) {
if ((!connecting && !connected) || chainId !== '0x1') {
return (
<Stack mt={['-12rem', '-8rem']}>
<Image w="min(40rem, 100%)" maxW="130%" src={cursiveTitle} />
<Box align="center" mt="10vh ! important">
<MetaButton onClick={connect} px={[8, 12]}>
Connect To Progress
</MetaButton>
{connecting || !connected ? (
<MetaButton onClick={connect} px={[8, 12]} isLoading={connecting}>
Connect To Progress
</MetaButton>
) : (
<Text fontSize="xl">Please switch to Mainnet to continue</Text>
)}
</Box>
<Flex justify="center" mt="2rem ! important">
<Tooltip label="Join Our Discord" hasArrow>
Expand Down
4 changes: 2 additions & 2 deletions packages/web/contexts/Web3Context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type Web3ContextType = {
provider: Maybe<providers.Web3Provider>;
ceramic: Maybe<CeramicApi>;
address: Maybe<string>;
chainId: Maybe<number>;
chainId: Maybe<string>;
authToken: Maybe<string>;
connect: () => Promise<void>;
disconnect: () => void;
Expand Down Expand Up @@ -102,7 +102,7 @@ type Web3State = {
wallet: Maybe<Web3Modal>;
provider: Maybe<providers.Web3Provider>;
address: Maybe<string>;
chainId: Maybe<number>;
chainId: Maybe<string>;
authToken: Maybe<string>;
};

Expand Down
20 changes: 4 additions & 16 deletions packages/web/pages/profile/setup/complete.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
import { MegaMenu } from 'components/MegaMenu';
import { SetupDone } from 'components/Setup/SetupDone';
import { SetupProfile } from 'components/Setup/SetupProfile';
import { SetupContextProvider } from 'contexts/SetupContext';
import { InferGetStaticPropsType } from 'next';
import React from 'react';

export const getStaticProps = async () => ({
props: {
hideTopMenu: true,
},
});

export type DefaultSetupProps = InferGetStaticPropsType<typeof getStaticProps>;

const SetupComplete: React.FC<DefaultSetupProps> = () => (
const SetupComplete: React.FC = () => (
<SetupContextProvider>
<MegaMenu>
<SetupProfile>
<SetupDone />
</SetupProfile>
</MegaMenu>
<SetupProfile>
<SetupDone />
</SetupProfile>
</SetupContextProvider>
);
export default SetupComplete;

0 comments on commit 1832d8c

Please sign in to comment.