@@ -13,6 +13,8 @@ import Layout from '../components/Layout/Layout';
1313import { IpfsCollective } from '../models/models' ;
1414import { useCollectivesMetadata } from '../hooks' ;
1515import useCrossNavigate from '../routes/useCrossNavigate' ;
16+ import { useAccount } from 'wagmi' ;
17+ import WarningBox from '../components/WarningBox' ;
1618
1719const 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