();
function handleViewProfile() {
- handleMenuClose();
if (user) {
dialogRef.current?.showModal();
setDialog(UserInfo(user));
@@ -105,7 +125,7 @@ export default function Avatar() {
{
if (contextMenu.open && event.target === avatarRef.current) {
handleMenuClose();
@@ -121,25 +141,13 @@ export default function Avatar() {
className="context-menu"
ref={contextMenuRef}
style={{
- zIndex: 3,
- position: "absolute",
top: contextMenu.mouseY,
left: contextMenu.mouseX,
- background: "white",
- border: "1px solid #ddd",
- padding: 0,
- margin: 0,
- listStyle: "none",
}}
>
{contextMenuItems.map((item, index) => (
{
item.onClick();
handleMenuClose();
diff --git a/src/NetworkTheme.tsx b/src/NetworkTheme.ts
similarity index 96%
rename from src/NetworkTheme.tsx
rename to src/NetworkTheme.ts
index 7fc342b..41520a9 100644
--- a/src/NetworkTheme.tsx
+++ b/src/NetworkTheme.ts
@@ -1,6 +1,6 @@
import { Theme } from "reagraph";
-export const customTheme: Theme = {
+export var customTheme: Theme = {
canvas: {
background: "aliceblue",
},
diff --git a/src/RaceChart.tsx b/src/RaceChart.tsx
index 227060f..4a81521 100644
--- a/src/RaceChart.tsx
+++ b/src/RaceChart.tsx
@@ -14,12 +14,10 @@ const determineNiceWidth = (width: number) => {
};
const RaceChart: FC = ({ players, std }) => {
- // State to store window's width and height
const [width, setWidth] = useState(determineNiceWidth(window.innerWidth));
//const [height, setHeight] = useState(window.innerHeight);
const height = players.length * 40;
- // Update state on resize
useEffect(() => {
const handleResize = () => {
setWidth(determineNiceWidth(window.innerWidth));
@@ -41,11 +39,14 @@ const RaceChart: FC = ({ players, std }) => {
{players.map((player, index) => (
))}
@@ -53,7 +54,7 @@ const RaceChart: FC = ({ players, std }) => {
= ({ players, std }) => {
p.name.length))) *
fontSize *
0.66