(
>
{label && (
+
+
+
+
+
+ {children}
+
+
+
+
)
}
diff --git a/src/app/providers.tsx b/src/app/providers.tsx
new file mode 100644
index 00000000..70c5fc44
--- /dev/null
+++ b/src/app/providers.tsx
@@ -0,0 +1,14 @@
+"use client"
+
+import * as RadixTooltip from "@radix-ui/react-tooltip"
+import { SessionProvider } from "next-auth/react"
+
+export function Providers({ children }: { children: React.ReactNode }) {
+ return (
+
+
+ {children}
+
+
+ )
+}
diff --git a/src/app/root-layout-wrapper.tsx b/src/app/root-layout-wrapper.tsx
deleted file mode 100644
index 6f646237..00000000
--- a/src/app/root-layout-wrapper.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-"use client"
-
-import Header from "@components/header"
-import Page from "@components/page"
-import { Toasts } from "@components/toasts"
-import * as RadixTooltip from "@radix-ui/react-tooltip"
-import { SessionProvider } from "next-auth/react"
-
-export function LayoutWrapper({ children }: { children: React.ReactNode }) {
- return (
-
-
-
-
-
- {children}
-
-
-
- )
-}
diff --git a/src/app/styles/markdown.css b/src/app/styles/markdown.css
index eba07531..e9bbb202 100644
--- a/src/app/styles/markdown.css
+++ b/src/app/styles/markdown.css
@@ -1,7 +1,8 @@
article {
max-width: var(--main-content);
margin: 0 auto;
- line-height: 1.9;
+ font-size: 1rem;
+ line-height: 1.55;
}
article video,
@@ -108,6 +109,7 @@ article pre {
line-height: 1.8;
padding: 1rem;
font-size: 0.875rem;
+ background-color: var(--lighter-gray);
}
table {
diff --git a/src/lib/server/prisma.ts b/src/lib/server/prisma.ts
index 87e373fd..65073619 100644
--- a/src/lib/server/prisma.ts
+++ b/src/lib/server/prisma.ts
@@ -111,11 +111,25 @@ export async function getPostsByUser(userId: User["id"], withFiles?: boolean) {
where: {
authorId: userId
},
- include: {
- files: withFiles
- },
orderBy: {
createdAt: "desc"
+ },
+ select: {
+ id: true,
+ title: true,
+ createdAt: true,
+ updatedAt: true,
+ authorId: true,
+ visibility: true,
+ ...(withFiles && {
+ files: {
+ select: {
+ id: true,
+ title: true,
+ createdAt: true,
+ }
+ }
+ })
}
})
diff --git a/src/package.json b/src/package.json
index e944965e..a291a40b 100644
--- a/src/package.json
+++ b/src/package.json
@@ -38,7 +38,8 @@
"react-hot-toast": "2.4.0-beta.0",
"server-only": "^0.0.1",
"textarea-markdown-editor": "1.0.4",
- "ts-jest": "^29.0.3"
+ "ts-jest": "^29.0.3",
+ "uuid": "^9.0.0"
},
"devDependencies": {
"@next/bundle-analyzer": "13.0.7-canary.4",
@@ -48,6 +49,7 @@
"@types/react": "18.0.9",
"@types/react-datepicker": "4.4.1",
"@types/react-dom": "18.0.3",
+ "@types/uuid": "^9.0.0",
"clsx": "^1.2.1",
"cross-env": "7.0.3",
"csstype": "^3.1.1",
diff --git a/src/pnpm-lock.yaml b/src/pnpm-lock.yaml
index 24a800a7..bb166cfb 100644
--- a/src/pnpm-lock.yaml
+++ b/src/pnpm-lock.yaml
@@ -16,6 +16,7 @@ specifiers:
'@types/react': 18.0.9
'@types/react-datepicker': 4.4.1
'@types/react-dom': 18.0.3
+ '@types/uuid': ^9.0.0
'@wcj/markdown-to-html': ^2.1.2
'@wits/next-themes': 0.2.14
client-only: ^0.0.1
@@ -44,6 +45,7 @@ specifiers:
ts-jest: ^29.0.3
typescript: 4.6.4
typescript-plugin-css-modules: 3.4.0
+ uuid: ^9.0.0
dependencies:
'@next-auth/prisma-adapter': 1.0.5_64qbzg5ec56bux2misz3l4u6g4
@@ -72,6 +74,7 @@ dependencies:
server-only: 0.0.1
textarea-markdown-editor: 1.0.4_biqbaboplfbrettd7655fr4n2y
ts-jest: 29.0.3_7hcmezpa7bajbjecov7p46z4aa
+ uuid: 9.0.0
optionalDependencies:
sharp: 0.31.2
@@ -84,6 +87,7 @@ devDependencies:
'@types/react': 18.0.9
'@types/react-datepicker': 4.4.1_biqbaboplfbrettd7655fr4n2y
'@types/react-dom': 18.0.3
+ '@types/uuid': 9.0.0
clsx: 1.2.1
cross-env: 7.0.3
csstype: 3.1.1
@@ -1581,6 +1585,10 @@ packages:
resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==}
dev: false
+ /@types/uuid/9.0.0:
+ resolution: {integrity: sha512-kr90f+ERiQtKWMz5rP32ltJ/BtULDI5RVO0uavn1HQUOwjx0R1h0rnDYNL0CepF1zL5bSY6FISAfd9tOdDhU5Q==}
+ dev: true
+
/@types/yargs-parser/21.0.0:
resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==}
dev: false
@@ -6950,6 +6958,11 @@ packages:
hasBin: true
dev: false
+ /uuid/9.0.0:
+ resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==}
+ hasBin: true
+ dev: false
+
/uvu/0.5.6:
resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==}
engines: {node: '>=8'}