Skip to content

Commit

Permalink
Merge branch 'main' into otp
Browse files Browse the repository at this point in the history
Signed-off-by: Sourabh Singh Rawat <[email protected]>
  • Loading branch information
Sourabh782 authored Nov 10, 2024
2 parents 768bf0e + 078b5b1 commit 557829c
Show file tree
Hide file tree
Showing 58 changed files with 2,339 additions and 1,244 deletions.
63 changes: 63 additions & 0 deletions Project Structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## Project Structure 📂

```
Bitbox
├── .github
│ ├── ISSUE_TEMPLATE
│ │ ├── bug_report.yml
│ │ ├── custom.md
│ │ └── feature_request.yml
│ ├── workflows
│ │ ├── issue_open_close.yml
│ │ ├── pr-checker.yml
│ │ ├── pr_merge.yaml
│ │ └── pr_raise.yml
│ └── pull_request_template.md
├── assets
│ ├── GSSoC-Ext.png
│ ├── hacktoberfest.png
│ └── image
├── client
│ ├── favicon_io
│ ├── src
│ ├── .env.sample
│ ├── .eslintrc.cjs
│ ├── .gitignore
│ ├── README.md
│ ├── index.html
│ ├── package-lock.json
│ ├── package.json
│ ├── popup.jpg
│ ├── popup.js
│ ├── postcss.config.js
│ ├── projectupload.html
│ ├── tailwind.config.js
│ ├── test.css
│ ├── test.html
│ ├── visi.css
│ ├── visi.js
│ └── vite.config.js
├── server
│ ├── Controllers
│ ├── Models
│ ├── middleware
│ ├── routes
│ ├── .env.sample
│ ├── .gitignore
│ ├── db.js
│ ├── index.js
│ ├── package-lock.json
│ ├── package.json
│ └── sendMail.js
├── .env.txt
├── CONTRIBUTING.md
├── Code_of_Conduct.md
├── LICENSE
├── README.md
└── package-lock.json
```
4 changes: 1 addition & 3 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,10 @@
input[type="email"] {
width: 100%;
padding: 10px;
margin-bottom: 16px;
border: 1px solid #000000;
border-radius: 5px;
font-size: 14px;
}

