Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,4 @@ function Navbar({ scrollToFooter }: { scrollToFooter: any }) {
);
}

export default Navbar;
export default Navbar;
2 changes: 1 addition & 1 deletion src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ const Sidebar: React.FC<{ steps: { title: string; link: string }[] }> = ({
);
};

export default Sidebar;
export default Sidebar;
2 changes: 2 additions & 0 deletions src/components/ToggleDarkMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const ToggleDarkMode: React.FC = () => {
const handleChange = () => {
toggleDarkMode();
setIsDarkMode((prev) => !prev);
const newTheme = !isDarkMode ? "dark" : "light";
document.documentElement.setAttribute("data-theme", newTheme);
};

return (
Expand Down
20 changes: 20 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,23 @@ body {
margin: 0;
padding: 0;
}

html[data-theme="dark"] {
--bg-color: #121212;
--text-color: #ffffff;
--border-color: #444444;
--active-bg-color: #333333;
--active-text-color: #ffffff;
--hover-bg-color: #444444;
--hover-text-color: #ffffff;
}

html[data-theme="light"] {
--bg-color: #ffffff;
--text-color: #121212;
--border-color: #ddd;
--active-bg-color: #e0e0e0;
--active-text-color: #1b2540;
--hover-bg-color: #e0e0e0;
--hover-text-color: #050c40;
}
10 changes: 7 additions & 3 deletions src/pages/LearnNow.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import React from "react";
import { Outlet } from "react-router-dom";
import Sidebar from "../components/Sidebar";
import { LearnNowContainer } from "../styles/pages/LearnNow";
import { LearnNowContainer, SidebarContainer, ContentContainer } from "../styles/pages/LearnNow";
import { steps } from "../constants/learningSteps/steps";

const LearnNow: React.FC = () => {
return (
<LearnNowContainer>
<Sidebar steps={steps} />
<Outlet />
<SidebarContainer>
<Sidebar steps={steps} />
</SidebarContainer>
<ContentContainer>
<Outlet />
</ContentContainer>
</LearnNowContainer>
);
};
Expand Down
6 changes: 4 additions & 2 deletions src/styles/components/Content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const ContentContainer = styled.div`
max-width: 900px;
width: 100%;
margin: 0 auto;
background: #ffffff;
background-color: var(--bg-color) !important;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
box-sizing: border-box;
Expand All @@ -18,12 +18,13 @@ export const ContentContainer = styled.div`
h6 {
margin-top: 1em;
margin-bottom: 0.5em;
color: #333;
color: var(--text-color) !important;
}

p {
line-height: 1.6;
margin-bottom: 1em;
color: var(--text-color) !important;
}

a {
Expand All @@ -41,6 +42,7 @@ export const ContentContainer = styled.div`

li {
margin-bottom: 0.5em;
color: var(--text-color) !important;
}
}

Expand Down
20 changes: 10 additions & 10 deletions src/styles/components/Sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { NavLink } from "react-router-dom";

export const SidebarContainer = styled.div`
width: 260px;
background-color: #f5f5f5;
background-color: var(--bg-color) !important;
padding: 1rem;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
border-radius: 4px;
position: relative;
overflow-y: auto;

border-right: 1px solid #ddd;
@media (max-width: 768px) {
width: 100%;
height: auto;
Expand All @@ -21,7 +21,7 @@ export const SidebarTitle = styled.h2`
font-size: 1.2rem;
font-weight: 500;
margin-bottom: 1rem;
color: #333;
color: var(--text-color) !important;
`;

export const SidebarList = styled.ul`
Expand All @@ -41,19 +41,19 @@ export const SidebarLink = styled(NavLink)`
border-radius: 4px;
font-size: 0.95rem;
font-weight: 600;
color: #717171;
color: var(--text-color) !important;
transition: background-color 0.3s, color 0.3s;

&.active {
background-color: #e0e0e0;
color: #1b2540;
background-color: var(--active-bg-color) !important;
color: var(--active-text-color) !important;
font-weight: 600;
border-left: 2.5px solid #19c6c7;
}

&:hover {
background-color: #e0e0e0;
color: #050c40;
background-color: var(--hover-bg-color) !important;
color: var(--hover-text-color) !important;
text-decoration: underline;
}
`;
Expand Down Expand Up @@ -81,7 +81,7 @@ export const HelperText = styled.div`
color: #333;

a {
color: #19c6c7;
color: #19c6c7 !important;
text-decoration: none;

&:hover {
Expand All @@ -98,4 +98,4 @@ export const DividerLine = styled.div`
height: 1px;
background-color: #ddd;
margin: 7rem 0 1rem 0;
`;
`;
10 changes: 6 additions & 4 deletions src/styles/pages/LearnNow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export const LearnNowContainer = styled.div`

export const SidebarContainer = styled.div`
width: 250px;
background-color: #f4f4f4;
padding: 20px;
border-right: 1px solid #ddd;
background-color: var(--bg-color) !important;
padding: 0;
border-right: 1px solid var(--border-color) !important;

h2 {
margin-top: 0;
Expand All @@ -25,11 +25,13 @@ export const SidebarContainer = styled.div`

a {
text-decoration: none;
color: #333;
color: var(--text-color) !important;
}
`;

export const ContentContainer = styled.div`
flex: 1;
padding: 20px;
background-color: var(--bg-color) !important;
color: var(--text-color) !important;
`;