Skip to content

Commit

Permalink
Merge branch 'master' into issue-404
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanchitbajaj02 authored Jul 29, 2024
2 parents b96c31e + caa525b commit fe21723
Show file tree
Hide file tree
Showing 13 changed files with 354 additions and 223 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"eslint-config-next": "13.4.13",
"framer-motion": "10.18.0",
"html-react-parser": "5.1.1",
"lenis": "^1.1.6",
"lucide-react": "0.316.0",
"next": "13.5.4",
"next-themes": "0.2.1",
Expand Down
3 changes: 3 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import AnimatedCursor from "react-animated-cursor";
import ScrollToTop from "@/components/ScrollToTop/scrolltotop";

import { Providers } from "./providers";
import LenisWrapper from "@/helper/leniswrapper";

const poppinsFont = Poppins({
subsets: ["latin"],
Expand Down Expand Up @@ -49,6 +50,7 @@ export const metadata: Metadata = {

export default async function RootLayout({ children }: { children: React.ReactNode }) {
return (
<LenisWrapper>
<html
lang="en"
className={`${poppinsFont.className} scrollbar-thin scrollbar-thumb-primary scrollbar-track-secondary-light scrollbar-track-rounded-full`}
Expand Down Expand Up @@ -90,5 +92,6 @@ export default async function RootLayout({ children }: { children: React.ReactNo
<ScrollToTop />
</body>
</html>
</LenisWrapper>
);
}
6 changes: 3 additions & 3 deletions src/backend/auth.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const register = async (userData: {

const verifyUser = async (accountId: string, secret: string) => {
try {
console.log("data:", accountId, secret);
// console.log("data:", accountId, secret);

const verifyResponse = await account.updateVerification(accountId, secret);

Expand Down Expand Up @@ -259,7 +259,7 @@ const saveDataToDatabase = async (session: any) => {
if (!resp) {
throw new Error("Database not working");
}
console.log(resp);
// console.log(resp);
return resp;
} catch (error: any) {
console.log(error.message);
Expand Down Expand Up @@ -330,7 +330,7 @@ const saveDataToDatabaseForOauth = async (session: Models.User<Models.Preference
if (!resp) {
throw new Error("Database not working");
}
console.log(resp);
// console.log(resp);
return resp;
} catch (error: any) {
console.log(error.message);
Expand Down
2 changes: 1 addition & 1 deletion src/backend/bookmarks.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const getBookmarks = async (userId: string) => {
const saveBookmark = async (userId: string, postId: string) => {
try {
const getSavedBookmarkData = await getBookmarks(userId);
console.log(getSavedBookmarkData);
// console.log(getSavedBookmarkData);
if (!getSavedBookmarkData) {
throw new Error("Account does not exist");
}
Expand Down
4 changes: 2 additions & 2 deletions src/backend/updateProfile.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const saveImage = async (image: File) => {
const resp = await storage.createFile(userBucketStorage, ID.unique(), image);

if (!resp) {
console.log(resp);
// console.log(resp);
throw new Error("Photo cannot be uploaded");
}
return resp;
Expand All @@ -50,7 +50,7 @@ const saveImage = async (image: File) => {

const updateImageURL = async (userId: string, image: string, isBanner: boolean) => {
try {
console.log(image);
// console.log(image);

if (isBanner) {
const result01 = await db.updateDocument(palettegramDB, usersCollection, userId, {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Editor/EditorMenuBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const EditorMenubar = ({ editor }: { editor: Editor }) => {
onClick={(e) => {
e.preventDefault();
menu.onFunction();
console.log("cick");
// console.log("cick");
}}
disabled={!menu.offFunction}
className={
Expand Down
2 changes: 1 addition & 1 deletion src/components/core/createPost/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const CreatePost = () => {
if (!savetoDb) {
throw new Error();
}
console.log(savetoDb, "svaetoDB");
// console.log(savetoDb, "svaetoDB");
dispatch(addPost(finalDataToUpload));
toastify("Post uploaded successfully", "success");

Expand Down
2 changes: 1 addition & 1 deletion src/components/core/navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const Navbar = ({ starCount }: { starCount?: number }) => {
}

return () => {
console.log("cleanup");
// console.log("cleanup");
};
}, [currentUser, getBookmarksFromDatabase, getPostsFromDatabase, userIdFromCookies]);

Expand Down
2 changes: 1 addition & 1 deletion src/components/core/newsletter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Newsletter: React.FC = () => {

emailjs.send("service_7lb51ka","template_njg2wcp",templateParams,"-OBmWZjadmE1odXKm")
.then((response)=>{
console.log("email sent",response)
// console.log("email sent",response)
setSubscriberEmail("");
})
.catch((err)=>{
Expand Down
6 changes: 3 additions & 3 deletions src/components/pages/user/userPosts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function UserPosts({ userId }: { userId: string }) {
useEffect(() => {
getAllUserPosts(userId)
.then((allPosts: any | undefined) => {
console.log("posts inside api", allPosts);
// console.log("posts inside api", allPosts);
if (allPosts && allPosts.length > 0) {
setUserPosts(allPosts);
}
Expand All @@ -45,11 +45,11 @@ export default function UserPosts({ userId }: { userId: string }) {
});

return () => {
console.log("cleanup");
// console.log("cleanup");
};
}, [userId]);

console.log("all user posts:", userPosts);
// console.log("all user posts:", userPosts);

return (
<>
Expand Down
18 changes: 18 additions & 0 deletions src/helper/leniswrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// src/components/LenisWrapper.tsx
'use client';

import React, { ReactNode } from 'react';
import useLenis from './useLenis';


interface LenisWrapperProps {
children: ReactNode;
}

const LenisWrapper: React.FC<LenisWrapperProps> = ({ children }) => {
useLenis();

return <>{children}</>;
};

export default LenisWrapper;
18 changes: 18 additions & 0 deletions src/helper/useLenis.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use client'
import { useEffect } from 'react';
import Lenis from 'lenis';

const useLenis = () => {
useEffect(() => {
const lenis = new Lenis();

function raf(time:any) {
lenis.raf(time);
requestAnimationFrame(raf);
}

requestAnimationFrame(raf);
}, []);
};

export default useLenis;
Loading

0 comments on commit fe21723

Please sign in to comment.