From 98b450fcc754a38d6814afe69ea04b83df291f73 Mon Sep 17 00:00:00 2001 From: calli Date: Wed, 23 Apr 2025 18:52:05 +0300 Subject: [PATCH] rearrange character layout and align tables to character image --- .../components/Characters/CharacterRow.tsx | 56 ++++++++++++++----- .../PlanetaryInteractionRow.tsx | 4 +- 2 files changed, 43 insertions(+), 17 deletions(-) diff --git a/src/app/components/Characters/CharacterRow.tsx b/src/app/components/Characters/CharacterRow.tsx index 2606170..81b28a7 100644 --- a/src/app/components/Characters/CharacterRow.tsx +++ b/src/app/components/Characters/CharacterRow.tsx @@ -7,16 +7,18 @@ import { styled, useTheme } from "@mui/material/styles"; import React from "react"; import { CharacterDialog } from "./CharacterDialog"; import { AccessToken } from "@/types"; -import { Box, Button, Tooltip } from "@mui/material"; +import { Box, Tooltip, IconButton, Typography } from "@mui/material"; +import SettingsIcon from "@mui/icons-material/Settings"; import { EVE_IMAGE_URL } from "@/const"; import { CharacterContext } from "@/app/context/Context"; const StackItem = styled(Stack)(({ theme }) => ({ ...theme.typography.body2, padding: theme.custom.compactMode ? theme.spacing(1) : theme.spacing(2), + display: "flex", textAlign: "left", - justifyContent: "center", - alignItems: "center", + justifyContent: "flex-start", + alignItems: "flex-start", })); export const CharacterRow = ({ character }: { character: AccessToken }) => { @@ -29,8 +31,6 @@ export const CharacterRow = ({ character }: { character: AccessToken }) => { return ( { updateCharacter={updateCharacter} closeDialog={() => setSelectedCharacter(undefined)} /> + + {character.character.name} + setSelectedCharacter(character)} + position="relative" + sx={{ cursor: "pointer" }} > + { + e.stopPropagation(); + setSelectedCharacter(character); + }} + sx={{ + p: 0, + position: "absolute", + top: 4, + left: 4, + backgroundColor: "rgba(0, 0, 0, 0.5)", + "&:hover": { + backgroundColor: "rgba(0, 0, 0, 0.7)", + }, + }} + > + + { height={theme.custom.cardImageSize} style={{ marginBottom: "0.2rem", borderRadius: 8 }} /> - diff --git a/src/app/components/PlanetaryInteraction/PlanetaryInteractionRow.tsx b/src/app/components/PlanetaryInteraction/PlanetaryInteractionRow.tsx index 1947ab7..4e0e089 100644 --- a/src/app/components/PlanetaryInteraction/PlanetaryInteractionRow.tsx +++ b/src/app/components/PlanetaryInteraction/PlanetaryInteractionRow.tsx @@ -159,8 +159,8 @@ export const PlanetaryInteractionRow = ({ const theme = useTheme(); return theme.custom.compactMode ? ( - +
) : ( - +
); };