Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggletheme added #156

Closed
wants to merge 76 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
8cf4cef
Initial commit
algovengers Mar 29, 2024
a857853
Initialise the project with next js and shadcn ui
afeefuddin Mar 29, 2024
793e95a
added django sturcture
HikariZasureiya Mar 29, 2024
0a508e5
Merge pull request #2 from HikariZasureiya/main
HikariZasureiya Mar 29, 2024
c9f752f
added authentication
HikariZasureiya Mar 29, 2024
6e977e8
homepage (#4)
subharthihazra Mar 29, 2024
2329d38
Setup login ad signup page frontend
afeefuddin Mar 29, 2024
b6effc7
added the chat part
rohitt24k Mar 29, 2024
3259b0a
Merge pull request #6 from rohitt24k/main
rohitt24k Mar 29, 2024
408ca76
resolving
HikariZasureiya Mar 29, 2024
9161c25
remove unnecessary pychache and made a route to check loggedIn status
afeefuddin Mar 29, 2024
e73e457
Update Requirements for deployment
afeefuddin Mar 29, 2024
f59f7d0
Minor changes in the auth part (#10)
afeefuddin Mar 29, 2024
00b53e5
dashboard frontend
subharthihazra Mar 29, 2024
6d07e65
report frontend
subharthihazra Mar 29, 2024
508725a
context and ui (big pr) (#12)
subharthihazra Mar 29, 2024
7595185
minor fix (#13)
subharthihazra Mar 29, 2024
686532c
cors origin backend env (#14)
subharthihazra Mar 29, 2024
ab9adb8
added chat feature
rohitt24k Mar 29, 2024
c04bad0
Merge pull request #15 from rohitt24k/main
rohitt24k Mar 29, 2024
9f9561f
CORS Fixes
afeefuddin Mar 29, 2024
9eea7c9
Fix the types of the reader
afeefuddin Mar 29, 2024
0a27c97
Minor fixes
afeefuddin Mar 29, 2024
78cc805
Minor Link fix
afeefuddin Mar 29, 2024
2a241a7
Access token fix (#20)
afeefuddin Mar 29, 2024
2af3f42
Fixing the report API
afeefuddin Mar 29, 2024
a17ef38
setting up redirect fix
afeefuddin Mar 30, 2024
6eebd03
Minor fixes
afeefuddin Mar 30, 2024
065efde
prompt chng (#24)
subharthihazra Mar 30, 2024
717b613
report form fix & chat pvt route fix (#25)
subharthihazra Mar 30, 2024
a27e8e3
Dasboard api connection
afeefuddin Mar 30, 2024
713db00
fix redirect
afeefuddin Mar 30, 2024
ceb55ac
minor changes
afeefuddin Mar 30, 2024
f991965
landing (#29)
subharthihazra Mar 30, 2024
5b2e2a6
minor change
afeefuddin Mar 30, 2024
d352bc7
fix cors
afeefuddin Mar 30, 2024
de9a9fc
fix file up report (#32)
subharthihazra Mar 30, 2024
51ecbab
txt chng (#33)
subharthihazra Mar 30, 2024
2b312fd
gfgff (#34)
subharthihazra Mar 30, 2024
be2303c
fdhsrdz (#35)
subharthihazra Mar 30, 2024
8d5a461
Update README.md
HikariZasureiya Mar 30, 2024
57a4e65
Update README.md
HikariZasureiya Mar 30, 2024
ade9280
Update README.md
subharthihazra Mar 30, 2024
26ccab1
Update README.md
subharthihazra Mar 30, 2024
68fc99d
Update README.md
subharthihazra Mar 30, 2024
917b4a0
Minor changes
afeefuddin May 5, 2024
a7438ab
Frontend sample
afeefuddin May 5, 2024
e6ae6e5
update readme
afeefuddin May 5, 2024
612f5a5
setup vercel workflows
afeefuddin May 10, 2024
d89f702
Update settings.py
HikariZasureiya May 10, 2024
86579f1
code of conduct file added
May 11, 2024
5cf4030
Workflow Update
afeefuddin May 11, 2024
af7d35f
revert pr workflow of vercel
afeefuddin May 11, 2024
e25ea2d
removed unnecesarry line
nishant0708 May 10, 2024
eee3e26
update langchain library
afeefuddin May 12, 2024
78f3ee2
PR workflow
afeefuddin May 12, 2024
809b56d
github workflow
afeefuddin May 12, 2024
3c6c654
Update PR.yaml
afeefuddin May 12, 2024
92f28c4
Update PR.yaml
afeefuddin May 12, 2024
9c1c213
Workflow update
afeefuddin May 12, 2024
7773609
Loaders added for fetching chats with AI and button disabled while
atharvarekhawar May 11, 2024
a280a0e
Update README.md
algovengers May 13, 2024
fad6620
Update PR.yaml
afeefuddin May 13, 2024
e7c427f
Update README.md
RiyaaBhatt May 15, 2024
f62c097
Create CONTRIBUTING.md
suhanipaliwal May 14, 2024
8fa6d8a
made the SignUp and the LoginPage Ui again with a better design-also …
SumitKumar-17 May 11, 2024
1c841d9
Update Signup and login pages in README file
afeefuddin May 16, 2024
f9b33cb
Update page.tsx
Rakshit-gen May 17, 2024
da06393
add toggle theme in src/components/Sidebar/SideBar.jsx
Rohitha-pudu May 17, 2024
2bfe3b9
add toggle theme in src/components/Sidebar/sidebar.css
Rohitha-pudu May 17, 2024
5a243a0
update src/index.css
Rohitha-pudu May 17, 2024
44b29cc
Added a Confirm Password button.
akshaydubey05 May 16, 2024
51f0873
upadte toggle
Rohitha-pudu May 19, 2024
848dce0
Added favicon to Hairify
Madhu-mac May 19, 2024
2fbe772
Merge remote-tracking branch 'upstream/main' into toggletheme
Rohitha-pudu May 23, 2024
ce7d8f8
Merge branch 'Avdhesh-Varshney:main' into toggletheme
Rohitha-pudu May 23, 2024
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
33 changes: 28 additions & 5 deletions src/components/Sidebar/SideBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import './sidebar.css';

import { FaBars } from 'react-icons/fa';
import { BiSearch } from 'react-icons/bi';
import { FiSun, FiMoon } from 'react-icons/fi';



const inputAnimation = {
hidden: {
Expand Down Expand Up @@ -44,6 +47,16 @@ const SideBar = ({ routes, children }) => {
const [isOpen, setIsOpen] = useState(false);
const location = useLocation();

const [theme, setTheme] = useState('light'); //Add state to manage the current theme

const ThemeToggleIcon = ({ theme }) => {
return theme === 'light' ? <FiMoon /> : <FiSun />;
};
const toggleTheme = () => {
// Create a function to toggle the theme
setTheme(theme === 'light' ? 'dark' : 'light');
};

useEffect(() => {
const currentCategory = getCurrentCategory();
const scrollbarColor = getScrollbarColor(currentCategory);
Expand Down Expand Up @@ -93,17 +106,19 @@ const SideBar = ({ routes, children }) => {
};

const toggle = () => setIsOpen(!isOpen);



return (
<>
<div className='main-container'>
<div className={`main-container ${theme}`}>
<motion.div
animate={{
width: isOpen ? '200px' : '75px',
position: 'fixed',
transition: { duration: 0.5, type: 'spring', damping: 10 },
}}
className={`sidebar`}
className={`sidebar ${theme}`} // Apply theme class to sidebar
>
<div className='top_section d-lg-flex align-items-center justify-content-center'>
<AnimatePresence>
Expand All @@ -120,14 +135,14 @@ const SideBar = ({ routes, children }) => {
</div>

<div className='search'>
<div className='search_icon circle'>
<div className={`search-icon circle ${theme}`}>
<BiSearch />
</div>
<AnimatePresence>
{isOpen && <motion.input initial='hidden' animate='show' exit='hidden' variants={inputAnimation} type='text' placeholder='Search' />}
</AnimatePresence>
</div>

<section className='routes'>
{routes.map((route, index) => {
if (route.subRoutes) {
Expand All @@ -140,12 +155,15 @@ const SideBar = ({ routes, children }) => {
setIsOpen={setIsOpen}
routes={routes} // Pass the routes prop here
/>

);
}


return (

<NavLink to={route.path} key={index} className='link' activeClassName='active'>
<div className='circle'>
<div className={`circle ${theme}`}>
<div className='icon'>{route.icon}</div>
</div>
<AnimatePresence>
Expand All @@ -159,6 +177,11 @@ const SideBar = ({ routes, children }) => {
);
})}
</section>
<div className='theme' onClick={toggleTheme}> {/* Handle theme toggle action */}
<div className='bars flex-grow d-flex align-items-stretch align-self-center'>
{theme === 'light' ? <FiMoon /> : <FiSun />} {/* Conditional rendering based on theme */}
</div>
</div>
</motion.div>

<main style={{ marginLeft: 'auto', transition: 'all 0.3s' }}>{children}</main>
Expand Down
66 changes: 60 additions & 6 deletions src/components/Sidebar/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,62 @@
box-sizing: border-box;
}

:root {
--sidebar-bg-light: #afacac;
--sidebar-bg-dark: #251d45;
--sidebar-color-light: #000000;
--sidebar-color-dark: #fffffff5;
--active-bg: #0f1015;
--link-color-light: #6c7293;
--link-color-dark: #bba8bff5;
--main-container-bg-light: #c7c6d0;
--main-container-bg-dark: #0c003a;
--main-container-color-light: #000000;
--main-container-color-dark: #ffffff;
--circle-bg-light:#d9e5f1;
--circle-bg-dark:#000000;


}

.sidebar {
background: var(--sidebar-bg-light);
color: var(--sidebar-color-light);
}

.sidebar.dark {
background: var(--sidebar-bg-dark);
color: var(--sidebar-color-dark);
}

.main-container {
background: var(--main-container-bg-light);
color: var(--main-container-color-light);


}
.main-container.dark {
background: var(--main-container-bg-dark);
color: var(--main-container-color-dark);
}
.circle{
background: var(--circle-bg-light);
}
.circle.dark{
background: var(--circle-bg-dark);
}

/* end */

.main-container {
display: flex;
background-color: black;
color: white;
/* background-color: rgb(158, 0, 0); */
/* color: white; */
}

.sidebar {
background: #12151e;
color: #6c7293;
/* background: #12151e; */
/* color: #9c7358; */
height: 100%;
overflow-y: auto;
}
Expand Down Expand Up @@ -46,6 +93,13 @@
height: 30px;
padding: 10px;
}
.theme{
display: flex;
align-items: center;
margin: 10px 0;
height: 30px;
padding: 20px;
}

.search input {
border: none;
Expand Down Expand Up @@ -119,7 +173,7 @@
.icon {
font-size: 1.2rem;
line-height: 1.2;
color: #bba8bff5;
color: #7a0a91f5;
}

.icon::before {
Expand All @@ -130,7 +184,7 @@
width: 30px;
height: 30px;
border-radius: 100%;
background-color: #6c729333;
/* background-color: #77e1ad33; */
text-align: center;
margin-left: 10px;
}
Expand Down
14 changes: 12 additions & 2 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #000000;
/* background-color: #000000; */
/* 6c7293 - light blackish */
/* 0f1015 - fade black color */

Expand All @@ -15,12 +15,22 @@
-moz-osx-font-smoothing: grayscale;
}

:root {
--body-bg-light: #0c0000;
--body-bg-dark: #000000;
}
body{
background-color: var(--body-bg-light);
}
body.dark{
background-color: var(--body-bg-dark);
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: #000000;
/* background-color: #000000; */
color: white;
}

Expand Down