Add myNode indicators to sidebar
This commit is contained in:
@@ -49,7 +49,7 @@ export const Logs = (): JSX.Element => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full flex-col gap-4 p-4">
|
<div className="flex h-full flex-col gap-4 p-4">
|
||||||
<Card className="flex-grow">
|
<Card className="flex-grow overflow-y-auto">
|
||||||
<table className="table-cell flex-grow">
|
<table className="table-cell flex-grow">
|
||||||
<tbody
|
<tbody
|
||||||
className="
|
className="
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { m } from 'framer-motion';
|
||||||
import mapbox from 'mapbox-gl';
|
import mapbox from 'mapbox-gl';
|
||||||
|
import { BiCrown } from 'react-icons/bi';
|
||||||
import {
|
import {
|
||||||
FiAlignLeft,
|
FiAlignLeft,
|
||||||
FiCode,
|
FiCode,
|
||||||
@@ -12,6 +14,7 @@ import { IoTelescope } from 'react-icons/io5';
|
|||||||
import { MdGpsFixed, MdGpsNotFixed, MdGpsOff } from 'react-icons/md';
|
import { MdGpsFixed, MdGpsNotFixed, MdGpsOff } from 'react-icons/md';
|
||||||
import JSONPretty from 'react-json-pretty';
|
import JSONPretty from 'react-json-pretty';
|
||||||
|
|
||||||
|
import { Tooltip } from '@app/components/generic/Tooltip';
|
||||||
import { IconButton } from '@components/generic/button/IconButton';
|
import { IconButton } from '@components/generic/button/IconButton';
|
||||||
import { CollapsibleSection } from '@components/generic/Sidebar/CollapsibleSection';
|
import { CollapsibleSection } from '@components/generic/Sidebar/CollapsibleSection';
|
||||||
import { SidebarOverlay } from '@components/generic/Sidebar/SidebarOverlay';
|
import { SidebarOverlay } from '@components/generic/Sidebar/SidebarOverlay';
|
||||||
@@ -96,7 +99,17 @@ export const NodeCard = ({
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className="flex dark:text-white">
|
<div className="flex dark:text-white">
|
||||||
<div className="m-auto">
|
<div className="relative m-auto">
|
||||||
|
{isMyNode && (
|
||||||
|
<Tooltip content="Your Node">
|
||||||
|
<m.div
|
||||||
|
whileHover={{ scale: 1.05 }}
|
||||||
|
className="absolute -right-1 -top-1 rounded-full bg-yellow-500 p-0.5"
|
||||||
|
>
|
||||||
|
<BiCrown className="h-3 w-3" />
|
||||||
|
</m.div>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
<Hashicon value={node.number.toString()} size={32} />
|
<Hashicon value={node.number.toString()} size={32} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { m } from 'framer-motion';
|
||||||
import type { Edge, Node } from 'react-flow-renderer';
|
import type { Edge, Node } from 'react-flow-renderer';
|
||||||
import ReactFlow, { Background, Controls, MiniMap } from 'react-flow-renderer';
|
import ReactFlow, { Background, Controls, MiniMap } from 'react-flow-renderer';
|
||||||
|
import { BiCrown } from 'react-icons/bi';
|
||||||
import { FiSettings } from 'react-icons/fi';
|
import { FiSettings } from 'react-icons/fi';
|
||||||
import { RiMindMap } from 'react-icons/ri';
|
import { RiMindMap } from 'react-icons/ri';
|
||||||
|
|
||||||
|
import { Tooltip } from '@app/components/generic/Tooltip';
|
||||||
import { IconButton } from '@components/generic/button/IconButton';
|
import { IconButton } from '@components/generic/button/IconButton';
|
||||||
import { Layout } from '@components/layout';
|
import { Layout } from '@components/layout';
|
||||||
import { SidebarItem } from '@components/layout/Sidebar/SidebarItem';
|
import { SidebarItem } from '@components/layout/Sidebar/SidebarItem';
|
||||||
@@ -97,7 +100,17 @@ export const Nodes = (): JSX.Element => {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className="flex dark:text-white">
|
<div className="flex dark:text-white">
|
||||||
<div className="m-auto">
|
<div className="relative m-auto">
|
||||||
|
{node.number === myNodeNum && (
|
||||||
|
<Tooltip content="Your Node">
|
||||||
|
<m.div
|
||||||
|
whileHover={{ scale: 1.05 }}
|
||||||
|
className="absolute -right-1 -top-1 rounded-full bg-yellow-500 p-0.5"
|
||||||
|
>
|
||||||
|
<BiCrown className="h-3 w-3" />
|
||||||
|
</m.div>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
<Hashicon value={node.number.toString()} size={32} />
|
<Hashicon value={node.number.toString()} size={32} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user