diff --git a/frontend/src/Network.tsx b/frontend/src/Network.tsx index 316abbb..3d04327 100644 --- a/frontend/src/Network.tsx +++ b/frontend/src/Network.tsx @@ -12,6 +12,7 @@ import { import { customTheme } from "./NetworkTheme"; import { useSession } from "./Session"; import { useNavigate } from "react-router"; +import { ChevronDown, ChevronUp, Settings2 } from "lucide-react"; interface NetworkData { nodes: GraphNode[]; @@ -43,7 +44,10 @@ export const GraphComponent = () => { const [loading, setLoading] = useState(true); const [error, setError] = useState(""); const [threed, setThreed] = useState(false); + const [showControls, setShowControls] = useState(true); const [likes, setLikes] = useState(2); + const [showLikes, setShowLikes] = useState(true); + const [showDislikes, setShowDislikes] = useState(false); const [popularity, setPopularity] = useState(false); const [mutuality, setMutuality] = useState(false); const { user, teams } = useSession(); @@ -96,17 +100,6 @@ export const GraphComponent = () => { setMutuality(!mutuality); } - function showLabel() { - switch (likes) { - case 0: - return "dislike"; - case 1: - return "both"; - case 2: - return "like"; - } - } - function findMatches(edges: GraphEdge[]) { const adjacencyList = edges.map( (edge) => edge.source + edge.target + edge.data.relation @@ -157,6 +150,10 @@ export const GraphComponent = () => { setData({ nodes: newNodes, edges: data.edges }); } + useEffect(() => { + setLikes(+!showLikes + +showDislikes); + }, [showLikes, showDislikes]); + useEffect(() => { if (mutuality) colorMatches(false); colorMatches(mutuality); @@ -183,7 +180,9 @@ export const GraphComponent = () => { let content: ReactNode; if (loading) { - content = ; +
+
+
+