File tree Expand file tree Collapse file tree 5 files changed +198
-15
lines changed Expand file tree Collapse file tree 5 files changed +198
-15
lines changed Original file line number Diff line number Diff line change 1717 },
1818 "dependencies" : {
1919 "@headlessui/react" : " ^1.7.3" ,
20- "@heroicons/react" : " ^ 2.0.11" ,
20+ "@heroicons/react" : " 2.0.11" ,
2121 "@next-auth/prisma-adapter" : " ^1.0.4" ,
2222 "@popperjs/core" : " ^2.11.6" ,
2323 "@prisma/client" : " ^4.4.0" ,
3232 "cross-fetch" : " ^3.1.5" ,
3333 "date-fns" : " ^2.29.3" ,
3434 "formidable" : " ^2.0.1" ,
35- "next" : " 12.3 .1" ,
35+ "next" : " 13.4 .1" ,
3636 "next-auth" : " ~4.10.3" ,
3737 "node-fetch" : " ^3.2.10" ,
3838 "react" : " 18.2.0" ,
Original file line number Diff line number Diff line change 11import clsx from 'clsx' ;
22import { useEffect , useState } from 'react' ;
33import { Document , Page , pdfjs } from 'react-pdf' ;
4- import type { PDFDocumentProxy } from 'react-pdf/node_modules/pdfjs-dist' ;
54import {
65 MagnifyingGlassMinusIcon ,
76 MagnifyingGlassPlusIcon ,
@@ -20,10 +19,6 @@ export default function ResumePdf({ url }: Props) {
2019 const [ pageWidth , setPageWidth ] = useState ( 750 ) ;
2120 const [ componentWidth , setComponentWidth ] = useState ( 780 ) ;
2221
23- const onPdfLoadSuccess = ( pdf : PDFDocumentProxy ) => {
24- setNumPages ( pdf . numPages ) ;
25- } ;
26-
2722 const onPageResize = ( ) => {
2823 setComponentWidth (
2924 document . querySelector ( '#pdfView' ) ?. getBoundingClientRect ( ) . width ?? 780 ,
@@ -44,7 +39,9 @@ export default function ResumePdf({ url }: Props) {
4439 file = { url }
4540 loading = { < Spinner display = "block" size = "lg" /> }
4641 noData = ""
47- onLoadSuccess = { onPdfLoadSuccess } >
42+ onLoadSuccess = { ( pdf ) => {
43+ setNumPages ( pdf . numPages ) ;
44+ } } >
4845 < div
4946 style = { {
5047 paddingLeft : clsx (
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export const createRouter = () => trpc.router<Context>();
4747 **/
4848export function createProtectedRouter ( ) {
4949 return createRouter ( ) . middleware ( ( { ctx, next } ) => {
50- if ( ! ctx . session || ! ctx . session . user ) {
50+ if ( ! ctx . session ? .user ) {
5151 throw new trpc . TRPCError ( { code : 'UNAUTHORIZED' } ) ;
5252 }
5353 return next ( {
Original file line number Diff line number Diff line change 2323 },
2424 "dependencies" : {
2525 "@headlessui/react" : " ^1.7.3" ,
26- "@heroicons/react" : " ^ 2.0.11" ,
26+ "@heroicons/react" : " 2.0.11" ,
2727 "clsx" : " ^1.2.1" ,
2828 "next" : " ^12.3.1" ,
2929 "tailwindcss" : " ^3.1.8"
You can’t perform that action at this time.
0 commit comments