fix linting

This commit is contained in:
Anton Tranelis 2025-06-27 14:42:26 +02:00
parent 8c61dacb7c
commit d4c5ba0139
8 changed files with 18 additions and 110 deletions

View File

@ -18,7 +18,7 @@
"react-dom": "^18.2.0",
"react-rnd": "^10.4.1",
"react-router-dom": "^6.23.0",
"utopia-ui": "^3.0.110"
"utopia-ui": "^3.0.111"
},
"devDependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
@ -11438,9 +11438,9 @@
}
},
"node_modules/utopia-ui": {
"version": "3.0.110",
"resolved": "https://registry.npmjs.org/utopia-ui/-/utopia-ui-3.0.110.tgz",
"integrity": "sha512-uwcdXSsttQbCJc++ZnPPHoNfxpTiklJLGbFQISbJ27VbXS9yVIBD38En/cTzW1hZUOex2HkxFcKOfIOG8fkhRg==",
"version": "3.0.111",
"resolved": "https://registry.npmjs.org/utopia-ui/-/utopia-ui-3.0.111.tgz",
"integrity": "sha512-bUqgPCWyS3IcyegweXbRLt2SVYM9cWWLvLst9gcEaezfF4Egz4yXOq7mYmjBl+PpCt0d8EY6Tj8VhdfLxg63qg==",
"license": "GPL-3.0-only",
"dependencies": {
"@heroicons/react": "^2.0.17",
@ -11471,7 +11471,7 @@
"react-leaflet-cluster": "^2.1.0",
"react-markdown": "^9.0.1",
"react-photo-album": "^3.0.2",
"react-router-dom": "^6.16.0",
"react-router-dom": "^6.23.0",
"react-toastify": "^9.1.3",
"remark-breaks": "^4.0.0",
"tiptap-markdown": "^0.8.10",

View File

@ -19,7 +19,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-rnd": "^10.4.1",
"react-router-dom": "^6.23.0"
"react-router-dom": "^6.23.0",
"utopia-ui": "^3.0.111"
},
"devDependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",

View File

@ -7,8 +7,7 @@ import { useEffect, useState } from 'react'
import { TextView } from 'utopia-ui'
interface ChapterProps {
clickAction1?: () => void
clickAction2?: () => void
clickAction1: () => void
map?: any
}

View File

@ -1,98 +0,0 @@
/* eslint-disable import/default */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/24/outline'
import {
add,
eachDayOfInterval,
endOfMonth,
endOfWeek,
format,
getDay,
isSameMonth,
isToday,
parse,
startOfToday,
startOfWeek,
} from 'date-fns'
import React, { useState } from 'react'
import { MapOverlayPage } from 'utopia-ui'
export const Calendar = () => {
const today = startOfToday()
const days = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']
const colStartClasses = [
'',
'col-start-2',
'col-start-3',
'col-start-4',
'col-start-5',
'col-start-6',
'col-start-7',
]
const [currMonth, setCurrMonth] = useState(() => format(today, 'MMM-yyyy'))
const firstDayOfMonth = parse(currMonth, 'MMM-yyyy', new Date())
const daysInMonth = eachDayOfInterval({
start: startOfWeek(firstDayOfMonth),
end: endOfWeek(endOfMonth(firstDayOfMonth)),
})
const getPrevMonth = (event: React.MouseEvent<SVGSVGElement>) => {
event.preventDefault()
const firstDayOfPrevMonth = add(firstDayOfMonth, { months: -1 })
setCurrMonth(format(firstDayOfPrevMonth, 'MMM-yyyy'))
}
const getNextMonth = (event: React.MouseEvent<SVGSVGElement>) => {
event.preventDefault()
const firstDayOfNextMonth = add(firstDayOfMonth, { months: 1 })
setCurrMonth(format(firstDayOfNextMonth, 'MMM-yyyy'))
}
return (
<MapOverlayPage
backdrop
className='tw-max-h-[calc(100dvh-96px)] tw-h-fit md:tw-w-[calc(50%-32px)] tw-w-[calc(100%-32px)] max-w-lg'
>
<div className='flex items-center justify-between'>
<p className='font-semibold text-xl'>{format(firstDayOfMonth, 'MMMM yyyy')}</p>
<div className='flex items-center justify-evenly gap-6 sm:gap-12'>
<ChevronLeftIcon className='w-6 h-6 cursor-pointer' onClick={getPrevMonth} />
<ChevronRightIcon className='w-6 h-6 cursor-pointer' onClick={getNextMonth} />
</div>
</div>
<hr className='my-6' />
<div className='grid grid-cols-7 gap-6 sm:gap-12 place-items-center'>
{days.map((day, idx) => {
return (
<div key={idx} className='font-semibold'>
{capitalizeFirstLetter(day)}
</div>
)
})}
</div>
<div className='grid grid-cols-7 gap-4 sm:gap-12 mt-8 place-items-center'>
{daysInMonth.map((day, idx) => {
return (
<div key={idx} className={colStartClasses[getDay(day)]}>
<p
className={`cursor-pointer flex items-center justify-center font-semibold h-8 w-8 rounded-full hover:text-white ${
isSameMonth(day, today) ? 'text-current' : 'text-gray-500'
} ${!isToday(day) && 'hover:bg-primary-content'} ${
isToday(day) && 'bg-primary text-white!'
}`}
>
{format(day, 'd')}
</p>
</div>
)
})}
</div>
</MapOverlayPage>
)
}
const capitalizeFirstLetter = (string: string) => {
return string
}

View File

@ -1,6 +1,8 @@
import { MapIcon } from '@heroicons/react/24/outline'
import { SVG } from 'utopia-ui'
import type { Route } from '#components/AppShell/SideBar'
export const routes = [
{
path: '/',
@ -43,7 +45,7 @@ export const getBottomRoutes = (currentUrl: string) => {
const url = new URL(currentUrl)
const isEmbedded = url.searchParams.get('embedded') === 'true'
const bottomRoutes = [
const bottomRoutes: Route[] = [
// Other routes can be added here
]

View File

@ -7,7 +7,6 @@
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

View File

@ -23,6 +23,7 @@ export default defineConfig({
tailwindcss(),
],
resolve: {
dedupe: ['react', 'react-dom', 'react-router-dom'],
alias: {
'utopia-ui': path.resolve(__dirname, '../lib/src'),
'#components': path.resolve(__dirname, '../lib/src/Components'),
@ -32,5 +33,8 @@ export default defineConfig({
'#src': path.resolve(__dirname, '../lib/src'),
'#root': path.resolve(__dirname, '../lib'),
}
}
},
build: {
sourcemap: true,
},
});

View File

@ -6,6 +6,7 @@
"moduleResolution": "Node",
"jsx": "react-jsx",
"esModuleInterop": true,
"skipLibCheck": true
"skipLibCheck": true,
"strictNullChecks": true,
}
}