Skip to content

Commit 5cd09e0

Browse files
committed
chore: cleanup
1 parent f15eb8d commit 5cd09e0

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

packages/app/src/pages/CreateGoodCollectivePage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ function CreateGoodCollectivePage() {
55
return (
66
<Layout>
77
<CreateGoodCollective />
8-
{/* TODO Show has to log in wallet first */}
98
</Layout>
109
);
1110
}

packages/app/src/pages/HomePage.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import Layout from '../components/Layout/Layout';
1313
import { IpfsCollective } from '../models/models';
1414
import { useCollectivesMetadata } from '../hooks';
1515
import useCrossNavigate from '../routes/useCrossNavigate';
16+
import { useAccount } from 'wagmi';
17+
import WarningBox from '../components/WarningBox';
1618

1719
const homeContainerStyles = {
1820
flex: 1,
@@ -76,12 +78,19 @@ const HomePage = () => {
7678

7779
const collectivesSectionRef = useRef<any>(null);
7880

81+
const { isConnected } = useAccount();
82+
7983
const scrollToCollectives = () => {
8084
if (collectivesSectionRef.current) {
8185
collectivesSectionRef.current.scrollIntoView({ behavior: 'smooth' });
8286
}
8387
};
8488

89+
const redirectToCreateCollective = () => {
90+
if (!isConnected) return;
91+
navigate(`/create`);
92+
};
93+
8594
const stats = totalStats
8695
? Object.keys(statsCopy).map((keys) => {
8796
const key = keys as keyof typeof totalStats;
@@ -143,11 +152,18 @@ individuals and communities by providing direct digital payments to those who ne
143152
onPress={scrollToCollectives}
144153
/>
145154
<ActionButton
146-
onPress={() => navigate(`/create`)}
155+
onPress={redirectToCreateCollective}
147156
text="Create a GoodCollective"
148157
bg="goodPurple.100"
149158
textColor="goodPurple.400"
150159
/>
160+
{!isConnected && (
161+
<WarningBox
162+
content={{
163+
title: 'Please connect a wallet to proceed',
164+
}}
165+
/>
166+
)}
151167
</HStack>
152168
</VStack>
153169
</VStack>

0 commit comments

Comments
 (0)