diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 50f0042af..e1831f58a 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -11,7 +11,7 @@ "governmentServices": "Government Services", "description": "Access official government services quickly and easily. Find what you need for citizenship, business, education, and more.", "viewAll": "View All Services", - "viewAllCategory": "View All" + "viewAllCategory": "View more" }, "weather": { "title": "Weather Updates" diff --git a/src/components/home/InfoWidgets.tsx b/src/components/home/InfoWidgets.tsx index eba9fdf97..4ba11b736 100644 --- a/src/components/home/InfoWidgets.tsx +++ b/src/components/home/InfoWidgets.tsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import * as LucideIcons from 'lucide-react'; -import { Card, CardHeader, CardContent } from '../ui/Card'; +import { Card, CardContent } from '../ui/Card'; import { WeatherData, ForexRate } from '../../types'; import { useTranslation } from 'react-i18next'; import CriticalHotlinesWidget from '../widgets/CriticalHotlinesWidget'; @@ -19,7 +19,7 @@ const InfoWidgets: React.FC = () => { // Function to get weather icon component const getWeatherIcon = (iconName: string) => { const Icon = LucideIcons[iconName as keyof typeof LucideIcons]; - return Icon ? : null; + return Icon ? : null; }; // Fetch weather data @@ -79,16 +79,23 @@ const InfoWidgets: React.FC = () => { return (
-
+
{/* Weather Widget */} - - +
+

{t('weather.title')}

- - + + Detailed Forecast + + +
+
{isLoadingWeather ? (
@@ -99,57 +106,58 @@ const InfoWidgets: React.FC = () => {

{weatherError}

) : ( -
+
{weatherData.map(location => ( -
-
- {getWeatherIcon(location.icon)} -
-
- {location.location} -
-
- {location.temperature}°C -
-
- {location.condition} -
-
+ +
+ {location.location} +
+
+ {getWeatherIcon(location.icon)} +
+
+ {location.temperature}°C +
+
+ {location.condition} +
+
+ ))}
)} - - - +
+
{/* Forex Widget */} - - +
+

{t('forex.title')}

- - -
- + + More Currencies + + + +
+
+
- - @@ -182,18 +190,18 @@ const InfoWidgets: React.FC = () => { ) : ( forexRates.map(rate => ( - - )) @@ -201,19 +209,11 @@ const InfoWidgets: React.FC = () => {
+ Currency - ₱ Rate + + Peso Rate
+
-
+
{rate.code}
-
+
{rate.currency}
- ₱{rate.rate.toFixed(2)} + + {rate.rate.toFixed(2)}
- -
- +
+
{/* Emergency Hotlines Widget */} -
+
diff --git a/src/components/home/ServicesSection.tsx b/src/components/home/ServicesSection.tsx index b9d83dbab..b106b17cb 100644 --- a/src/components/home/ServicesSection.tsx +++ b/src/components/home/ServicesSection.tsx @@ -1,6 +1,6 @@ import React from 'react'; import * as LucideIcons from 'lucide-react'; -import { Card, CardContent } from '../ui/Card'; +import { Card, CardContent, CardHeader } from '../ui/Card'; import serviceCategories from '../../data/service_categories.json'; import { Link } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; @@ -62,40 +62,42 @@ const ServicesSection: React.FC = () => { - -
-
- {getIcon(category.category)} -
- -

- {category.category} -

+ +
+ {getIcon(category.category)}
+

+ {category.category} +

+
-
    - {category.subcategories.slice(0, 3).map(subcategory => ( -
  • - - - {subcategory.name} - -
  • - ))} -
- - - {t('services.viewAllCategory')} {category.category} - - + +
+
    + {category.subcategories.slice(0, 3).map(subcategory => ( +
  • + + {subcategory.name} + + +
  • + ))} +
+
+
+ + {t('services.viewAllCategory')} + + +
))} @@ -104,9 +106,12 @@ const ServicesSection: React.FC = () => {
{t('services.viewAll')} +
+ +
diff --git a/src/components/ui/Card.tsx b/src/components/ui/Card.tsx index c3d106c07..f3baf50e5 100644 --- a/src/components/ui/Card.tsx +++ b/src/components/ui/Card.tsx @@ -16,9 +16,8 @@ const Card = ({ return (
= ({ maxItems ); + function getIcon(hotline_name: string) { + const icons: Partial> = { + 'National Emergency Hotline': TriangleAlert, + 'PNP Emergency': Siren, + 'Red Cross': Cross, + 'Mental Health Crisis Line': Brain, + }; + const Icon = icons[hotline_name]; + return Icon ? : null; + } + return ( -
-
-
- -

Critical Emergency Hotlines

+
+
+
+ +

+ Critical Emergency Hotlines +

- View all + View all +
-
+
{displayedHotlines.map((hotline, index) => ( -
- {hotline.name} -
+ + + {getIcon(hotline.name)} + {hotline.name} + + {hotline.numbers.map((number, idx) => ( - - - {number} - +
+ +
+ + {number} + + ))} -
-
+ + ))}
- -
- - See all emergency hotlines - - -
);