-
+
-
-
{children}
+
{children}
diff --git a/apps/client/pages/_app.tsx b/apps/client/pages/_app.tsx
index 15b48ff63..f2e79f368 100644
--- a/apps/client/pages/_app.tsx
+++ b/apps/client/pages/_app.tsx
@@ -1,4 +1,5 @@
import "@radix-ui/themes/styles.css";
+import { ThemeProvider } from "next-themes";
import "../styles/globals.css";
import {
@@ -7,9 +8,7 @@ import {
HomeIcon,
TicketIcon,
} from "@heroicons/react/24/outline";
-import { MantineProvider } from "@mantine/core";
import { Notifications } from "@mantine/notifications";
-import { SpotlightProvider } from "@mantine/spotlight";
import { Theme } from "@radix-ui/themes";
import { useRouter } from "next/router";
import { QueryClient, QueryClientProvider } from "react-query";
@@ -28,8 +27,6 @@ const queryClient = new QueryClient();
function Auth({ children }: any) {
const { loading, user } = useUser();
- const router = useRouter();
-
React.useEffect(() => {
if (loading) return; // Do nothing while loading
}, [user, loading]);
@@ -101,38 +98,37 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }: any) {
if (router.pathname.includes("/admin")) {
return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
);
}
- if (router.pathname === "/notebook/[id]") {
+ if (router.pathname.includes("/notebook")) {
return (
-
-
+
+
@@ -143,8 +139,8 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }: any) {
-
-
+
+
);
}
@@ -152,12 +148,12 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }: any) {
if (router.pathname.includes("/settings")) {
return (
-
-
+
+
@@ -168,8 +164,8 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }: any) {
-
-
+
+
);
}
@@ -194,24 +190,18 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }: any) {
return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
);
}
diff --git a/apps/client/pages/index.tsx b/apps/client/pages/index.tsx
index f3fd6ca33..128c35cc4 100644
--- a/apps/client/pages/index.tsx
+++ b/apps/client/pages/index.tsx
@@ -1,11 +1,9 @@
-import { CheckCircleIcon } from "@heroicons/react/20/solid";
import Link from "next/link";
import { useEffect, useState } from "react";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
-import ListTodo from "../components/ListTodo";
import { getCookie } from "cookies-next";
import moment from "moment";
@@ -118,60 +116,22 @@ export default function Home() {
}, []);
return (
-
+
-
-
-
-
- {/* Profile */}
-
-
-
- {user.name[0]}
-
-
-
-
-
- {t("hello_good")}{" "}
- {hour! < Number(12)
- ? t("hello_morning")
- : t("hello_afternoon")}
- , {user.name}!
-
-
-
- - {t("account_status")}
- -
-
- {user.isAdmin ? "Admin" : "user"}
-
-
-
-
-
-
-
-
-
{!loading && (
<>
-
+
{stats.map((item) => (
-
-
+
-
{item.name}
- -
+
-
{item.stat}
@@ -505,10 +465,10 @@ export default function Home() {
>
)}
-
+ {/*
{t("reminders")}
-
+
*/}
);
}
diff --git a/apps/client/pages/new.tsx b/apps/client/pages/new.tsx
index 6fa4e6f47..0b8c942cf 100644
--- a/apps/client/pages/new.tsx
+++ b/apps/client/pages/new.tsx
@@ -171,7 +171,7 @@ export default function CreateTicket() {
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
-
+
{options !== undefined &&
options.map((client: any) => (
createTicket()}
- className="rounded bg-indigo-600 px-2 py-1 text-xs font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
+ className="rounded bg-green-600 px-4 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-green-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-600"
>
Create Ticket
diff --git a/apps/client/pages/notebook/[id].js b/apps/client/pages/notebook/[id].tsx
similarity index 97%
rename from apps/client/pages/notebook/[id].js
rename to apps/client/pages/notebook/[id].tsx
index d243e0a32..3e805b526 100644
--- a/apps/client/pages/notebook/[id].js
+++ b/apps/client/pages/notebook/[id].tsx
@@ -76,6 +76,7 @@ export default function Notebooks() {
);
setSaving(false);
let date = new Date();
+ // @ts-ignore
setLastSaved(new Date(date).getTime());
}
@@ -91,7 +92,7 @@ export default function Notebooks() {
return (
<>
-
+
{title}
{saving ? (
saving ....
@@ -102,7 +103,7 @@ export default function Notebooks() {
)}
{!loading && (
-
+
diff --git a/apps/client/pages/notebook/index.js b/apps/client/pages/notebook/index.js
deleted file mode 100644
index a2cbb3383..000000000
--- a/apps/client/pages/notebook/index.js
+++ /dev/null
@@ -1,131 +0,0 @@
-import { getCookie } from "cookies-next";
-import moment from "moment";
-import useTranslation from "next-translate/useTranslation";
-import { useRouter } from "next/router";
-import { useQuery } from "react-query";
-
-async function fetchNotebooks(token) {
- const res = await fetch(
- `${process.env.NEXT_PUBLIC_API_URL}/api/v1/notebooks/all`,
- {
- method: "GET",
- headers: {
- "Content-Type": "application/json",
- Authorization: `Bearer ${token}`,
- },
- }
- );
- return res.json();
-}
-
-export default function NoteBooksIndex() {
- const { t } = useTranslation("peppermint");
-
- const token = getCookie("session");
- const { data, status, error, refetch } = useQuery("getUsersNotebooks", () =>
- fetchNotebooks(token)
- );
-
- const router = useRouter();
-
- async function deleteNotebook(id) {
- if (window.confirm("Do you really want to delete this notebook?")) {
- const res = await fetch(`/api/v1/note/${id}/delete`).then((res) =>
- res.json()
- );
- console.log(res);
- refetch();
- }
- }
-
- return (
- <>
-
-
-
-
- {t("notebooks")}
-
-
- {t("notebooks_description")}
-
-
-
-
- {status === "success" && (
-
-
-
- {data.notebooks.length > 0 && (
-
-
-
-
- {t("title")}
- |
-
- {t("created_at")}
- |
-
- {t("updated_at")}
- |
- |
-
-
-
- {data.notebooks.map((note) => (
- router.push(`/notebook/${note.id}`)}
- >
-
- {note.title}
- |
-
- {moment(note.createdAt).format("DD-MM-YYYY")}
- |
-
- {moment(note.updatedAt).format("DD-MM-YYYY")}
- |
-
-
- |
-
- ))}
-
-
- )}
-
-
-
- )}
-
- >
- );
-}
diff --git a/apps/client/pages/notebook/index.tsx b/apps/client/pages/notebook/index.tsx
new file mode 100644
index 000000000..22f8a9719
--- /dev/null
+++ b/apps/client/pages/notebook/index.tsx
@@ -0,0 +1,56 @@
+import { getCookie } from "cookies-next";
+import useTranslation from "next-translate/useTranslation";
+import { useRouter } from "next/router";
+import { useQuery } from "react-query";
+
+async function fetchNotebooks(token) {
+ const res = await fetch(
+ `${process.env.NEXT_PUBLIC_API_URL}/api/v1/notebooks/all`,
+ {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+ return res.json();
+}
+
+export default function NoteBooksIndex() {
+ const { t } = useTranslation("peppermint");
+
+ const token = getCookie("session");
+ const { data, status, error, refetch } = useQuery("getUsersNotebooks", () =>
+ fetchNotebooks(token)
+ );
+
+ const router = useRouter();
+
+ async function deleteNotebook(id) {
+ if (window.confirm("Do you really want to delete this notebook?")) {
+ const res = await fetch(`/api/v1/note/${id}/delete`).then((res) =>
+ res.json()
+ );
+ console.log(res);
+ refetch();
+ }
+ }
+
+ return (
+ <>
+
+
+
+
+ {t("notebooks")}
+
+
+ {t("notebooks_description")}
+
+
+
+
+ >
+ );
+}
diff --git a/apps/client/pages/notebook/new.js b/apps/client/pages/notebook/new.tsx
similarity index 74%
rename from apps/client/pages/notebook/new.js
rename to apps/client/pages/notebook/new.tsx
index bb0b6b70c..803d009bf 100644
--- a/apps/client/pages/notebook/new.js
+++ b/apps/client/pages/notebook/new.tsx
@@ -13,7 +13,7 @@ import useTranslation from "next-translate/useTranslation";
export default function ViewNoteBook() {
const [value, setValue] = useState("");
- const [title, setTitle] = useState("Markdown Test");
+ const [title, setTitle] = useState("");
const { t } = useTranslation("peppermint");
@@ -60,29 +60,28 @@ export default function ViewNoteBook() {
return (
-
-
+
-
+
@@ -126,16 +125,6 @@ export default function ViewNoteBook() {
-
-
-
-
);