From a416ee43f7c2b1944ad68e6034a562d276a12e24 Mon Sep 17 00:00:00 2001 From: typescreep Date: Fri, 31 Oct 2025 03:38:23 +0300 Subject: [PATCH] layout improvements --- .../Events/molecules/EventRow/EventRow.tsx | 28 ++++++++++++++----- .../Events/molecules/EventRow/styled.ts | 17 +++++------ 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/components/organisms/Events/molecules/EventRow/EventRow.tsx b/src/components/organisms/Events/molecules/EventRow/EventRow.tsx index e466132..103aff3 100644 --- a/src/components/organisms/Events/molecules/EventRow/EventRow.tsx +++ b/src/components/organisms/Events/molecules/EventRow/EventRow.tsx @@ -1,5 +1,5 @@ import React, { FC } from 'react' -import { theme as antdtheme, Flex } from 'antd' +import { theme as antdtheme, Flex, Typography } from 'antd' import { EarthIcon, getUppercase, hslFromString, Spacer } from '@prorobotech/openapi-k8s-toolkit' import { useSelector } from 'react-redux' import { RootState } from 'store/store' @@ -16,11 +16,14 @@ export const EventRow: FC = ({ e }) => { const theme = useSelector((state: RootState) => state.openapiTheme.theme) const abbr = e.regarding?.kind ? getUppercase(e.regarding.kind) : undefined - const bgColor = e.regarding?.kind && abbr ? hslFromString(abbr, theme) : 'initial' - const bgColorNamespace = hslFromString('NS', theme) + const bgColor = e.regarding?.kind && abbr ? hslFromString(e.regarding?.kind, theme) : 'initial' + const bgColorNamespace = hslFromString('Namespace', theme) return ( - + @@ -44,10 +47,21 @@ export const EventRow: FC = ({ e }) => { )} - + +
+ {e.deprecatedSource?.component && ( + + + Generated by + {e.deprecatedSource?.component} + +
+ +
+
+ )} +
{e.reason || e.action || 'Event'} - - {e.type || 'Normal'}
{eventText(e) &&
{eventText(e)}
} diff --git a/src/components/organisms/Events/molecules/EventRow/styled.ts b/src/components/organisms/Events/molecules/EventRow/styled.ts index 4eac075..2d14afe 100644 --- a/src/components/organisms/Events/molecules/EventRow/styled.ts +++ b/src/components/organisms/Events/molecules/EventRow/styled.ts @@ -1,13 +1,14 @@ import styled from 'styled-components' type TCardProps = { - $colorText: string + $mainColor: string + $bigBorder?: boolean } const Card = styled.div` border-radius: 6px; padding: 16px 8px; - border: 1px solid ${({ $colorText }) => $colorText}; + border: ${({ $bigBorder }) => ($bigBorder ? 2 : 1)}px solid ${({ $mainColor }) => $mainColor}; gap: 12px; margin-bottom: 16px; position: relative; @@ -16,8 +17,8 @@ const Card = styled.div` position: absolute; content: ''; width: 36px; - height: 1px; - background: ${({ $colorText }) => $colorText}; + height: ${({ $bigBorder }) => ($bigBorder ? 2 : 1)}px; + background: ${({ $mainColor }) => $mainColor}; left: -37px; top: 50%; /* halfway down parent */ transform: translateY(-50%); /* center vertically */ @@ -26,11 +27,11 @@ const Card = styled.div` &:after { position: absolute; content: ''; - width: 6px; - height: 6px; + width: ${({ $bigBorder }) => ($bigBorder ? 7 : 6)}px; + height: ${({ $bigBorder }) => ($bigBorder ? 7 : 6)}px; border-radius: 50%; - background: ${({ $colorText }) => $colorText}; - left: -39px; + background: ${({ $mainColor }) => $mainColor}; + left: ${({ $bigBorder }) => ($bigBorder ? -41 : -39)}px; top: 50%; transform: translateY(-50%); }