@@ -14,6 +14,8 @@ import Toast from '../components/utils/Toast';
1414import { colors } from '../colors' ;
1515import axios from 'axios' ;
1616import { createAuthHeaders , getUser } from '../utils/firebase' ;
17+ import ApartmentCards from '../components/ApartmentCard/SearchResultsPageApartmentCards' ;
18+ import { CardData } from '../App' ;
1719
1820type Props = {
1921 user : firebase . User | null ;
@@ -75,7 +77,7 @@ const FolderDetailPage = ({ user, setUser }: Props): ReactElement => {
7577 const { background, headerStyle, headerContainer, backButton, gridContainer } = useStyles ( ) ;
7678
7779 const [ folder , setFolder ] = useState < Folder | null > ( null ) ;
78- const [ apartments , setApartments ] = useState < string [ ] > ( [ ] ) ;
80+ const [ apartments , setApartments ] = useState < CardData [ ] > ( [ ] ) ;
7981 const [ loading , setLoading ] = useState < boolean > ( true ) ;
8082 const [ showErrorToast , setShowErrorToast ] = useState < boolean > ( false ) ;
8183 const [ errorMessage , setErrorMessage ] = useState < string > ( '' ) ;
@@ -191,24 +193,7 @@ const FolderDetailPage = ({ user, setUser }: Props): ReactElement => {
191193 </ Box >
192194 ) : (
193195 < Grid container spacing = { 3 } className = { gridContainer } >
194- { apartments . map ( ( aptId ) => (
195- < Grid item xs = { 12 } sm = { 6 } md = { 4 } key = { aptId } >
196- < Box
197- style = { {
198- padding : '2em' ,
199- backgroundColor : 'white' ,
200- borderRadius : '8px' ,
201- cursor : 'pointer' ,
202- } }
203- onClick = { ( ) => history . push ( `/apartment/${ aptId } ` ) }
204- >
205- < Typography variant = "h6" > Apartment { aptId } </ Typography >
206- < Typography variant = "body2" style = { { color : colors . gray2 , marginTop : '0.5em' } } >
207- Click to view details
208- </ Typography >
209- </ Box >
210- </ Grid >
211- ) ) }
196+ < ApartmentCards data = { apartments } user = { user } setUser = { setUser } />
212197 </ Grid >
213198 ) }
214199
0 commit comments