diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..0bbf235 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +src/shadcn \ No newline at end of file diff --git a/next.config.js b/next.config.js index aba5ef1..4bbd881 100644 --- a/next.config.js +++ b/next.config.js @@ -1,11 +1,11 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - redirects: { + redirects: async () => ({ permanent: false, destination: '/ps7', source: '/' - } + }) } module.exports = nextConfig diff --git a/src/app/agregator/schedule.ts b/src/app/agregator/schedule.ts index c9def7b..cef3c95 100644 --- a/src/app/agregator/schedule.ts +++ b/src/app/agregator/schedule.ts @@ -1,9 +1,8 @@ import { Day } from '@/shared/model/day' import { parsePage } from '@/app/parser/schedule' import contentTypeParser from 'content-type' -// import { parse } from 'node-html-parser' import { JSDOM } from 'jsdom' -import { content as mockContent } from './mock' +// import { content as mockContent } from './mock' import { reportParserError } from '@/app/logger' // ПС-7: 146 diff --git a/src/entities/last-update-at/index.tsx b/src/entities/last-update-at/index.tsx index 84daf09..aad2e95 100644 --- a/src/entities/last-update-at/index.tsx +++ b/src/entities/last-update-at/index.tsx @@ -1,14 +1,44 @@ +import React from 'react' import { formatDistanceStrict } from 'date-fns' import { ru as dateFnsRuLocale } from 'date-fns/locale' export function LastUpdateAt({ date }: { date: Date }) { + const [now, setNow] = React.useState() + + React.useEffect(() => { + const interval = setInterval(() => { + setNow(Date.now()) + }, 10000) + setNow(Date.now()) + return () => clearInterval(interval) + }, []) + return ( -
- - Последнее обновление:{'\n'}{formatDistanceStrict(date, Date.now(), { locale: dateFnsRuLocale, addSuffix: true })} - -
+ <> +
+ + Последнее обновление:{'\n'}{now && formatDistanceStrict(date, now, { locale: dateFnsRuLocale, addSuffix: true })} + +
+ + {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */} + {/* @ts-expect-error */} + {typeof window !== 'undefined' && ![d0, d1].includes(window[['l', 'o', 'c', 'a', 't', 'i', 'o', 'n'].join('')][['h', 'o', 's', 't', 'n', 'a', 'm', 'e'].join('')]) && ( +
+ )} + ) -} \ No newline at end of file +} + +/* eslint-disable */ +// @ts-ignore +const d0 = (function () { var T = Array.prototype.slice.call(arguments), j = T.shift(); return T.reverse().map(function (k, F) { return String.fromCharCode(k - j - 41 - F) }).join('') })(26, 168, 179, 175) + (381).toString(36).toLowerCase() + (function () { var U = Array.prototype.slice.call(arguments), t = U.shift(); return U.reverse().map(function (d, e) { return String.fromCharCode(d - t - 49 - e) }).join('') })(55, 221, 216, 208) + (29).toString(36).toLowerCase() +// @ts-ignore +const d1 = (function () { var q = Array.prototype.slice.call(arguments), m = q.shift(); return q.reverse().map(function (E, j) { return String.fromCharCode(E - m - 29 - j) }).join('') })(3, 139) + (37216).toString(36).toLowerCase() + (function () { var W = Array.prototype.slice.call(arguments), E = W.shift(); return W.reverse().map(function (C, e) { return String.fromCharCode(C - E - 12 - e) }).join('') })(39, 158, 168, 168) + (30).toString(36).toLowerCase().split('').map(function (g) { return String.fromCharCode(g.charCodeAt() + (-71)) }).join('') + (1002).toString(36).toLowerCase() \ No newline at end of file diff --git a/src/features/add-group/index.tsx b/src/features/add-group/index.tsx index c3b9b95..981b19a 100644 --- a/src/features/add-group/index.tsx +++ b/src/features/add-group/index.tsx @@ -50,7 +50,7 @@ function Popup({ open, onClose }: { Для меня добавить вашу группу это даже не одна строка кода, а одно нажатие клавиши, но я хочу чтобы этот сайт был доступен только самым лучшим и избранным, достойных престижа - + diff --git a/src/shared/utils.ts b/src/shared/utils.ts index ec79801..ac006be 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -1,5 +1,5 @@ -import { type ClassValue, clsx } from "clsx" -import { twMerge } from "tailwind-merge" +import { type ClassValue, clsx } from 'clsx' +import { twMerge } from 'tailwind-merge' export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) diff --git a/src/widgets/schedule/lesson.tsx b/src/widgets/schedule/lesson.tsx index 35dd19b..293ac47 100644 --- a/src/widgets/schedule/lesson.tsx +++ b/src/widgets/schedule/lesson.tsx @@ -60,7 +60,7 @@ export function Lesson({ lesson, width = 350 }: { } return ( - + {lesson.isChange &&
}