Skip to content

Commit

Permalink
pushed updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hereisSwapnil committed Aug 31, 2024
1 parent 35a4131 commit f4e58fd
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 97 deletions.
37 changes: 37 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dotenv": "^16.3.1",
"firebase": "^10.7.2",
"pdf-lib": "^1.17.1",
"pdfjs-dist": "^4.5.136",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-heart": "^1.0.6",
Expand Down
42 changes: 22 additions & 20 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,28 @@ import MasterPage from "./MasterPage";
function App() {
return (
<UserContextProvider>
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/signup" element={<Signup />} />
<Route path="/verifyOtp" element={<VerifyOtp />} />

<Route path="/" element={<MasterPage/>}>
<Route index element={<Dashboard />}/>
<Route path="/notifications" element={<Notifcation />} />
<Route path="/questionNotifications" element={<QuestionNotifcation />} />
<Route path="/upload/:requestId" element={<UploadPage />} />
<Route path="/answer/:requestId" element={<AnswerPage />} />
<Route path="/upload" element={<UploadPage />} />
<Route path="/question" element={<QuestionPage />} />
<Route path="/request" element={<RequestPage />} />
<Route path="/leaderboard" element={<LeaderBoard />} />
<Route path="/settings" element={<Settings />} />
</Route>
</Routes>
<Analytics />
<SpeedInsights />
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/signup" element={<Signup />} />
<Route path="/verifyOtp" element={<VerifyOtp />} />
<Route path="/" element={<MasterPage />}>
<Route index element={<Dashboard />} />
<Route path="/notifications" element={<Notifcation />} />
<Route
path="/questionNotifications"
element={<QuestionNotifcation />}
/>
<Route path="/upload/:requestId" element={<UploadPage />} />
<Route path="/answer/:requestId" element={<AnswerPage />} />
<Route path="/upload" element={<UploadPage />} />
<Route path="/question" element={<QuestionPage />} />
<Route path="/request" element={<RequestPage />} />
<Route path="/leaderboard" element={<LeaderBoard />} />
<Route path="/settings" element={<Settings />} />
</Route>
</Routes>
<Analytics />
<SpeedInsights />
</UserContextProvider>
);
}
Expand Down
26 changes: 14 additions & 12 deletions client/src/MasterPage.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import React from 'react'
import { Outlet } from 'react-router'
import Navbar from './components/Navbar/Navbar'
import Footer from './components/Footer'
import React from "react";
import { Outlet } from "react-router";
import Navbar from "./components/Navbar/Navbar";
import Footer from "./components/Footer";

const MasterPage = () => {
return (
<>
<Navbar/>
<Outlet/>
<Footer/>
</>
)
}
<div className="flex flex-col min-h-screen">
<Navbar />
<div className="flex-grow">
<Outlet />
</div>
<Footer />
</div>
);
};

