allow node select from table

This commit is contained in:
fmtabbara
2024-12-19 11:44:55 +00:00
parent fb8b4f82db
commit e3885b9fe6
3 changed files with 114 additions and 921 deletions
@@ -0,0 +1,14 @@
import { ContentLayout } from "@/components/contentLayout/ContentLayout";
import SectionHeading from "@/components/headings/SectionHeading";
import { Typography } from "@mui/material";
const NotFound = () => {
return (
<ContentLayout>
<SectionHeading title="Nym Node" />
<Typography variant="body3">This Nym Node could not be found</Typography>
</ContentLayout>
);
};
export default NotFound;
@@ -7,6 +7,7 @@ import {
MaterialReactTable,
useMaterialReactTable,
} from "material-react-table";
import { useRouter } from "next/navigation";
import { useCallback, useMemo } from "react";
import CountryFlag from "../countryFlag/CountryFlag";
import { Favorite, UnFavorite } from "../favorite/Favorite";
@@ -25,6 +26,8 @@ const ColumnHeading = ({
};
const NodeTable = ({ nodes }: { nodes: MappedNymNodes }) => {
const router = useRouter();
const [favorites, saveFavorites] = useLocalStorage<string[]>(
"nym-node-favorites",
[],
@@ -195,8 +198,11 @@ const NodeTable = ({ nodes }: { nodes: MappedNymNodes }) => {
border: "none",
},
},
muiTableBodyRowProps: {
hover: false,
muiTableBodyRowProps: ({ row }) => ({
onClick: () => {
router.push(`/nym-node/${row.original.nodeId}`);
},
hover: true,
sx: {
":nth-child(odd)": {
bgcolor: "#F3F7FB !important",
@@ -204,8 +210,9 @@ const NodeTable = ({ nodes }: { nodes: MappedNymNodes }) => {
":nth-child(even)": {
bgcolor: "white !important",
},
cursor: "pointer",
},
},
}),
});
return <MaterialReactTable table={table} />;
};
+90 -918
View File
File diff suppressed because it is too large Load Diff