Skip to content

Commit

Permalink
Revert "chatbot implementation"
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiDiva96 authored Jun 19, 2024
1 parent 463743d commit 2d4e38e
Show file tree
Hide file tree
Showing 7 changed files with 3,108 additions and 4,760 deletions.
7,618 changes: 3,064 additions & 4,554 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.15.11",
"@mui/material": "^5.15.20",
"@mui/material": "^5.15.11",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand All @@ -25,10 +25,8 @@
"react-dom": "^18.2.0",
"react-icons": "^5.2.1",
"react-router-dom": "^6.22.2",
"react-scripts": "^5.0.1",
"react-simple-chatbot": "^0.5.0",
"react-scripts": "5.0.1",
"react-toastify": "^10.0.5",
"styled-components": "^4.4.1",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
56 changes: 33 additions & 23 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
import React, { useState } from 'react';
import Header from './pages/header';
import Footer from './pages/footer';
import Home from './components/page1/Home';
import Notice from './components/page2/notice';
import MyChatbot from './components/ChatBot/chatbot';
import { ThemeProvider } from './Content/context';
import React from 'react'
import {createContext, useState} from 'react';
import Header from "./pages/header";
import Timetable from './components/page4/timetable';
import Footer from "./pages/footer";
import Home from "./components/page1/Home";
import Notice from "./components/page2/notice";
import LoginSignup from './components/login/LoginSignup';

// import { ThemeProvider } from './components/ThemeContext';
// const ThemeContext = createContext();


function App() {
const [theme, setTheme] = useState('dark');

const toggleTheme = () => {
setTheme((currentTheme) => (currentTheme === 'light' ? 'dark' : 'light'));
};
// const [theme, setTheme] = useState("dark");
// const toggleTheme = () => {
// setTheme((curr) => (curr === "light" ? "light ": "dark"));
// }


return (
<div className="maintain">
<ThemeProvider>
<div className={`app ${theme}`}>
<Header />
<Notice />
<Home />
<MyChatbot />
<Footer />
</div>
</ThemeProvider>
<div className="maintain">

{/* <ThemeContext.Provider value={{theme, toggleTheme}}> */}
{/* <div className='app' id={theme}> */}
<Header/>
<Notice/>

{/* <Timetable /> */}
<Home />
<Footer/>

{/* </div> */}
{/* </ThemeContext.Provider> */}

</div>
);
)
}

export default App;
export default App
10 changes: 8 additions & 2 deletions src/Content/context.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// ThemeContext.js
import React, { createContext, useState, useEffect } from 'react';

export const ThemeContext = createContext();
Expand All @@ -8,8 +9,13 @@ export const ThemeProvider = ({ children }) => {
});

useEffect(() => {
localStorage.setItem('theme', theme);
document.body.className = theme === 'light' ? '' : 'active';
localStorage.setItem('theme',theme)
if(theme=='light'){
document.getElementsByTagName('body')[0].className='';
} else{

document.getElementsByTagName('body')[0].className='active';
}
}, [theme]);

const toggleTheme = () => {
Expand Down
175 changes: 0 additions & 175 deletions src/components/ChatBot/chatbot.jsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/page1/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Home() {
if (event.key === 'mode') {
setValue(event.newValue);
}
console.log('mode')
console.log('mpde')
};

window.addEventListener('storage', ()=>console.log('dfdfdf'));
Expand Down
1 change: 0 additions & 1 deletion src/components/page2/notice.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import '../page2/notice.css';

function notice() {
return (
<div className='notices'>
Expand Down

0 comments on commit 2d4e38e

Please sign in to comment.