diff --git a/src/assets/tutorial/edge-management.gif b/src/assets/tutorial/edge-management.gif new file mode 100644 index 00000000..e689ae71 Binary files /dev/null and b/src/assets/tutorial/edge-management.gif differ diff --git a/src/assets/tutorial/exploration.gif b/src/assets/tutorial/exploration.gif new file mode 100644 index 00000000..6e3765db Binary files /dev/null and b/src/assets/tutorial/exploration.gif differ diff --git a/src/assets/tutorial/inspection.gif b/src/assets/tutorial/inspection.gif new file mode 100644 index 00000000..454a9f41 Binary files /dev/null and b/src/assets/tutorial/inspection.gif differ diff --git a/src/assets/tutorial/introduction.gif b/src/assets/tutorial/introduction.gif new file mode 100644 index 00000000..6686b7df Binary files /dev/null and b/src/assets/tutorial/introduction.gif differ diff --git a/src/components/Graph/Graph.tsx b/src/components/Graph/Graph.tsx index b0a547a9..b74c735b 100644 --- a/src/components/Graph/Graph.tsx +++ b/src/components/Graph/Graph.tsx @@ -56,7 +56,6 @@ import TransactionTooltip, { TransactionTooltipProps, } from "./TransactionTooltip"; - /* Pan on drag settings */ const panOnDrag = [1, 2]; @@ -82,6 +81,7 @@ interface GraphContextProps { doLayout: () => void; setNodeHighlight: (address: string, highlight: boolean) => void; getNodeCount: () => number; + setShowTutorial: (show: boolean) => void; focusedAddressData: AddressAnalysis | null; } @@ -150,7 +150,6 @@ const GraphProvider: FC = ({ /> - ); }; @@ -546,6 +545,9 @@ const GraphProvided: FC = ({ return nodes.length; } + // Tutorial + const [showTutorial, setShowTutorial] = useState(false); + // Set up the context const graphContext: GraphContextProps = { addAddressPaths, @@ -560,6 +562,7 @@ const GraphProvided: FC = ({ copyLink, setNodeHighlight, getNodeCount, + setShowTutorial, focusedAddressData, }; @@ -604,7 +607,11 @@ const GraphProvided: FC = ({ aria-hidden="true" src="https://tailwindui.com/img/beams-home@95.jpg" /> - + {} + diff --git a/src/components/Graph/Hotbar/Hotbar.tsx b/src/components/Graph/Hotbar/Hotbar.tsx index 31bdf80b..915b279d 100644 --- a/src/components/Graph/Hotbar/Hotbar.tsx +++ b/src/components/Graph/Hotbar/Hotbar.tsx @@ -1,6 +1,11 @@ -import { RectangleGroupIcon, ShareIcon } from "@heroicons/react/24/solid"; +import { + RectangleGroupIcon, + ShareIcon, + MagnifyingGlassPlusIcon, + QuestionMarkCircleIcon, +} from "@heroicons/react/24/outline"; import { FC, useContext, useMemo, useState } from "react"; - +import clsx from "clsx"; import { GraphContext } from "../Graph"; import ShareDialog from "../LandingPage/ShareDialog"; @@ -8,10 +13,48 @@ interface HotbarButton { onClick?: () => void; Icon: any; name: string; + className?: string; +} + +const HotbarButton: FC = ({ Icon, name, onClick, className }) => { + return ( + + ); +}; + +interface HotbarButtonGroupProps { + children: any; + className?: string; } +const HotbarButtonGroup: FC = ({ + children, + className, +}) => { + return ( +
+ {children} +
+ ); +}; + const Hotbar: FC = () => { - const { doLayout, copyLink, getSharingLink } = useContext(GraphContext); + const { doLayout, copyLink, getSharingLink, setShowTutorial } = + useContext(GraphContext); const [isShareDialogOpen, setIsShareDialogOpen] = useState(false); @@ -19,44 +62,48 @@ const Hotbar: FC = () => { const onShareUrl = () => { copyLink(shareUrl); - } + }; const openShareDialog = () => { setIsShareDialogOpen(true); - } - - const Buttons: HotbarButton[] = [ - { - Icon: RectangleGroupIcon, - name: "Organize Layout", - onClick: doLayout, - }, - { - Icon: ShareIcon, - name: "Share", - onClick: openShareDialog - } - ] + }; return ( <> -
- {Buttons.map((button) => { - return ( - - ); - })} +
+ + {}} + /> + + + + + { + setShowTutorial(true); + }} + /> +
- + ); }; diff --git a/src/components/common/BigButton.tsx b/src/components/common/BigButton.tsx index 5a2d00b8..5be838d8 100644 --- a/src/components/common/BigButton.tsx +++ b/src/components/common/BigButton.tsx @@ -22,14 +22,11 @@ const BigButton: FC = ({ onClick, text, Icon, className }) => { type="button" onClick={onClick} className={clsx( - "inline-flex items-center gap-x-1.5 rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2", + "flex flex-row items-center justify-center gap-x-1.5 rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2", className, )} > -