diff --git a/src/App.js b/src/App.js
index 8354e191..1c299a91 100644
--- a/src/App.js
+++ b/src/App.js
@@ -9,6 +9,7 @@ import Base64Tool from './pages/Base64Tool';
import CsvJsonTool from './pages/CsvJsonTool';
import BeautifierTool from './pages/BeautifierTool';
import DiffTool from './pages/DiffTool';
+import TextLengthTool from './pages/TextLengthTool';
import './index.css';
@@ -25,6 +26,7 @@ function App() {
} />
} />
} />
+ } />
diff --git a/src/components/Layout.js b/src/components/Layout.js
index 20daef56..41f1afa6 100644
--- a/src/components/Layout.js
+++ b/src/components/Layout.js
@@ -1,7 +1,8 @@
import React, { useState, useEffect, useRef } from 'react';
import { Link, useLocation } from 'react-router-dom';
-import { Home, Hash, FileText, FileSpreadsheet, Wand2, GitCompare, Menu, X, Database, LinkIcon, Code2, ChevronDown } from 'lucide-react';
+import { Home, Hash, FileText, FileSpreadsheet, Wand2, GitCompare, Menu, X, Database, LinkIcon, Code2, ChevronDown, Type } from 'lucide-react';
import ThemeToggle from './ThemeToggle';
+import ToolSidebar from './ToolSidebar';
const Layout = ({ children }) => {
const location = useLocation();
@@ -41,13 +42,16 @@ const Layout = ({ children }) => {
{ path: '/csv-json', name: 'CSV/JSON Tool', icon: FileSpreadsheet, description: 'Convert CSV ↔ JSON' },
{ path: '/beautifier', name: 'Beautifier Tool', icon: Wand2, description: 'Beautify/minify code' },
{ path: '/diff', name: 'Diff Tool', icon: GitCompare, description: 'Compare text differences' },
-
+ { path: '/text-length', name: 'Text Length Checker', icon: Type, description: 'Analyze text length & stats' },
];
+ // Check if we're on a tool page (not homepage)
+ const isToolPage = location.pathname !== '/';
+
return (
-
+
{/* Header */}
-
+
@@ -58,60 +62,62 @@ const Layout = ({ children }) => {
- {/* Desktop Navigation */}
-
+ {/* Tools Dropdown */}
+
+
+
+ {/* Dropdown Menu */}
+ {isDropdownOpen && (
+
+ {tools.map((tool) => {
+ const IconComponent = tool.icon;
+ return (
+
setIsDropdownOpen(false)}
+ className={`flex items-center space-x-3 px-4 py-3 text-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors ${
+ isActive(tool.path)
+ ? 'bg-primary-50 text-primary-700 dark:bg-primary-900 dark:text-primary-300'
+ : 'text-gray-700 dark:text-gray-300'
+ }`}
+ >
+
+
+
{tool.name}
+
{tool.description}
+
+
+ );
+ })}
+
+ )}
+
+
+ )}
@@ -147,7 +153,7 @@ const Layout = ({ children }) => {
- Tools
+ {isToolPage ? 'Switch Tools' : 'Tools'}
{tools.map((tool) => {
const IconComponent = tool.icon;
@@ -177,18 +183,47 @@ const Layout = ({ children }) => {
)}
{/* Main Content */}
-
- {children}
-
-
- {/* Footer */}
-