From 00593357a81c4a631908a94b46f1f2e42ee0a23c Mon Sep 17 00:00:00 2001 From: Prateek Date: Thu, 5 Oct 2023 17:35:37 +0530 Subject: [PATCH] Add Light Theme (#178) --- src/App.jsx | 11 +++++--- src/components/Doc/DocItem.jsx | 4 +-- src/components/Error/ErrorCard.jsx | 2 +- src/components/Header/Header.jsx | 20 +++++++++++--- src/components/Search/SearchInput.jsx | 4 +-- src/context/ThemeContext.jsx | 38 +++++++++++++++++++++++++++ src/hooks/useColorBorderBox.js | 2 +- src/index.css | 2 +- tailwind.config.cjs | 1 + 9 files changed, 69 insertions(+), 15 deletions(-) create mode 100644 src/context/ThemeContext.jsx diff --git a/src/App.jsx b/src/App.jsx index 18167f0..4b2453d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -4,6 +4,7 @@ import Error from "./components/Error/Error"; import SearchInput from "./components/Search/SearchInput"; import Layout from "./components/Layout/Layout"; import BGShape from "./components/BGShape"; +import { ThemeProvider } from "./context/ThemeContext"; function App() { const [search, setSearch] = useState(""); @@ -11,10 +12,12 @@ function App() { return ( <> - - - - + + + + + + ); } diff --git a/src/components/Doc/DocItem.jsx b/src/components/Doc/DocItem.jsx index 4a6cf45..f3377d3 100644 --- a/src/components/Doc/DocItem.jsx +++ b/src/components/Doc/DocItem.jsx @@ -9,8 +9,8 @@ const DocItem = ({ title, content }) => { // const b = "" return (
-
{title}
-

+

{title}
+

{ content.length > 100 ? content.substring(0, 100).replace(/`/g, '') : content.replace(/`/g, '') } diff --git a/src/components/Error/ErrorCard.jsx b/src/components/Error/ErrorCard.jsx index 4378fc8..f888762 100644 --- a/src/components/Error/ErrorCard.jsx +++ b/src/components/Error/ErrorCard.jsx @@ -27,7 +27,7 @@ function ErrorCard({ error }) {

-

+

{readMore ? error.description : error.description.substring(0, 100)} {error.description.length > 100 ? (