export default MasterPage
export default MasterPage;
100 changes: 57 additions & 43 deletions client/src/components/DocGrid/DocGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const DocGrid = () => {
const [searchInput, setSearchInput] = useState("");
const [activeTab, setActiveTab] = useState("All");
const { user, setUser, getUser } = useContext(UserContext);
const langKey=useSelector((store)=>store.config.lang)
const langKey = useSelector((store) => store.config.lang);

console.log(user);

Expand Down Expand Up @@ -167,42 +167,40 @@ const DocGrid = () => {
<>
<div className="bg-white">
<div className="mx-auto max-w-2xl px-4 py-8 sm:px-6 sm:py-12 lg:max-w-7xl lg:px-4">
<div className="flex gap-6 mb-2">
<div className="flex rounded-md overflow-hidden w-full">
<input
type="text"
className="w-full rounded-md mt-3 mb-10 rounded-r-none text-black pl-4"
placeholder={lang[langKey].Searchcourses}
value={searchInput}
onChange={(e) => setSearchInput(e.target.value)}
onKeyPress={(e) => {
if (e.key === "Enter") {
const searchTerm = e.target.value;
<div className="flex gap-6 mb-2">
<div className="flex rounded-md overflow-hidden w-full">
<input
type="text"
className="w-full rounded-md mt-3 mb-10 rounded-r-none text-black pl-4"
placeholder={lang[langKey].Searchcourses}
value={searchInput}
onChange={(e) => setSearchInput(e.target.value)}
onKeyPress={(e) => {
if (e.key === "Enter") {
const searchTerm = e.target.value;
window.location.href = `?search=${encodeURIComponent(
searchTerm
)}`;
}
}}
/>
<button
className="rounded-md mt-3 mb-10 rounded-l-none pl-4 bg-indigo-600 text-white px-6 text-lg font-semibold py-4 rounded-r-md"
onClick={() => {
window.location.href = `?search=${encodeURIComponent(
searchTerm
searchInput
)}`;
}
}}
/>
<button
className="rounded-md mt-3 mb-10 rounded-l-none pl-4 bg-indigo-600 text-white px-6 text-lg font-semibold py-4 rounded-r-md"
onClick={() => {
window.location.href = `?search=${encodeURIComponent(
searchInput
)}`;
}}
>
{lang[langKey].Go}
</button>
}}
>
{lang[langKey].Go}
</button>
</div>
<Link to="./questionNotifications">
<button
className="rounded-md mt-3 mb-10 pl-4 bg-indigo-600 text-white px-6 text-lg font-semibold py-4"
>
Doubts
</button>
<button className="rounded-md mt-3 mb-10 pl-4 bg-indigo-600 text-white px-6 text-lg font-semibold py-4">
Doubts
</button>
</Link>
</div>
</div>
<div className="flex gap-2 mb-2">
<div
onClick={() => {
Expand Down Expand Up @@ -247,15 +245,22 @@ const DocGrid = () => {
>
<div className="text-center shadow-xl rounded-lg bg-white py-2 px-2 bg-slate-100">
<div className="aspect-h-1 aspect-w-1 flex items-center w-full overflow-hidden bg-gray-800 lg:aspect-none group-hover:opacity-50 lg:h-80">
<MyImage
{/* <MyImage
src={note.thumbnail}
alt={note.thumbnail}
className="h-full w-full object-cover object-center lg:h-full lg:w-full"
/> */}
<MyImage
src="https://farm4.staticflickr.com/3789/10177514664_0ff9a53cf8_z.jpg"
className="h-full w-full object-cover object-center lg:h-full lg:w-full"
/>
</div>
<div className="mt-2">
<h3 className="text-lg text-gray-800 font-bold">
<p>{note.title}</p>
<p>
{note.title.slice(0, 25)}
{note.title.length > 25 ? "..." : ""}
</p>
</h3>
<p className="mt-1 pb-2 text-base text-gray-700">
{note.subject.subjectName}
Expand All @@ -280,7 +285,7 @@ const DocGrid = () => {

{activeTab !== "All" && notes.length === 0 ? (
<h2 className="text-2xl font-bold tracking-tight text-gray-900">
{lang[langKey].NoBookMarkedNotes}
{lang[langKey].NoBookMarkedNotes}
</h2>
) : (
""
Expand Down Expand Up @@ -326,8 +331,7 @@ const DocGrid = () => {
<div className="grid w-full grid-cols-1 items-start gap-x-6 gap-y-8 sm:grid-cols-12 lg:gap-x-8">
<div className="aspect-h-3 aspect-w-2 overflow-hidden rounded-lg bg-gray-200 sm:col-span-4 lg:col-span-5">
<img
src={note_.thumbnail}
alt={note_.thumbnail}
src="https://farm4.staticflickr.com/3789/10177514664_0ff9a53cf8_z.jpg"
className="object-cover object-center"
/>
</div>
Expand All @@ -344,27 +348,37 @@ const DocGrid = () => {
</h3>

<p className="text-md text-gray-700">
<span className="font-bold mr-2">{lang[langKey].Subject}:</span>{" "}
<span className="font-bold mr-2">
{lang[langKey].Subject}:
</span>{" "}
{note_.subject?.subjectName}
</p>

<p className="text-md text-gray-700">
<span className="font-bold mr-2">{lang[langKey].Description}:</span>{" "}
<span className="font-bold mr-2">
{lang[langKey].Description}:
</span>{" "}
{note_.description}
</p>

<p className="text-md text-gray-700">
<span className="font-bold mr-2">{lang[langKey].Year}:</span>{" "}
<span className="font-bold mr-2">
{lang[langKey].Year}:
</span>{" "}
{note_.year}
</p>

<p className="text-md text-gray-700">
<span className="font-bold mr-2">{lang[langKey].Course}:</span>{" "}
<span className="font-bold mr-2">
{lang[langKey].Course}:
</span>{" "}
{note_.course}
</p>

<p className="text-md text-gray-700">
<span className="font-bold mr-2">{lang[langKey].Likes}:</span>{" "}
<span className="font-bold mr-2">
{lang[langKey].Likes}:
</span>{" "}
{note_.likes}
</p>
<div className="flex gap-2 ">
Expand Down Expand Up @@ -392,7 +406,7 @@ const DocGrid = () => {
{lang[langKey].Productoptions}
</h3>
<p className="text-sm mt-8 text-gray-700">
Uploaded by {" "}
Uploaded by{" "}
<a
href="#"
className="hover:underline hover:text-gray-900"
Expand Down
8 changes: 2 additions & 6 deletions client/src/components/Footer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import lang from "../../utils/langaugeConstant";
import { useSelector } from "react-redux";

const Footer = () => {

const langKey=useSelector((store)=>store.config.lang)
const langKey = useSelector((store) => store.config.lang);

return (
<footer className="bg-white dark:bg-gray-900">
Expand All @@ -20,15 +19,13 @@ const Footer = () => {
</Link>
<ul className="flex flex-wrap items-center mb-6 text-sm font-medium text-gray-500 sm:mb-0 dark:text-gray-400">
<li>

<Link to="/about" className="hover:underline me-4 md:me-6">
About
</Link>

<a href="/about" className="hover:underline me-4 md:me-6">
{lang[langKey].About}
</a>

</li>
<li>
<Link
Expand All @@ -47,8 +44,7 @@ const Footer = () => {
<Link to="/contact" className="hover:underline">
Contact
</Link>
{lang[langKey].PrivacyPolicy}
</a>
{lang[langKey].PrivacyPolicy}
</li>
<li>
<a href="/licensing" className="hover:underline me-4 md:me-6">
Expand Down
Loading

1 comment on commit f4e58fd

@vercel
Copy link

@vercel vercel bot commented on f4e58fd Aug 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.