From 20847a82fa8bf3648209f928746bfbd3dd252a15 Mon Sep 17 00:00:00 2001 From: kaf-lamed-beyt Date: Sat, 1 Mar 2025 14:39:30 +0100 Subject: [PATCH 1/5] chore: add css custom properties for explore page component --- src/components/ExplorePage.tsx | 5 +++-- src/components/about/AboutIpld.tsx | 3 ++- src/components/box/Box.tsx | 2 +- src/index.css | 16 ++++++++++++++++ 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 src/index.css diff --git a/src/components/ExplorePage.tsx b/src/components/ExplorePage.tsx index 9985f873..fe24afa7 100644 --- a/src/components/ExplorePage.tsx +++ b/src/components/ExplorePage.tsx @@ -13,6 +13,7 @@ import IpldGraph from './graph/IpldGraphCytoscape.js' import GraphCrumb from './graph-crumb/GraphCrumb.js' import ComponentLoader from './loader/component-loader.js' import { ObjectInfo } from './object-info/ObjectInfo.js' +import '../index.css' export const ExplorePage = ({ runTour = false, @@ -70,7 +71,7 @@ export const ExplorePage = ({ ? ( ) diff --git a/src/components/about/AboutIpld.tsx b/src/components/about/AboutIpld.tsx index 0207695f..b5844e6a 100644 --- a/src/components/about/AboutIpld.tsx +++ b/src/components/about/AboutIpld.tsx @@ -2,12 +2,13 @@ import React from 'react' import { Trans, useTranslation } from 'react-i18next' import Box from '../box/Box.js' import ipldLogoSrc from './ipld.svg' +import '../../index.css' export const AboutIpld: React.FC = () => { const { t } = useTranslation('explore') return ( - +
IPLD diff --git a/src/components/box/Box.tsx b/src/components/box/Box.tsx index b71e2ba9..bd131361 100644 --- a/src/components/box/Box.tsx +++ b/src/components/box/Box.tsx @@ -12,7 +12,7 @@ export const Box: React.FC> = ({ children }) => { return ( -
+
{children} diff --git a/src/index.css b/src/index.css new file mode 100644 index 00000000..f12ea0d8 --- /dev/null +++ b/src/index.css @@ -0,0 +1,16 @@ +/* dark theme styles for the explore page */ +:root { + --element-bg: #fbfbfb; + --text: #111111; + --border-color: rgba(0, 0, 0, 0.1); +} + +[data-theme="dark"] { + --background: #181a1b; + --text: #e8e6e3; + --element-bg: #1a1c1e; + --navy-dark: #0b3a53; + --navy-text-color: rgb(202, 198, 191); + --snow-muted: rgb(28, 30, 31); + --border-color: rgba(140, 130, 115, 0.5); +} From 9db2f82b5bef85cf0b48f5e6d0cd0a7b1a0ca4a4 Mon Sep 17 00:00:00 2001 From: kaf-lamed-beyt Date: Tue, 18 Mar 2025 13:29:02 +0100 Subject: [PATCH 2/5] update styles --- src/components/cid-info/CidInfo.tsx | 8 ++++---- src/components/graph-crumb/GraphCrumb.tsx | 3 ++- src/components/object-info/ObjectInfo.tsx | 2 +- src/components/object-info/links-table.tsx | 2 +- src/index.css | 18 ++++++++++++++++++ 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/components/cid-info/CidInfo.tsx b/src/components/cid-info/CidInfo.tsx index 0d906736..5a9b96c2 100644 --- a/src/components/cid-info/CidInfo.tsx +++ b/src/components/cid-info/CidInfo.tsx @@ -39,13 +39,13 @@ export const CidInfo: React.FC = ({ cid, className, ...props }) => ? null : (
-
+
{cid.toString()}
{cidInfo.humanReadable}
-
= ({ cid, className, ...props }) => {t('multihash')}
-
+
0x {cidInfo.hashFnCode} {cidInfo.hashLengthCode} @@ -64,7 +64,7 @@ export const CidInfo: React.FC = ({ cid, className, ...props }) => {chunk.join('')}
))} -