+
- {/* Get in touch section */}
-
-
Get in touch
-
- If you have inquiries get in touch with us we'll happy to help you
-
-
+
+
+
{contact.title}
+
+ {contact.content}
+
+
- {/* Contact Information Cards */}
-
- {/* Phone Card */}
-
-
-
);
};
diff --git a/src/pages/NotificationPage.jsx b/src/pages/NotificationPage.jsx
index ebbbf53..576e114 100644
--- a/src/pages/NotificationPage.jsx
+++ b/src/pages/NotificationPage.jsx
@@ -1,102 +1,22 @@
-import React, { useState } from 'react';
-import { Tabs, Tab, IconButton, Menu, MenuItem } from '@mui/material';
-import { MoreVert, Delete } from '@mui/icons-material';
+import React from 'react';
+import { useQuery } from '@tanstack/react-query';
+import axiosInstance from '../api/axiosInstance';
+import { API_ENDPOINTS } from '../api/apiEndpoints';
+import { Notifications as NotificationsIcon } from '@mui/icons-material';
+import { useNavigate } from 'react-router-dom';
const NotificationPage = () => {
- const [activeTab, setActiveTab] = useState(0);
- const [anchorEl, setAnchorEl] = useState(null);
- const [selectedNotification, setSelectedNotification] = useState(null);
-
- const [notifications, setNotifications] = useState([
- {
- id: 1,
- type: 'message',
- user: 'Thangavel',
- avatar: 'https://i.pravatar.cc/150?img=1',
- message: 'has sent you a message',
- time: '1d',
- action: 'View message',
- category: 'all'
+ const navigate = useNavigate();
+
+ const { data: notificationData, isLoading, isError } = useQuery({
+ queryKey: ['notifications'],
+ queryFn: async () => {
+ const res = await axiosInstance.get(API_ENDPOINTS.NOTIFICATION_LIST);
+ return res.data;
},
- {
- id: 2,
- type: 'profile',
- user: 'Thangavel',
- avatar: 'https://i.pravatar.cc/150?img=2',
- message: 'and 3 others have viewed your profile',
- time: '1d',
- action: 'See who viewed',
- category: 'interactions'
- },
- {
- id: 3,
- type: 'interest',
- user: 'Parthiban',
- avatar: 'https://i.pravatar.cc/150?img=3',
- message: 'has sent you an interest',
- time: '1d',
- action: 'View interest',
- category: 'urgent'
- },
- {
- id: 4,
- type: 'message',
- user: 'Rajesh',
- avatar: 'https://i.pravatar.cc/150?img=4',
- message: 'replied to your message',
- time: '2d',
- action: 'View message',
- category: 'all'
- },
- {
- id: 5,
- type: 'profile',
- user: 'Priya',
- avatar: 'https://i.pravatar.cc/150?img=5',
- message: 'viewed your profile',
- time: '2d',
- action: 'See profile',
- category: 'interactions'
- },
- {
- id: 6,
- type: 'interest',
- user: 'Kumar',
- avatar: 'https://i.pravatar.cc/150?img=6',
- message: 'accepted your interest',
- time: '3d',
- action: 'View profile',
- category: 'urgent'
- }
- ]);
+ });
- const handleTabChange = (event, newValue) => {
- setActiveTab(newValue);
- };
-
- const handleMenuOpen = (event, notificationId) => {
- setAnchorEl(event.currentTarget);
- setSelectedNotification(notificationId);
- };
-
- const handleMenuClose = () => {
- setAnchorEl(null);
- setSelectedNotification(null);
- };
-
- const handleDelete = () => {
- setNotifications(notifications.filter(n => n.id !== selectedNotification));
- handleMenuClose();
- };
-
- const getFilteredNotifications = () => {
- if (activeTab === 0) return notifications;
- if (activeTab === 1) return notifications.filter(n => n.category === 'interactions');
- if (activeTab === 2) return notifications.filter(n => n.category === 'urgent');
- return notifications;
- };
-
- const filteredNotifications = getFilteredNotifications();
+ const notifications = notificationData?.data || [];
return (
@@ -106,119 +26,50 @@ const NotificationPage = () => {
Notifications
- {/* Tabs */}
-
-
-
-
-
-
-
-
{/* Notification List */}
-
- {filteredNotifications.length === 0 ? (
+
+ {isLoading ? (
+
Loading notifications...
+ ) : isError ? (
+
Failed to load notifications.
+ ) : notifications.length === 0 ? (
No notifications found
) : (
- <>
-
-
Yesterday
-
- {filteredNotifications.map((notification) => (
+
+ {notifications.map((notification) => (
notification.page && navigate(`/${notification.page}`)}
>
- {/* Avatar */}
-

+ {/* Icon */}
+
+
+
{/* Content */}
- {notification.user}{' '}
- {notification.message}
+ {notification.tittle}
+
+
+ {notification.description}
-
- {/* Time and Menu */}
+ {/* Time */}
- {notification.time}
- handleMenuOpen(e, notification.id)}
- sx={{
- color: '#6b7280',
- '&:hover': { backgroundColor: '#f3f4f6' }
- }}
- >
-
-
+ {notification.created_at}
))}
- >
+
)}
-
- {/* Delete Menu */}
-
);
diff --git a/src/pages/SafetyCentre.jsx b/src/pages/SafetyCentre.jsx
index 2fb34a1..8c8b7d6 100644
--- a/src/pages/SafetyCentre.jsx
+++ b/src/pages/SafetyCentre.jsx
@@ -1,41 +1,26 @@
-
import React from 'react';
-import { ArrowBackIosNew, Security, Report, Lock, Psychology } from '@mui/icons-material';
+import { Security, Psychology } from '@mui/icons-material';
import { useNavigate } from 'react-router-dom';
import { motion } from 'framer-motion';
import LazyImage from '../components/common/LazyImage';
-import safegirl from "../assets/images/safegirl.jpg";
-const dummyImage = "https://images.unsplash.com/photo-1594736797933-d0501ba2fe65?w=800&q=80&fit=crop";
+import { useQuery } from '@tanstack/react-query';
+import { getBeSafeOnline } from '../api/safety.api';
export default function SafetyCentre() {
const navigate = useNavigate();
- const safetyTips = [
- {
- icon:
,
- title: "Safety Tips",
- color: "red",
- desc: "Follow these practical guidelines to protect yourself while connecting with potential Matches."
- },
- {
- icon:
,
- title: "Report a Profile",
- color: "orange",
- desc: "Report any suspicious or inappropriate behavior immediately—especially requests for money, unsolicited contact, or blackmail threats."
- },
- {
- icon:
,
- title: "Privacy Settings",
- color: "pink",
- desc: "Manage who sees your photos, contact info, & profile and always be in control."
- },
- {
- icon:
,
- title: "Mental Wellbeing",
- color: "blue",
- desc: "Here's how you can prioritize your mental well-being while making this life-changing decision."
- }
- ];
+ const { data, isLoading } = useQuery({
+ queryKey: ['beSafeOnline'],
+ queryFn: getBeSafeOnline,
+ });
+
+ if (isLoading) {
+ return
Loading...
;
+ }
+
+ const safetyData = data?.data || [];
+ const heroData = safetyData.length > 0 ? safetyData[0] : null;
+ const tipsData = safetyData.length > 1 ? safetyData.slice(1) : [];
return (
@@ -54,52 +39,38 @@ export default function SafetyCentre() {
{/* Hero Section */}
-
-
-
- Safety Centre
-
- Your safety matters deeply at Thirukalyanam.
- Our team works with advanced tools to ensure your matchmaking journey remains secure and safe.
-
-
-
-
-
-
-
-
-
+ {heroData && (
+
+
+
+ {heroData.title}
+
+
+ {heroData.content}
+
+
+
+
+ )}
{/* Safety Tips Grid */}
- {safetyTips.map((tip, index) => (
+ {tipsData.map((tip, index) => (
-
- {tip.icon}
+
+
-
+
{tip.title}
-
{tip.desc}
+
{tip.content}
))}