1- import React , { useState , Dispatch , SetStateAction } from 'react' ;
21import { Link } from 'gatsby' ;
2+ import React , { useState , Dispatch , SetStateAction } from 'react' ;
33import Layout from '../components/layout' ;
44import SEO from '../components/seo' ;
55import MessageThreadSection from '../components/conversation-section' ;
@@ -67,6 +67,8 @@ const BrowsePage = (props: any) => {
6767 const latitude = position . coords . latitude ;
6868 const longitude = position . coords . longitude ;
6969
70+ console . log ( 'found location: lat: ' , latitude , " long: " , longitude )
71+
7072 dispatch ( submitUpdatedLocation ( {
7173 type : 'Point' ,
7274 coordinates : [ latitude , longitude ]
@@ -96,7 +98,8 @@ const BrowsePage = (props: any) => {
9698 }
9799
98100 { /* === Zipcode Not Yet Set === */ }
99- { ! props . currentGeolocation &&
101+ { /* {!props.currentGeolocation && */ }
102+ { ! props . location &&
100103 < >
101104 < p >
102105 [No Geo]
@@ -108,14 +111,20 @@ const BrowsePage = (props: any) => {
108111 }
109112
110113 { /* === Zipcode Has Been Set === */ }
111- { props . currentGeolocation &&
114+ { /* {props.currentGeolocation && */ }
115+ { props . location &&
112116 < >
113117 < h3 >
114118 Showing listings within 25 miles of { props . currentZipcode } .
115119 </ h3 >
116120
117121 < h3 > Listings from redux:</ h3 >
118- < ListingItem creator = { "You" } messagesRoomsList = { props . listings } />
122+
123+ { props . listings . forEach ( ( listing : any ) => (
124+
125+ < ListingItem creator = { listing . creator } descriptiong = { listing . description } />
126+ )
127+ ) }
119128
120129 </ >
121130 }
@@ -192,6 +201,7 @@ const mapStateToProps = (state: IState) => {
192201 userId : state . userReducer ?. userId ,
193202
194203 listings : state . listingsReducer ?. listings ,
204+ location : state . listingsReducer ?. location ,
195205 manuallyEditingLocation : state . globalAppPropertiesReducer ?. manuallyEditingLocation ,
196206
197207 currentZipcode : state . userReducer ?. zipcode ? state . userReducer ?. zipcode :
0 commit comments