Skip to content

Commit

Permalink
temporily removed notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhravya committed Jun 25, 2023
1 parent 9af4dd3 commit e5e01bb
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 300 deletions.
167 changes: 0 additions & 167 deletions src/components/Notification.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import logo_white from "~/../public/logo-white.png";
import logo_black from "~/../public/logo-black.png";
import { useRouter } from "next/router";
import { BellIcon } from "@heroicons/react/outline";
import { useNotifs } from '~/contexts/NotifyContext';
// import { useNotifs } from '~/contexts/NotifyContext';
import { useSession } from "next-auth/react";

function TopBar() {

const [darkMode, setDarkMode] = useAtom(darkModeAtom);
const router = useRouter();
const { unseens } = useNotifs();
// const { unseens } = useNotifs();

const { data: session } = useSession();

Expand Down
4 changes: 2 additions & 2 deletions src/components/layouts/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { AnimatePresence, motion } from "framer-motion";
import { useHelp } from "~/contexts/HelpContext";
import Image from "next/image";
import logo_white from "~/../public/logo-white.png";
import { NovuProvider } from "@novu/notification-center";
// import { NovuProvider } from "@novu/notification-center";
import { useSession } from "next-auth/react";
import NotifyProvder from "~/contexts/NotifyContext";
// import NotifyProvder from "~/contexts/NotifyContext";
import { useRouter } from "next/router";

function DefaultLayout({ children }: { children: React.ReactNode }) {
Expand Down
56 changes: 0 additions & 56 deletions src/contexts/NotifyContext.tsx

This file was deleted.

32 changes: 16 additions & 16 deletions src/pages/api/db/like.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextApiRequest, NextApiResponse } from 'next'
import { Resp, Status } from '~/types/Request'
import { getSession } from "next-auth/react";
import { prisma } from '~/db/client';
import { Novu } from '@novu/node';
// import { Novu } from '@novu/node';

interface Request extends NextApiRequest {
query: {
Expand Down Expand Up @@ -62,11 +62,11 @@ export default async function handler(
}
})

const novu = new Novu(process.env.NOVU!);
// const novu = new Novu(process.env.NOVU!);

await novu.subscribers.identify(session.user.id!, {
firstName: session?.user.name,
})
// await novu.subscribers.identify(session.user.id!, {
// firstName: session?.user.name,
// })
}

const lessHaha = user.hahaCoins < 1 ? true : false;
Expand Down Expand Up @@ -172,17 +172,17 @@ export default async function handler(
}
})

const novu = new Novu(process.env.NOVU!);

await novu.trigger('likedyourpost', {
to: {
subscriberId: authorId
},
payload: {
who: `${session.user.id}`,
id: id
}
});
// const novu = new Novu(process.env.NOVU!);

// await novu.trigger('likedyourpost', {
// to: {
// subscriberId: authorId
// },
// payload: {
// who: `${session.user.id}`,
// id: id
// }
// });

return res.status(200).json({
success: Status.Success,
Expand Down
10 changes: 5 additions & 5 deletions src/pages/api/db/unlike.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextApiRequest, NextApiResponse } from 'next'
import { Resp, Status } from '~/types/Request'
import { getSession } from "next-auth/react";
import { prisma } from '~/db/client';
import { Novu } from '@novu/node';
// import { Novu } from '@novu/node';

interface Request extends NextApiRequest {
query: {
Expand Down Expand Up @@ -62,11 +62,11 @@ export default async function handler(
}
})

const novu = new Novu(process.env.NOVU!);
// const novu = new Novu(process.env.NOVU!);

novu.subscribers.identify(session?.user.id!, {
firstName: session?.user.name,
})
// novu.subscribers.identify(session?.user.id!, {
// firstName: session?.user.name,
// })

}

Expand Down
10 changes: 5 additions & 5 deletions src/pages/api/db/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
import { Resp, Status } from "~/types/Request";
import { getSession } from "next-auth/react";
import { prisma } from "~/db/client";
import { Novu } from "@novu/node";
// import { Novu } from "@novu/node";

type Request = NextApiRequest & {
query: {
Expand Down Expand Up @@ -62,11 +62,11 @@ export default async function handler(
},
});

const novu = new Novu(process.env.NOVU!);
// const novu = new Novu(process.env.NOVU!);

await novu.subscribers.identify(session?.user.username!, {
firstName: session?.user.name,
})
// await novu.subscribers.identify(session?.user.username!, {
// firstName: session?.user.name,
// })

return res.status(200).json({
success: Status.Success,
Expand Down
10 changes: 5 additions & 5 deletions src/pages/api/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
import { Resp, Status } from "~/types/Request";
import { getSession } from "next-auth/react";
import { prisma } from "~/db/client";
import { Novu } from "@novu/node";
// import { Novu } from "@novu/node";

type Request = NextApiRequest & {
query: {
Expand Down Expand Up @@ -54,11 +54,11 @@ export default async function handler(
},
});

const novu = new Novu(process.env.NOVU!);
// const novu = new Novu(process.env.NOVU!);

novu.subscribers.identify(session?.user.id!, {
firstName: session?.user.name,
})
// novu.subscribers.identify(session?.user.id!, {
// firstName: session?.user.name,
// })

return res.status(200).json({
success: Status.Success,
Expand Down
Loading

0 comments on commit e5e01bb

Please sign in to comment.