.signup-btn1-nl {
width: 100%;
height: 30px;
Expand Down Expand Up @@ -206,7 +204,7 @@
<h1>Subscribe to Newsletter</h1>
<h2 class="h2-nl">Join the Bitbox Community!</h2>
<p class="pop_up-nl">Subscribe to receive the latest updates, tips, and project highlights from the Bitbox community. Whether you’re looking for help or want to share your knowledge, we’ve got you covered!</p>
<form id="emailForm-nl">
<form id="emailForm-nl" style="align-items: center;">
<input type="email" id="email-nl" placeholder="Enter your email" required>
<button type="submit" class="signup-btn1-nl">Subscribe</button>
</form>
Expand Down
212 changes: 48 additions & 164 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { modeAtom } from "./atom/Atom";
import { useEffect, useState } from "react";
import "./App.css";
import "./index.css";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import { Routes, Route } from "react-router-dom";
import PropTypes from "prop-types";
import LoadingBar from "react-top-loading-bar";
import About from "./component/About";
Expand All @@ -22,31 +22,25 @@ import ContactUs from "./component/Footers/Contactus";
import PrivacyPolicy from "./component/Footers/Privacypolicy";
import TermOfUse from "./component/Footers/TermOfUse";
import Community from "./component/Community";
import MyProfile from "./component/MyProfile";
import MyProject from "./component/MyProject";
import ScrollTop from "./component/ScrollTop";
import EditProfile from "./component/EditProfile";
import Contributors from "./component/Contributors";
import Discussion from "./component/Discussion";
import ForgotPassword from "./component/ForgotPassword";
import ResetPassword from "./component/ResetPassword";
// import VerifyEmail from "./component/Verify";
// import ProtectedRoute from '../../client/src/component/ProtectedRoute'
import NotFound from "./component/NotFound";
import Faq from "./component/Faq";
import ProgressBar from "./component/ProgressBar/ProgressBar";
import Cursor from './component/Cursor';
import ReadMoreBlog from './component/ReadMoreBlog';


import AOS from "aos";
import "aos/dist/aos.css";
import Collab from "./component/Collab";
import Ai from "./component/Ai";
import FAQ from "./component/Faq";
import CreateBlog from "./component/CreateBlog";
import LoginOTP from "./component/LoginPhone";
import UploadProject from "./component/UploadProject";


// Main Layout Component
const Layout = ({ children, mode, setProgress, toggleMode, showAlert }) => {
return (
<div className="h-full w-full">
Expand All @@ -55,10 +49,11 @@ const Layout = ({ children, mode, setProgress, toggleMode, showAlert }) => {
home="Home"
about="About Us"
community="Community"
profile="My Profile"
projects="Projects"
blog="Blogs"
discussion="Discussion"
contributors="Contributors"
Feedback="Feedback"
showAlert={showAlert}
mode={mode}
toggleMode={toggleMode}
Expand Down Expand Up @@ -126,175 +121,64 @@ function App() {
<Cursor />
<ProjectState>
<ProfileState>
<Router>
<LoadingBar
color="blue"
progress={progress}
onLoaderFinished={() => setProgress(0)}
/>
<div className="alert-container">
<Alert alert={alert} />
</div>
<ProgressBar mode={mode} />
<ScrollTop />

<Layout
mode={mode}
setProgress={setProgress}
toggleMode={toggleMode}
showAlert={showAlert}
>
<Routes>
<Route
exact
path="/"
element={
<Home
mode={mode}
setProgress={setProgress}
showAlert={showAlert}
/>
}
/>
<Route
exact
path="/contributors"
element={
<Contributors
mode={mode}
setProgress={setProgress}
showAlert={showAlert}
/>
}
/>
<Route
exact
path="/discussion"
element={
<Discussion
mode={mode}
setProgress={setProgress}
showAlert={showAlert}
/>
}
/>
<Route
exact
path="/community"
element={
<Community
mode={mode}
setProgress={setProgress}
showAlert={showAlert}
/>
}
/>
<Route
exact
path="/about"
element={
<About
mode={mode}
setProgress={setProgress}
showAlert={showAlert}
/>
}
/>
<Route
exact
path="/blog"
element={
<BlogPage
mode={mode}
setProgress={setProgress}
showAlert={showAlert}
/>
}
/>
<Route
exact
path="/faq"
element={
<Faq
mode={mode}
setProgress={setProgress}
showAlert={showAlert}
/>
}
/>
<Route
exact
path="/collab"
element={
<Collab
mode={mode}
setProgress={setProgress}
showAlert={showAlert}
/>
}
/>
{/* <Route exact path='/myprofile' element={<ProtectedRoute loggedin={islogged}><MyProfile mode={mode} setProgress={setProgress} showAlert={showAlert} /></ProtectedRoute>} /> */}
<Route
exact
path="/ai"
element={
<Ai
mode={mode}
setProgress={setProgress}
showAlert={showAlert}
/>
}
/>
{/* <Route exact path='/myprofile' element={<ProtectedRoute loggedin={islogged}><MyProfile mode={mode} setProgress={setProgress} showAlert={showAlert} /></ProtectedRoute>} /> */}
<Route exact path='/myprofile' element={<MyProfile mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/editprofile' element={<EditProfile mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/contributors' element={<Contributors mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path="/login" element={<Login mode={mode} setProgress={setProgress} showAlert={showAlert} loggedin={islogged} setloggedin={setloggedin} />} />
<Route exact path="/login-otp" element={<LoginOTP mode={mode} setProgress={setProgress} showAlert={showAlert} loggedin={islogged} setloggedin={setloggedin} />} />
<Route exact path='/signup' element={<Signup mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/forgot-password' element={<ForgotPassword mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/reset-password' element={<ResetPassword mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/codeofconduct' element={<CodeOfConduct mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/feedback' element={<Feedback mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/contactus' element={<ContactUs mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/privacypolicy' element={<PrivacyPolicy mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/termofuse' element={<TermOfUse mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/FAQ' element={<FAQ />} /> {/* Add this line */}
<Route exact path='/createBlogPost' element={<CreateBlog />} /> {/* Add this line */}
<Route exact path='/read-more-blog/:id' element={<ReadMoreBlog mode={mode} setProgress={setProgress} showAlert={showAlert} />} /> {/* Add this line */}
<Route exact path='/*' element={<NotFound />} />

</Routes>
</Layout>
</Router>
<Router>
<LoadingBar color="blue" progress={progress} onLoaderFinished={() => setProgress(0)} />
<div className="alert-container"> <Alert alert={alert} /> </div>
<ProgressBar mode={mode} />
<ScrollTop />
<Layout mode={mode} setProgress={setProgress} toggleMode={toggleMode} showAlert={showAlert} >
<Routes>
<Route exact path="/" element={<Home mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path="/contributors" element={<Contributors mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path="/discussion" element={<Discussion mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path="/community" element={<Community mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path="/ai" element={ <Ai mode={mode} setProgress={setProgress} showAlert={showAlert} /> } />
<Route exact path="/about" element={<About mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path="/feedback" element={<Feedback mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path="/blog" element={<BlogPage mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path="/collab" element={<Collab mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/myproject' element={<MyProject mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/editprofile' element={<EditProfile mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path="/login" element={<Login mode={mode} setProgress={setProgress} showAlert={showAlert} loggedin={islogged} setloggedin={setloggedin} />} />
<Route exact path="/login-otp" element={<LoginOTP mode={mode} setProgress={setProgress} showAlert={showAlert} loggedin={islogged} setloggedin={setloggedin} />} />
<Route exact path='/signup' element={<Signup mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/forgot-password' element={<ForgotPassword mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/reset-password' element={<ResetPassword mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/codeofconduct' element={<CodeOfConduct mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/contactus' element={<ContactUs mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/myprofile' element={<MyProfile mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/feedback' element={<Feedback mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/privacypolicy' element={<PrivacyPolicy mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/termofuse' element={<TermOfUse mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/uploadProject' element={<UploadProject mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/createBlogPost' element={<CreateBlog />} />
<Route exact path="/faq" element={ <Faq mode={mode} setProgress={setProgress} showAlert={showAlert} /> } />
<Route exact path='/read-more-blog/:id' element={<ReadMoreBlog mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path='/*' element={<NotFound />} />
</Routes>
</Layout>
</Router>
</ProfileState>
</ProjectState>
</div>
);
}

// Props Validation
// Prop validation
App.propTypes = {
children: PropTypes.string,
mode: PropTypes.string,
setProgress: PropTypes.string,
setProgress: PropTypes.func,
toggleMode: PropTypes.func,
showAlert: PropTypes.func,
myProjects: PropTypes.string,
about: PropTypes.string,
isAuthenticated: PropTypes.bool,
islogged: PropTypes.bool,
};

// Props Validation
Layout.propTypes = {
children: PropTypes.node, // Allows children to be any renderable React node, including JSX
children: PropTypes.node,
mode: PropTypes.string,
setProgress: PropTypes.func, // Should be a function
setProgress: PropTypes.func,
toggleMode: PropTypes.func,
showAlert: PropTypes.func,
myProjects: PropTypes.string,
about: PropTypes.string,
isAuthenticated: PropTypes.bool,
};

export default App;
Loading

0 comments on commit 557829c

Please sign in to comment.