From f596dc14a0e0d980dd28b95fdd6d763c06c634b2 Mon Sep 17 00:00:00 2001 From: Sarthak Sethi Date: Sun, 6 Jul 2025 21:56:28 -0700 Subject: [PATCH] proper dark mode --- frontend/src/components/BentoCard.jsx | 6 +++--- frontend/src/components/BentoTile.jsx | 10 +++++----- frontend/src/components/ChartComponent.jsx | 4 ++-- frontend/src/components/ChartModal.jsx | 2 +- frontend/src/components/ExchangeRateCard.jsx | 6 +++--- frontend/src/components/ExpandableModal.jsx | 16 ++++++++-------- frontend/src/components/NewsCard.jsx | 2 +- frontend/src/components/NewsFeed.jsx | 4 ++-- frontend/src/components/RefreshButton.jsx | 2 +- frontend/src/pages/NewsPage.jsx | 4 ++-- frontend/src/pages/Settings.jsx | 20 ++++++++++---------- 11 files changed, 38 insertions(+), 38 deletions(-) diff --git a/frontend/src/components/BentoCard.jsx b/frontend/src/components/BentoCard.jsx index bc51945..b01915b 100644 --- a/frontend/src/components/BentoCard.jsx +++ b/frontend/src/components/BentoCard.jsx @@ -47,9 +47,9 @@ const BentoCard = ({ // Get change color const getChangeColor = () => { if (typeof change === "number") { - return change > 0 ? "text-green-600" : change < 0 ? "text-red-600" : "text-gray-600"; + return change > 0 ? "text-green-600" : change < 0 ? "text-red-600" : "text-gray-600 dark:text-gray-400"; } - return "text-gray-600"; + return "text-gray-600 dark:text-gray-400"; }; // Get change icon @@ -128,7 +128,7 @@ const BentoCard = ({

{title}

-
+
{new Date().toLocaleTimeString()}
diff --git a/frontend/src/components/BentoTile.jsx b/frontend/src/components/BentoTile.jsx index 0fd9fdc..3edf9e7 100644 --- a/frontend/src/components/BentoTile.jsx +++ b/frontend/src/components/BentoTile.jsx @@ -49,9 +49,9 @@ const BentoTile = ({ // Determine color based on price movement const getChangeColor = () => { if (typeof change === "number") { - return change > 0 ? "text-green-600" : change < 0 ? "text-red-600" : "text-gray-600"; + return change > 0 ? "text-green-600" : change < 0 ? "text-red-600" : "text-gray-600 dark:text-gray-400"; } - return "text-gray-600"; + return "text-gray-600 dark:text-gray-400"; }; // Get change icon @@ -98,7 +98,7 @@ const BentoTile = ({

{title}

-

{symbol}

+

{symbol}

-
+
Market Cap: $1.2T
-
+
Volume: 24.5M
diff --git a/frontend/src/components/ChartComponent.jsx b/frontend/src/components/ChartComponent.jsx index 9ea6b8d..0522152 100644 --- a/frontend/src/components/ChartComponent.jsx +++ b/frontend/src/components/ChartComponent.jsx @@ -107,7 +107,7 @@ const ChartComponent = ({ symbol = "BTC", initialPeriod = "1h" }) => {

{symbol} Price History

-

+

{period === "1h" ? "Last hour" : period === "24h" ? "Last 24 hours" : "Last 7 days"}

@@ -127,7 +127,7 @@ const ChartComponent = ({ symbol = "BTC", initialPeriod = "1h" }) => { {loading ? (
-
Loading chart...
+
Loading chart...
) : ( diff --git a/frontend/src/components/ChartModal.jsx b/frontend/src/components/ChartModal.jsx index 226d2df..5475cf2 100644 --- a/frontend/src/components/ChartModal.jsx +++ b/frontend/src/components/ChartModal.jsx @@ -118,7 +118,7 @@ const ChartModal = ({ isOpen, onClose, symbol, type }) => { }; const getChangeColor = (change) => { - if (change === null || change === undefined) return "text-gray-500"; + if (change === null || change === undefined) return "text-gray-500 dark:text-gray-400"; return change >= 0 ? "text-green-600" : "text-red-600"; }; diff --git a/frontend/src/components/ExchangeRateCard.jsx b/frontend/src/components/ExchangeRateCard.jsx index 3940f04..d0a6cb4 100644 --- a/frontend/src/components/ExchangeRateCard.jsx +++ b/frontend/src/components/ExchangeRateCard.jsx @@ -14,9 +14,9 @@ const ExchangeRateCard = ({ const getChangeColor = (change) => { if (typeof change === "number") { - return change > 0 ? "text-green-600" : change < 0 ? "text-red-600" : "text-gray-600"; + return change > 0 ? "text-green-600" : change < 0 ? "text-red-600" : "text-gray-600 dark:text-gray-400"; } - return "text-gray-600"; + return "text-gray-600 dark:text-gray-400"; }; const getChangeIcon = (change) => { @@ -106,7 +106,7 @@ const ExchangeRateCard = ({ {/* Mini chart placeholder */}
-
+
24h Change +0.15%
diff --git a/frontend/src/components/ExpandableModal.jsx b/frontend/src/components/ExpandableModal.jsx index 8b32e16..99c6277 100644 --- a/frontend/src/components/ExpandableModal.jsx +++ b/frontend/src/components/ExpandableModal.jsx @@ -152,7 +152,7 @@ const ExpandableModal = ({

{data?.title} ({data?.symbol})

-

+

{data?.type === "crypto" ? "Cryptocurrency" : "Stock"} Price Chart

@@ -199,7 +199,7 @@ const ExpandableModal = ({ {isLoadingChart ? (
- Loading chart... + Loading chart...
) : chartError ? (
@@ -248,7 +248,7 @@ const ExpandableModal = ({ ) : (
-

No chart data available

+

No chart data available

)}
@@ -257,25 +257,25 @@ const ExpandableModal = ({ {data && (
-

Current Price

+

Current Price

{data.price ? formatPrice(data.price) : "N/A"}

-

24h Change

-

0 ? 'text-green-600' : data.change < 0 ? 'text-red-600' : 'text-gray-600'}`}> +

24h Change

+

0 ? 'text-green-600' : data.change < 0 ? 'text-red-600' : 'text-gray-600 dark:text-gray-400'}`}> {data.change ? `${data.change > 0 ? '+' : ''}${data.change.toFixed(2)}%` : "N/A"}

-

Market Cap

+

Market Cap

$1.2T

-

Volume

+

Volume

24.5M

diff --git a/frontend/src/components/NewsCard.jsx b/frontend/src/components/NewsCard.jsx index 216b7c6..ec84b02 100644 --- a/frontend/src/components/NewsCard.jsx +++ b/frontend/src/components/NewsCard.jsx @@ -80,7 +80,7 @@ const NewsCard = ({

{title}

-
+
{formatTime(publishedAt)}
diff --git a/frontend/src/components/NewsFeed.jsx b/frontend/src/components/NewsFeed.jsx index 33c0a6a..7070069 100644 --- a/frontend/src/components/NewsFeed.jsx +++ b/frontend/src/components/NewsFeed.jsx @@ -109,7 +109,7 @@ const NewsFeed = () => {

Latest News

-

Top headlines from around the world

+

Top headlines from around the world

{loading ? ( @@ -134,7 +134,7 @@ const NewsFeed = () => {

{item.title}

-
+
{item.source} {formatTime(item.publishedAt)}
diff --git a/frontend/src/components/RefreshButton.jsx b/frontend/src/components/RefreshButton.jsx index a821ace..4a5e448 100644 --- a/frontend/src/components/RefreshButton.jsx +++ b/frontend/src/components/RefreshButton.jsx @@ -221,7 +221,7 @@ const RefreshButton = ({ onRefresh, className = "" }) => {
{/* Auto-refresh toggle */}
- Auto + Auto {

Loading latest news...

-

API URL: {API_BASE_URL}

+

API URL: {API_BASE_URL}

@@ -145,7 +145,7 @@ const NewsPage = () => {

Top stories from the last 24 hours across all categories

-

API URL: {API_BASE_URL}

+

API URL: {API_BASE_URL}

{/* API Rate Limit Notice */} {Object.values(newsData).every(articles => articles.length === 0) && ( diff --git a/frontend/src/pages/Settings.jsx b/frontend/src/pages/Settings.jsx index fce9a7a..876f410 100644 --- a/frontend/src/pages/Settings.jsx +++ b/frontend/src/pages/Settings.jsx @@ -213,7 +213,7 @@ const Settings = () => { className="w-full" aria-label="Stock symbols separated by commas" /> -

+

Enter stock symbols separated by commas (max 8 symbols)

@@ -234,7 +234,7 @@ const Settings = () => { className="w-full" aria-label="Stock refresh interval in seconds" /> -

+

Current: {localSettings.stocks.refreshInterval} seconds

@@ -257,10 +257,10 @@ const Settings = () => { -

Choose between Celsius and Fahrenheit

+

Choose between Celsius and Fahrenheit

- + °C { thumb: "group-data-[selected=true]:bg-white" }} /> - + °F
@@ -303,7 +303,7 @@ const Settings = () => { -

Automatically detect your location

+

Automatically detect your location

{ className="w-full" aria-label="Country codes separated by commas" /> -

+

Enter ISO country codes (e.g., us, gb, ca, au, de, fr)

@@ -463,7 +463,7 @@ const Settings = () => { className="w-full" aria-label="Maximum news articles to display" /> -

+

Show {localSettings.news.maxArticles} article{localSettings.news.maxArticles !== 1 ? 's' : ''}

@@ -494,7 +494,7 @@ const Settings = () => { className="w-full" aria-label="Cryptocurrency symbols separated by commas" /> -

+

Enter cryptocurrency symbols separated by commas (max 6 symbols)

@@ -515,7 +515,7 @@ const Settings = () => { className="w-full" aria-label="Cryptocurrency refresh interval in seconds" /> -

+

Current: {localSettings.crypto.refreshInterval} seconds