diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index 9dc8d2e..5369b04 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -1,12 +1,11 @@ import { SeparatorWithAnchor } from '../../components'; -import data from '../../datas/home.json'; import news from '../../datas/recent_news_event.json'; import popular from '../../datas/popular.json'; import critics_users_pick from '../../datas/critics_users_best_pick.json'; import popular_user_review from '../../datas/popular_user_reviews.json'; import './style.css'; import { useEffect, useState } from 'preact/hooks'; -import { getListLocations, getListRecentLocationsRatings } from '../../services'; +import { getListRecentLocationsRatingsService } from '../../services'; type NewPlaces = { id: Number, @@ -28,12 +27,14 @@ type News = { } function Home() { - const [recentLocations, setRecentLocations] = useState([]) + const [recentLocations, setRecentLocations] = useState>([]) + // const [isLoading, setIsLoading] = useState(true) async function getRecentLocations() { try { - const locations = await getListRecentLocationsRatings(12) + const locations = await getListRecentLocationsRatingsService(12) setRecentLocations(locations.data) + // setIsLoading(false) } catch(error) { console.log(error) } @@ -49,7 +50,7 @@ function Home() { {/* RECENTLY ADDED SECTION */}
- {recentLocations.map((x: NewPlaces) => ( + {recentLocations.map((x) => (
{x.name} diff --git a/src/pages/Home/style.css b/src/pages/Home/style.css index 89d7f83..22bf954 100644 --- a/src/pages/Home/style.css +++ b/src/pages/Home/style.css @@ -1,8 +1,3 @@ -.main-content { - padding: 20px 25px; - text-align: left; -} - .recently-added-section-card { padding: 10px 1% 15px; display: inline-block; @@ -59,12 +54,6 @@ float: left; } -.users-score { - color: #a8adb3; - font-size: 0.875rem; - line-height: 1.25rem; -} - .critics-users-rating-container { margin-top: 0.75rem; } @@ -185,15 +174,4 @@ height: 100px; } - - .users-score { - font-size: .75rem; - line-height: 1rem; - } - - .users-score-bar p { - font-size: 0.75rem;; - line-height: 1rem; - } - } \ No newline at end of file