Merge pull request #2422 from bluewave-labs/feat/notification-on-click

feat: add row click handling to notificaitons table
This commit is contained in:
Alexander Holliday
2025-06-10 14:21:29 +08:00
committed by GitHub
2 changed files with 12 additions and 1 deletions

View File

@@ -131,7 +131,7 @@ const useEditNotification = () => {
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState(null);
const { t } = useTranslation();
const navigate = useNavigate();
const editNotification = async (id, notification) => {
try {
setIsLoading(true);
@@ -139,6 +139,7 @@ const useEditNotification = () => {
createToast({
body: t("notifications.edit.success"),
});
navigate(`/notifications`);
} catch (error) {
setError(error);
createToast({

View File

@@ -119,6 +119,16 @@ const Notifications = () => {
</Stack>
<Typography variant="h1">{t("notifications.createTitle")}</Typography>
<DataTable
config={{
onRowClick: (row) => navigate(`/notifications/${row._id}`),
rowSX: {
cursor: "pointer",
"&:hover td": {
backgroundColor: theme.palette.tertiary.main,
transition: "background-color .3s ease",
},
},
}}
headers={headers}
data={notifications}
/>