From cad36e1b3ceacc6d879f3a7020624d39ed2fda71 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Tue, 4 Aug 2020 22:25:50 +0800 Subject: [PATCH] Switch explorer to dark mode by default (#11360) --- explorer/src/components/ClusterModal.tsx | 6 +-- .../src/components/ClusterStatusButton.tsx | 2 +- explorer/src/components/MessageBanner.tsx | 2 +- explorer/src/components/Navbar.tsx | 2 +- explorer/src/components/SearchBar.tsx | 4 +- explorer/src/components/TopAccountsCard.tsx | 2 +- .../src/components/TransactionDetails.tsx | 8 ++-- .../instruction/InstructionCard.tsx | 2 +- .../src/components/instruction/RawDetails.tsx | 4 +- .../img/logos-solana/dark-explorer-logo.svg | 12 ++++++ explorer/src/index.tsx | 2 +- explorer/src/scss/_solana-dark-overrides.scss | 37 +++++++++++++++++++ explorer/src/scss/_solana-variables-dark.scss | 31 ++++++++++++++++ explorer/src/scss/_solana-variables.scss | 30 +++++++-------- explorer/src/scss/_solana.scss | 8 ++++ explorer/src/scss/theme-dark.scss | 9 +++++ 16 files changed, 128 insertions(+), 33 deletions(-) create mode 100644 explorer/src/img/logos-solana/dark-explorer-logo.svg create mode 100644 explorer/src/scss/_solana-dark-overrides.scss create mode 100644 explorer/src/scss/_solana-variables-dark.scss diff --git a/explorer/src/components/ClusterModal.tsx b/explorer/src/components/ClusterModal.tsx index 58fb77f247..74eef136c5 100644 --- a/explorer/src/components/ClusterModal.tsx +++ b/explorer/src/components/ClusterModal.tsx @@ -92,7 +92,7 @@ function CustomClusterInput({ activeSuffix, active }: InputProps) { />
- Custom: + Custom:
@@ -105,7 +105,7 @@ function ClusterToggle() { let activeSuffix = ""; switch (status) { case ClusterStatus.Connected: - activeSuffix = "success"; + activeSuffix = "primary"; break; case ClusterStatus.Connecting: activeSuffix = "warning"; @@ -132,7 +132,7 @@ function ClusterToggle() { const btnClass = active ? `border-${activeSuffix} text-${activeSuffix}` - : "btn-white text-dark"; + : "btn-white"; const clusterLocation = (location: Location) => { const params = new URLSearchParams(location.search); diff --git a/explorer/src/components/ClusterStatusButton.tsx b/explorer/src/components/ClusterStatusButton.tsx index 9d460072ce..216cf315da 100644 --- a/explorer/src/components/ClusterStatusButton.tsx +++ b/explorer/src/components/ClusterStatusButton.tsx @@ -41,7 +41,7 @@ function Button() { switch (status) { case ClusterStatus.Connected: return ( - + {statusName} diff --git a/explorer/src/components/MessageBanner.tsx b/explorer/src/components/MessageBanner.tsx index 4580478d39..b27db59757 100644 --- a/explorer/src/components/MessageBanner.tsx +++ b/explorer/src/components/MessageBanner.tsx @@ -63,7 +63,7 @@ export default function Banner() { } return ( -
+

diff --git a/explorer/src/components/Navbar.tsx b/explorer/src/components/Navbar.tsx index 116a9e7658..64eecb1ad2 100644 --- a/explorer/src/components/Navbar.tsx +++ b/explorer/src/components/Navbar.tsx @@ -1,5 +1,5 @@ import React from "react"; -import Logo from "img/logos-solana/light-explorer-logo.svg"; +import Logo from "img/logos-solana/dark-explorer-logo.svg"; import { clusterPath } from "utils/url"; import { Link, NavLink } from "react-router-dom"; import { ClusterStatusButton } from "components/ClusterStatusButton"; diff --git a/explorer/src/components/SearchBar.tsx b/explorer/src/components/SearchBar.tsx index 7c0720f213..89b7190fa3 100644 --- a/explorer/src/components/SearchBar.tsx +++ b/explorer/src/components/SearchBar.tsx @@ -73,9 +73,7 @@ export function SearchBar() { onChange={onChange} onInputChange={onInputChange} components={{ DropdownIndicator }} - styles={{ - control: (styles) => ({ ...styles, borderRadius: "7px" }), - }} + classNamePrefix="search-bar" />

diff --git a/explorer/src/components/TopAccountsCard.tsx b/explorer/src/components/TopAccountsCard.tsx index 1b69349407..a4093bb3ef 100644 --- a/explorer/src/components/TopAccountsCard.tsx +++ b/explorer/src/components/TopAccountsCard.tsx @@ -114,7 +114,7 @@ const renderAccountRow = ( return ( - {index + 1} + {index + 1}
diff --git a/explorer/src/components/TransactionDetails.tsx b/explorer/src/components/TransactionDetails.tsx index c667bf4e1c..4a8c50f43e 100644 --- a/explorer/src/components/TransactionDetails.tsx +++ b/explorer/src/components/TransactionDetails.tsx @@ -243,16 +243,16 @@ function AccountsCard({ signature }: Props) { {lamportsToSolString(post)} {index === 0 && ( - Fee Payer + Fee Payer )} {!message.isAccountWritable(index) && ( - Readonly + Readonly )} {index < message.header.numRequiredSignatures && ( - Signer + Signer )} {message.instructions.find((ix) => ix.programIdIndex === index) && ( - Program + Program )} diff --git a/explorer/src/components/instruction/InstructionCard.tsx b/explorer/src/components/instruction/InstructionCard.tsx index 4fe4b552ce..523b5743fe 100644 --- a/explorer/src/components/instruction/InstructionCard.tsx +++ b/explorer/src/components/instruction/InstructionCard.tsx @@ -34,7 +34,7 @@ export function InstructionCard({