-
{children}
+
);
};
diff --git a/apps/insights/src/components/StructuredList/index.module.scss b/apps/insights/src/components/StructuredList/index.module.scss
new file mode 100644
index 0000000000..4a8a1506e6
--- /dev/null
+++ b/apps/insights/src/components/StructuredList/index.module.scss
@@ -0,0 +1,24 @@
+@use "@pythnetwork/component-library/theme";
+.structuredList {
+ display: flex;
+ flex-flow: column nowrap;
+ gap: theme.spacing(4);
+
+ .structuredListItem {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: theme.spacing(2);
+ align-items: center;
+ justify-content: space-between;
+ // font-size: theme.font-size("sm");
+ .structuredListItemLabel {
+ color: theme.color("muted");
+ }
+ .structuredListItemValue {
+ text-align: right;
+ place-items: end;
+ font-weight: theme.font-weight("medium");
+ color: theme.color("heading");
+ }
+ }
+}
diff --git a/apps/insights/src/components/StructuredList/index.tsx b/apps/insights/src/components/StructuredList/index.tsx
new file mode 100644
index 0000000000..5e39b4e04c
--- /dev/null
+++ b/apps/insights/src/components/StructuredList/index.tsx
@@ -0,0 +1,43 @@
+import clsx from "clsx";
+import type { ComponentProps } from "react";
+
+import styles from "./index.module.scss";
+
+type StructuredListProps = {
+ items: StructureListItemProps[];
+} & ComponentProps<"div">;
+
+type StructureListItemProps = {
+ label: React.ReactNode;
+ value: React.ReactNode;
+} & ComponentProps<"div">;
+
+
+export const StructuredList = ({
+ items,
+ ...props
+}: StructuredListProps) => {
+ return (
+ items.length > 0 && (
+
+ {items.map((item, index) => (
+
+ ))}
+
+ )
+ );
+};
+
+
+export const StructuredListItem = ({
+ label,
+ value,
+ ...props
+}: StructureListItemProps) => {
+ return (
+
+ );
+}
\ No newline at end of file
diff --git a/packages/component-library/src/Card/index.module.scss b/packages/component-library/src/Card/index.module.scss
index 097d0940d7..7e1dc9e3eb 100644
--- a/packages/component-library/src/Card/index.module.scss
+++ b/packages/component-library/src/Card/index.module.scss
@@ -16,7 +16,6 @@
position: relative;
padding: theme.spacing(1);
isolation: isolate;
- overflow: hidden;
@at-root button#{&} {
cursor: pointer;
@@ -35,15 +34,23 @@
.header {
display: flex;
- padding: theme.spacing(3) theme.spacing(4);
position: relative;
+ flex-direction: column;
+ padding: theme.spacing(2);
+ gap: theme.spacing(4);
+
+ @include theme.breakpoint("lg") {
+ flex-direction: row;
+ padding: theme.spacing(3) theme.spacing(4);
+ }
.title {
color: theme.color("heading");
- display: inline-flex;
+ display: flex;
flex-flow: row nowrap;
gap: theme.spacing(3);
align-items: center;
+ flex-grow: 1;
@include theme.text("lg", "medium");
@@ -55,14 +62,10 @@
}
.toolbar {
- position: absolute;
- right: theme.spacing(3);
- top: 0;
- bottom: theme.spacing(0);
+ &:empty {
+ display: none;
+ }
display: flex;
- flex-flow: row nowrap;
- gap: theme.spacing(2);
- align-items: center;
}
}
diff --git a/packages/component-library/src/Paginator/index.module.scss b/packages/component-library/src/Paginator/index.module.scss
index 5679663437..5e96b4414d 100644
--- a/packages/component-library/src/Paginator/index.module.scss
+++ b/packages/component-library/src/Paginator/index.module.scss
@@ -6,10 +6,13 @@
justify-content: space-between;
.pageSizeSelect {
- display: flex;
+ display: none;
flex-flow: row nowrap;
align-items: center;
gap: theme.spacing(1);
+ @include theme.breakpoint("lg") {
+ display: flex;
+ }
.loadingIndicator {
width: theme.spacing(4);
diff --git a/packages/component-library/src/Table/index.module.scss b/packages/component-library/src/Table/index.module.scss
index 6e96da9c1f..bcbf293acc 100644
--- a/packages/component-library/src/Table/index.module.scss
+++ b/packages/component-library/src/Table/index.module.scss
@@ -1,8 +1,12 @@
@use "../theme";
.tableContainer {
+ display: none;
background-color: theme.color("background", "primary");
position: relative;
+ @include theme.breakpoint("lg") {
+ display: block;
+ }
.loaderWrapper {
position: absolute;
@@ -164,21 +168,11 @@
}
&[data-hovered] .cell {
- background-color: theme.color(
- "button",
- "outline",
- "background",
- "hover"
- );
+ background-color: theme.color("button", "outline", "background", "hover");
}
&[data-pressed] .cell {
- background-color: theme.color(
- "button",
- "outline",
- "background",
- "active"
- );
+ background-color: theme.color("button", "outline", "background", "active");
}
}
}
diff --git a/packages/component-library/src/theme.scss b/packages/component-library/src/theme.scss
index 1e4f377cc5..1ba5a2e328 100644
--- a/packages/component-library/src/theme.scss
+++ b/packages/component-library/src/theme.scss
@@ -461,7 +461,7 @@ $color: (
"normal": light-dark(pallette-color("steel", 800), pallette-color("steel", 50))
),
"highlight": light-dark(pallette-color("violet", 600), pallette-color("violet", 500)),
- "muted": light-dark(pallette-color("stone", 700), pallette-color("steel", 300)),
+ "muted": light-dark(pallette-color("stone", 500), pallette-color("steel", 400)),
"border": light-dark(pallette-color("stone", 300), pallette-color("steel", 600)),
"selection": (
"background": light-dark(pallette-color("violet", 600), pallette-color("violet", 400)),
From e5f22efd3de93b8220cf5b6541c0c0439243d985 Mon Sep 17 00:00:00 2001
From: PartyParrotGreg <2233348+partyparrotgreg@users.noreply.github.com>
Date: Fri, 24 Jan 2025 17:41:57 +0000
Subject: [PATCH 09/13] chore(insights): clean up and standardize component
styles across MobileMenu, Navigation, and PriceFeeds for improved consistency
and layout
---
.../src/components/MobileMenu/mobile-menu.tsx | 5 +-
.../mobile-navigation.module.scss | 15 +-
.../MobileNavigation/mobile-navigation.tsx | 16 +-
.../src/components/PriceFeedTag/index.tsx | 14 +-
.../components/PriceFeeds/index.module.scss | 3 +
.../src/components/PriceFeeds/index.tsx | 4 +-
.../PriceFeeds/price-feed-items.module.scss | 26 +-
.../PriceFeeds/price-feed-items.tsx | 52 +--
.../PriceFeeds/price-feeds-card.tsx | 125 ++++---
.../src/components/Root/footer.module.scss | 2 +
.../src/components/Root/header.module.scss | 3 +
.../src/components/Stats/index.module.scss | 3 +
.../StructuredList/index.module.scss | 41 +--
.../src/components/StructuredList/index.tsx | 54 ++--
.../src/Card/index.module.scss | 13 +-
packages/component-library/src/Card/index.tsx | 3 +
.../src/Drawer/index.module.scss | 1 +
.../src/MainNavTabs/index.module.scss | 17 +-
.../src/Paginator/index.module.scss | 7 +-
.../src/Table/index.module.scss | 17 +-
packages/component-library/src/theme.scss | 304 +++++++++++-------
21 files changed, 434 insertions(+), 291 deletions(-)
diff --git a/apps/insights/src/components/MobileMenu/mobile-menu.tsx b/apps/insights/src/components/MobileMenu/mobile-menu.tsx
index d36c85a122..4e5932b425 100644
--- a/apps/insights/src/components/MobileMenu/mobile-menu.tsx
+++ b/apps/insights/src/components/MobileMenu/mobile-menu.tsx
@@ -6,10 +6,7 @@ import { useState, type ComponentProps } from "react";
import styles from "./mobile-menu.module.scss";
-export const MobileMenu = ({
- className,
- ...props
-}: ComponentProps<"div">) => {
+export const MobileMenu = ({ className, ...props }: ComponentProps<"div">) => {
const [isOpen, setIsOpen] = useState(false);
const toggleMenu = () => {
diff --git a/apps/insights/src/components/MobileNavigation/mobile-navigation.module.scss b/apps/insights/src/components/MobileNavigation/mobile-navigation.module.scss
index 6710b50b8c..00e1c7ceec 100644
--- a/apps/insights/src/components/MobileNavigation/mobile-navigation.module.scss
+++ b/apps/insights/src/components/MobileNavigation/mobile-navigation.module.scss
@@ -1,11 +1,12 @@
@use "@pythnetwork/component-library/theme";
.mobileNavigation {
- display: block;
- padding: theme.spacing(2);
- background: theme.color("background", "primary");
- border-top: 1px solid theme.color("background", "secondary");
- @include theme.breakpoint("md") {
- display: none;
- }
+ display: block;
+ padding: theme.spacing(2);
+ background: theme.color("background", "primary");
+ border-top: 1px solid theme.color("background", "secondary");
+
+ @include theme.breakpoint("md") {
+ display: none;
+ }
}
diff --git a/apps/insights/src/components/MobileNavigation/mobile-navigation.tsx b/apps/insights/src/components/MobileNavigation/mobile-navigation.tsx
index ebaa4915cb..0ee7773a4b 100644
--- a/apps/insights/src/components/MobileNavigation/mobile-navigation.tsx
+++ b/apps/insights/src/components/MobileNavigation/mobile-navigation.tsx
@@ -1,9 +1,9 @@
-import styles from "./mobile-navigation.module.scss"
-import { MainNavTabs } from "../Root/tabs"
+import styles from "./mobile-navigation.module.scss";
+import { MainNavTabs } from "../Root/tabs";
export const MobileNavigation = () => {
- return (
-
-
-
- )
-}
\ No newline at end of file
+ return (
+
+
+
+ );
+};
diff --git a/apps/insights/src/components/PriceFeedTag/index.tsx b/apps/insights/src/components/PriceFeedTag/index.tsx
index c8db9096e9..0f47f8c701 100644
--- a/apps/insights/src/components/PriceFeedTag/index.tsx
+++ b/apps/insights/src/components/PriceFeedTag/index.tsx
@@ -7,15 +7,15 @@ import styles from "./index.module.scss";
type OwnProps =
| { isLoading: true; compact?: boolean | undefined }
| ({
- isLoading?: false;
- symbol: string;
- icon: ReactNode;
- } & (
+ isLoading?: false;
+ symbol: string;
+ icon: ReactNode;
+ } & (
| { compact: true }
| {
- compact?: false;
- description: string;
- }
+ compact?: false;
+ description: string;
+ }
));
type Props = Omit
, keyof OwnProps> & OwnProps;
diff --git a/apps/insights/src/components/PriceFeeds/index.module.scss b/apps/insights/src/components/PriceFeeds/index.module.scss
index adba87040d..83d0b32be3 100644
--- a/apps/insights/src/components/PriceFeeds/index.module.scss
+++ b/apps/insights/src/components/PriceFeeds/index.module.scss
@@ -5,9 +5,11 @@
.header {
@include theme.h3;
+
color: theme.color("heading");
font-weight: theme.font-weight("semibold");
}
+
.toolbarContainer {
display: flex;
flex-flow: row nowrap;
@@ -32,6 +34,7 @@
@include theme.breakpoint("md") {
flex-flow: row nowrap;
+
& > * {
flex: 1 1 0px;
width: 0;
diff --git a/apps/insights/src/components/PriceFeeds/index.tsx b/apps/insights/src/components/PriceFeeds/index.tsx
index 290900a3a8..fd9a797ea0 100644
--- a/apps/insights/src/components/PriceFeeds/index.tsx
+++ b/apps/insights/src/components/PriceFeeds/index.tsx
@@ -96,9 +96,9 @@ export const PriceFeeds = async () => {
title="Coming Soon"
icon={}
feeds={featuredComingSoon}
- toolbar={
+ action={
-