diff --git a/client/src/components/ui/InfoTip.tsx b/client/src/components/ui/InfoTip.tsx index 3f382c63..85417938 100644 --- a/client/src/components/ui/InfoTip.tsx +++ b/client/src/components/ui/InfoTip.tsx @@ -2,16 +2,18 @@ import { autoPlacement, useFloating, getOverflowAncestors, + shift, } from "@floating-ui/react-dom"; import React, {ReactNode, useEffect, useLayoutEffect, useState} from "react"; import {FaInfoCircle} from "react-icons/fa"; import Button from "@thorium/ui/Button"; import useOnClickOutside from "client/src/hooks/useClickOutside"; +import {Portal} from "@headlessui/react"; const InfoTip = ({children}: {children: ReactNode}) => { const {x, y, reference, floating, strategy, refs, update} = useFloating({ placement: "left", - middleware: [autoPlacement()], + middleware: [autoPlacement(), shift()], }); const [visible, setVisible] = useState(false); // Update on scroll and resize for all relevant nodes @@ -57,20 +59,21 @@ const InfoTip = ({children}: {children: ReactNode}) => { > - -
- {children} -
+ +
+ {children} +
+
); }; diff --git a/client/src/components/ui/PanZoom/index.tsx b/client/src/components/ui/PanZoom/index.tsx index bc0cd81d..81ddeb10 100644 --- a/client/src/components/ui/PanZoom/index.tsx +++ b/client/src/components/ui/PanZoom/index.tsx @@ -1028,8 +1028,6 @@ class PanZoom extends React.Component {
-
+
-
+
-
+
d.name === shipId); const [, render] = useReducer(() => ({}), {}); return ( -
+

Logo{" "} @@ -37,7 +37,7 @@ export function Assets() { Ship Logo )} @@ -49,7 +49,9 @@ export function Assets() { Models should be in .glb format. Top and side views are automatically generated from the model. {/* TODO November 1 2021 - Write a page about how to create 3D models */} - Read about how to create compatible models. + + Read about how to create compatible models. +

)} @@ -122,7 +124,7 @@ export function Assets() { Ship Side View )} @@ -134,7 +136,7 @@ export function Assets() { Ship Top View )} diff --git a/client/src/pages/Config/Ships/SettingsList.tsx b/client/src/pages/Config/Ships/SettingsList.tsx index aa4f3bf8..36b58cd0 100644 --- a/client/src/pages/Config/Ships/SettingsList.tsx +++ b/client/src/pages/Config/Ships/SettingsList.tsx @@ -1,4 +1,4 @@ -import {Link, useParams} from "react-router-dom"; +import {Link, useMatch} from "react-router-dom"; const links = { basic: "Basic", @@ -10,10 +10,10 @@ const links = { }; export function SettingsList() { - const params = useParams(); - const setting = params["*"]?.split("/")[1]; + const setting = useMatch("config/:pluginId/ships/:shipId/:setting")?.params + .setting; return ( -
+
{Object.entries(links).map(([key, value]) => ( { if (!pathname.endsWith(shipId)) { return ( <> -
+
)}
-
+

Assigned Systems

-
+
); }