portal: update deps

This commit is contained in:
Yangshun
2024-06-25 08:20:19 +08:00
parent 167bd5e308
commit d2fdffbace
7 changed files with 200 additions and 17 deletions

View File

@@ -17,7 +17,7 @@
},
"dependencies": {
"@headlessui/react": "^1.7.3",
"@heroicons/react": "^2.0.11",
"@heroicons/react": "2.0.11",
"@next-auth/prisma-adapter": "^1.0.4",
"@popperjs/core": "^2.11.6",
"@prisma/client": "^4.4.0",
@@ -32,7 +32,7 @@
"cross-fetch": "^3.1.5",
"date-fns": "^2.29.3",
"formidable": "^2.0.1",
"next": "12.3.1",
"next": "13.4.1",
"next-auth": "~4.10.3",
"node-fetch": "^3.2.10",
"react": "18.2.0",

View File

@@ -68,7 +68,7 @@ function ProfileJewel() {
{
href: '/api/auth/signout',
name: 'Sign Out',
onClick: (event: MouseEvent) => {
onClick: (event: React.MouseEvent<HTMLAnchorElement>) => {
event.preventDefault();
signOut();
},

View File

@@ -1,7 +1,6 @@
import clsx from 'clsx';
import { useEffect, useState } from 'react';
import { Document, Page, pdfjs } from 'react-pdf';
import type { PDFDocumentProxy } from 'react-pdf/node_modules/pdfjs-dist';
import {
MagnifyingGlassMinusIcon,
MagnifyingGlassPlusIcon,
@@ -20,10 +19,6 @@ export default function ResumePdf({ url }: Props) {
const [pageWidth, setPageWidth] = useState(750);
const [componentWidth, setComponentWidth] = useState(780);
const onPdfLoadSuccess = (pdf: PDFDocumentProxy) => {
setNumPages(pdf.numPages);
};
const onPageResize = () => {
setComponentWidth(
document.querySelector('#pdfView')?.getBoundingClientRect().width ?? 780,
@@ -44,7 +39,9 @@ export default function ResumePdf({ url }: Props) {
file={url}
loading={<Spinner display="block" size="lg" />}
noData=""
onLoadSuccess={onPdfLoadSuccess}>
onLoadSuccess={(pdf) => {
setNumPages(pdf.numPages);
}}>
<div
style={{
paddingLeft: clsx(

View File

@@ -1,5 +1,5 @@
import clsx from 'clsx';
import Image from 'next/future/image';
import Image from 'next/image';
import { useEffect, useState } from 'react';
import { Tab } from '@headlessui/react';

View File

@@ -47,7 +47,7 @@ export const createRouter = () => trpc.router<Context>();
**/
export function createProtectedRouter() {
return createRouter().middleware(({ ctx, next }) => {
if (!ctx.session || !ctx.session.user) {
if (!ctx.session?.user) {
throw new trpc.TRPCError({ code: 'UNAUTHORIZED' });
}
return next({