diff --git a/ui/Kurs.Platform.Ui.Dockerfile b/ui/Kurs.Platform.Ui.Dockerfile index adf7ab15..a4040a08 100644 --- a/ui/Kurs.Platform.Ui.Dockerfile +++ b/ui/Kurs.Platform.Ui.Dockerfile @@ -8,9 +8,7 @@ ENV GENERATE_SOURCEMAP=false ENV NODE_OPTIONS=--max-old-space-size=16384 WORKDIR /app COPY package.json package-lock.json ./ -RUN npm i && \ - npm install @rollup/rollup-linux-x64-musl --save-dev && \ - npm rebuild rollup +RUN npm i COPY . . RUN npm run build -- --mode $ENV CMD ["npm", "run", "preview"] diff --git a/ui/dev-dist/sw.js b/ui/dev-dist/sw.js index 62336dc8..27397552 100644 --- a/ui/dev-dist/sw.js +++ b/ui/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.760g82pgmf" + "revision": "0.6cutt7lmseg" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/ui/package-lock.json b/ui/package-lock.json index 56182df4..0d9a4cd4 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -27,7 +27,6 @@ "@tanstack/react-table": "^8.8.5", "axios": "^1.7.9", "classnames": "^2.5.1", - "date-fns": "^4.1.0", "dayjs": "^1.11.13", "devextreme": "^23.2.11", "devextreme-react": "^23.2.11", @@ -36,7 +35,6 @@ "file-saver": "^2.0.2", "formik": "^2.4.6", "framer-motion": "^11.15.0", - "history": "^5.3.0", "jspdf": "^3.0.1", "jwt-decode": "^4.0.0", "lodash": "^4.17.21", @@ -58,7 +56,6 @@ "yup": "^1.6.1" }, "devDependencies": { - "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@tailwindcss/typography": "^0.5.15", "@types/babel__standalone": "^7.1.9", "@types/file-saver": "^2.0.7", @@ -76,7 +73,6 @@ "autoprefixer": "^10.4.14", "browserslist": "^4.25.2", "caniuse-lite": "^1.0.30001734", - "cross-env": "^7.0.3", "cssnano": "^6.0.1", "dotenv": "^16.0.3", "eslint": "^8.36.0", @@ -92,8 +88,6 @@ "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.1", "postcss": "^8.4.21", - "postcss-cli": "^11.0.0", - "postcss-nesting": "^12.0.2", "prettier": "^3.1.1", "rollup-plugin-polyfill-node": "^0.12.0", "rollup-plugin-postcss": "^4.0.2", @@ -101,7 +95,6 @@ "tailwindcss": "^3.4.17", "typescript": "^4.9.3", "vite": "^5.4.11", - "vite-plugin-dynamic-import": "^1.5.0", "vite-plugin-pwa": "^0.21.1" } }, @@ -554,17 +547,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-import-assertions": { "version": "7.26.0", "dev": true, @@ -1734,7 +1716,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "aix" @@ -1751,7 +1732,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -1768,7 +1748,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -1785,7 +1764,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -1802,7 +1780,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -1819,7 +1796,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -1836,7 +1812,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1853,7 +1828,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1870,7 +1844,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1887,7 +1860,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1904,7 +1876,6 @@ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1921,7 +1892,6 @@ "loong64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1938,7 +1908,6 @@ "mips64el" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1955,7 +1924,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1972,7 +1940,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1989,7 +1956,6 @@ "s390x" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -2006,7 +1972,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -2023,7 +1988,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "netbsd" @@ -2040,7 +2004,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "openbsd" @@ -2057,7 +2020,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "sunos" @@ -2074,7 +2036,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -2091,7 +2052,6 @@ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -2108,7 +2068,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -2939,17 +2898,6 @@ "win32" ] }, - "node_modules/@sindresorhus/merge-streams": { - "version": "2.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@surma/rollup-plugin-off-main-thread": { "version": "2.2.3", "dev": true, @@ -4442,23 +4390,6 @@ "node": ">= 6" } }, - "node_modules/cross-env": { - "version": "7.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.1" - }, - "bin": { - "cross-env": "src/bin/cross-env.js", - "cross-env-shell": "src/bin/cross-env-shell.js" - }, - "engines": { - "node": ">=10.14", - "npm": ">=6", - "yarn": ">=1" - } - }, "node_modules/cross-spawn": { "version": "7.0.6", "license": "MIT", @@ -4700,14 +4631,6 @@ "dev": true, "license": "BSD-2-Clause" }, - "node_modules/date-fns": { - "version": "4.1.0", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/kossnocorp" - } - }, "node_modules/dayjs": { "version": "1.11.13", "license": "MIT" @@ -4822,14 +4745,6 @@ "node": ">=0.4.0" } }, - "node_modules/dependency-graph": { - "version": "0.11.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/detect-node": { "version": "2.1.0", "license": "MIT" @@ -5246,11 +5161,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-module-lexer": { - "version": "1.5.4", - "dev": true, - "license": "MIT" - }, "node_modules/es-object-atoms": { "version": "1.1.1", "license": "MIT", @@ -5310,7 +5220,6 @@ "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, - "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -6291,21 +6200,6 @@ "version": "1.0.0", "license": "MIT" }, - "node_modules/fs-extra": { - "version": "11.3.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.1.tgz", - "integrity": "sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "license": "ISC" @@ -6441,17 +6335,6 @@ "node": ">= 0.4" } }, - "node_modules/get-stdin": { - "version": "9.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/get-symbol-description": { "version": "1.0.0", "dev": true, @@ -6651,13 +6534,6 @@ "version": "1.2.2", "license": "MIT" }, - "node_modules/history": { - "version": "5.3.0", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.7.6" - } - }, "node_modules/hoist-non-react-statics": { "version": "3.3.2", "license": "BSD-3-Clause", @@ -8221,89 +8097,6 @@ "node": ">=4" } }, - "node_modules/postcss-cli": { - "version": "11.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "chokidar": "^3.3.0", - "dependency-graph": "^0.11.0", - "fs-extra": "^11.0.0", - "get-stdin": "^9.0.0", - "globby": "^14.0.0", - "picocolors": "^1.0.0", - "postcss-load-config": "^5.0.0", - "postcss-reporter": "^7.0.0", - "pretty-hrtime": "^1.0.3", - "read-cache": "^1.0.0", - "slash": "^5.0.0", - "yargs": "^17.0.0" - }, - "bin": { - "postcss": "index.js" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.0.0" - } - }, - "node_modules/postcss-cli/node_modules/globby": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-14.1.0.tgz", - "integrity": "sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sindresorhus/merge-streams": "^2.1.0", - "fast-glob": "^3.3.3", - "ignore": "^7.0.3", - "path-type": "^6.0.0", - "slash": "^5.1.0", - "unicorn-magic": "^0.3.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/postcss-cli/node_modules/ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/postcss-cli/node_modules/path-type": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-6.0.0.tgz", - "integrity": "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/postcss-cli/node_modules/slash": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/postcss-colormin": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-6.1.0.tgz", @@ -8424,55 +8217,6 @@ "postcss": "^8.4.21" } }, - "node_modules/postcss-load-config": { - "version": "5.1.0", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "lilconfig": "^3.1.1", - "yaml": "^2.4.2" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "jiti": ">=1.21.0", - "postcss": ">=8.0.9", - "tsx": "^4.8.1" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - }, - "postcss": { - "optional": true - }, - "tsx": { - "optional": true - } - } - }, - "node_modules/postcss-load-config/node_modules/lilconfig": { - "version": "3.1.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, "node_modules/postcss-merge-longhand": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-6.0.5.tgz", @@ -8743,86 +8487,6 @@ "node": ">=4" } }, - "node_modules/postcss-nesting": { - "version": "12.1.5", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT-0", - "dependencies": { - "@csstools/selector-resolve-nested": "^1.1.0", - "@csstools/selector-specificity": "^3.1.1", - "postcss-selector-parser": "^6.1.0" - }, - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "postcss": "^8.4" - } - }, - "node_modules/postcss-nesting/node_modules/@csstools/selector-resolve-nested": { - "version": "1.1.0", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT-0", - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "postcss-selector-parser": "^6.0.13" - } - }, - "node_modules/postcss-nesting/node_modules/@csstools/selector-specificity": { - "version": "3.1.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT-0", - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "postcss-selector-parser": "^6.0.13" - } - }, - "node_modules/postcss-nesting/node_modules/postcss-selector-parser": { - "version": "6.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/postcss-normalize-charset": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-6.0.2.tgz", @@ -9015,25 +8679,6 @@ "postcss": "^8.4.31" } }, - "node_modules/postcss-reporter": { - "version": "7.0.5", - "dev": true, - "license": "MIT", - "dependencies": { - "picocolors": "^1.0.0", - "thenby": "^1.3.4" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, "node_modules/postcss-selector-parser": { "version": "6.0.10", "dev": true, @@ -9154,14 +8799,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pretty-hrtime": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/process-nextick-args": { "version": "2.0.1", "license": "MIT" @@ -11361,11 +10998,6 @@ "dev": true, "license": "MIT" }, - "node_modules/thenby": { - "version": "1.3.4", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/thenify": { "version": "3.3.1", "license": "MIT", @@ -11675,19 +11307,6 @@ "node": ">=4" } }, - "node_modules/unicorn-magic": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", - "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/unique-string": { "version": "2.0.0", "dev": true, @@ -11813,7 +11432,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.19.tgz", "integrity": "sha512-qO3aKv3HoQC8QKiNSTuUM1l9o/XX3+c+VTgLHbJWHZGeTPVAg2XwazI9UWzoxjIJCGCV2zU60uqMzjeLZuULqA==", "dev": true, - "license": "MIT", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", @@ -11868,17 +11486,6 @@ } } }, - "node_modules/vite-plugin-dynamic-import": { - "version": "1.6.0", - "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^8.12.1", - "es-module-lexer": "^1.5.4", - "fast-glob": "^3.3.2", - "magic-string": "^0.30.11" - } - }, "node_modules/vite-plugin-pwa": { "version": "0.21.1", "dev": true, diff --git a/ui/package.json b/ui/package.json index a81fe435..641bbfef 100644 --- a/ui/package.json +++ b/ui/package.json @@ -34,7 +34,6 @@ "@tanstack/react-table": "^8.8.5", "axios": "^1.7.9", "classnames": "^2.5.1", - "date-fns": "^4.1.0", "dayjs": "^1.11.13", "devextreme": "^23.2.11", "devextreme-react": "^23.2.11", @@ -43,7 +42,6 @@ "file-saver": "^2.0.2", "formik": "^2.4.6", "framer-motion": "^11.15.0", - "history": "^5.3.0", "jspdf": "^3.0.1", "jwt-decode": "^4.0.0", "lodash": "^4.17.21", @@ -65,7 +63,6 @@ "yup": "^1.6.1" }, "devDependencies": { - "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@tailwindcss/typography": "^0.5.15", "@types/babel__standalone": "^7.1.9", "@types/file-saver": "^2.0.7", @@ -83,7 +80,6 @@ "autoprefixer": "^10.4.14", "browserslist": "^4.25.2", "caniuse-lite": "^1.0.30001734", - "cross-env": "^7.0.3", "cssnano": "^6.0.1", "dotenv": "^16.0.3", "eslint": "^8.36.0", @@ -99,16 +95,10 @@ "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.1", "postcss": "^8.4.21", - "postcss-cli": "^11.0.0", - "postcss-nesting": "^12.0.2", "prettier": "^3.1.1", - "rollup-plugin-polyfill-node": "^0.12.0", - "rollup-plugin-postcss": "^4.0.2", - "rollup-plugin-visualizer": "^5.13.1", "tailwindcss": "^3.4.17", "typescript": "^4.9.3", "vite": "^5.4.11", - "vite-plugin-dynamic-import": "^1.5.0", "vite-plugin-pwa": "^0.21.1" }, "volta": { diff --git a/ui/postcss.config.cjs b/ui/postcss.config.cjs index 4bf59a78..4d50142f 100644 --- a/ui/postcss.config.cjs +++ b/ui/postcss.config.cjs @@ -5,9 +5,4 @@ module.exports = { autoprefixer: {}, cssnano: {}, }, -} -// require('postcss-import'), -// require('tailwindcss/nesting'), -// require('tailwindcss'), -// require('postcss-preset-env'), -// require('cssnano'), +} \ No newline at end of file diff --git a/ui/src/history.ts b/ui/src/history.ts deleted file mode 100644 index 261d8bba..00000000 --- a/ui/src/history.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as history from 'history' - -export default history.createBrowserHistory() diff --git a/ui/src/views/forum/admin/Dashboard.tsx b/ui/src/views/forum/admin/Dashboard.tsx index afb58512..53056919 100644 --- a/ui/src/views/forum/admin/Dashboard.tsx +++ b/ui/src/views/forum/admin/Dashboard.tsx @@ -1,7 +1,9 @@ import { Folder, MessageSquare, FileText, TrendingUp } from 'lucide-react' import { ForumCategory, ForumPost, ForumTopic } from '@/proxy/forum/forum' import { useLocalization } from '@/utils/hooks/useLocalization' -import { formatDistanceToNow } from 'date-fns' +import dayjs from 'dayjs' +import relativeTime from 'dayjs/plugin/relativeTime' +import 'dayjs/locale/tr' interface AdminStatsProps { categories: ForumCategory[] @@ -57,6 +59,9 @@ export function AdminStats({ categories, topics, posts }: AdminStatsProps) { const recentActivities: Activity[] = [] + dayjs.extend(relativeTime) + dayjs.locale('tr') + // Topics -> "New topic created in {categoryName}" topics.forEach((topic) => { const category = categories.find((c) => c.id === topic.categoryId) @@ -137,9 +142,7 @@ export function AdminStats({ categories, topics, posts }: AdminStatsProps) {

{activity.message}

-

- {formatDistanceToNow(activity.date, { addSuffix: true })} -

+

{dayjs(activity.date).fromNow()}

))} diff --git a/ui/src/views/public/Blog.tsx b/ui/src/views/public/Blog.tsx index ec3c77c2..9f7cad01 100644 --- a/ui/src/views/public/Blog.tsx +++ b/ui/src/views/public/Blog.tsx @@ -1,8 +1,8 @@ import React, { useEffect, useState } from 'react' import { Link } from 'react-router-dom' import { Calendar, Clock, User, Tag, Search } from 'lucide-react' -import { format } from 'date-fns' -import { tr } from 'date-fns/locale' +import dayjs from 'dayjs' +import 'dayjs/locale/tr' import { BlogCategory, BlogPost } from '@/proxy/blog/blog' import { blogService } from '@/services/blog.service' import { useLocalization } from '@/utils/hooks/useLocalization' @@ -19,6 +19,8 @@ const Blog = () => { const [currentPage, setCurrentPage] = useState(1) const [totalPages, setTotalPages] = useState(1) + dayjs.locale('tr') + useEffect(() => { loadBlogData() }, [currentPage, selectedCategory]) @@ -193,9 +195,7 @@ const Blog = () => {
- {format(new Date(post.publishedAt || post.creationTime), 'dd MMM yyyy', { - locale: tr, - })} + {dayjs(post.publishedAt || post.creationTime).format('DD MMM YYYY')}
diff --git a/ui/src/views/public/BlogDetail.tsx b/ui/src/views/public/BlogDetail.tsx index fdfad4bb..5717cd2c 100644 --- a/ui/src/views/public/BlogDetail.tsx +++ b/ui/src/views/public/BlogDetail.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react' import { Link, useParams } from 'react-router-dom' -import { format } from 'date-fns' -import { tr } from 'date-fns/locale' +import dayjs from 'dayjs' +import 'dayjs/locale/tr' import { BlogPost } from '@/proxy/blog/blog' import { blogService } from '@/services/blog.service' import { useLocalization } from '@/utils/hooks/useLocalization' @@ -28,6 +28,8 @@ const BlogDetail: React.FC = () => { const [loading, setLoading] = useState(true) const [error, setError] = useState(null) + dayjs.locale('tr') + useEffect(() => { const fetchBlogPost = async () => { setLoading(true) @@ -107,19 +109,14 @@ const BlogDetail: React.FC = () => { {postData.author?.name}
- {blogPost.publishedAt && - format(new Date(blogPost.publishedAt), 'dd MMM yyyy', { - locale: tr, - })} + {blogPost.publishedAt && dayjs(blogPost.publishedAt).format('DD MMM YYYY')}
diff --git a/ui/vite.config.ts b/ui/vite.config.ts index b2365cc3..9ad38ca3 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -1,7 +1,6 @@ import { defineConfig, loadEnv } from 'vite' import react from '@vitejs/plugin-react' import path from 'path' -import dynamicImport from 'vite-plugin-dynamic-import' import { VitePWA } from 'vite-plugin-pwa' // import { fetchTenantNames } from './src/services/tenants' @@ -21,10 +20,9 @@ export default defineConfig(async ({ mode }) => { plugins: [ react({ babel: { - plugins: ['babel-plugin-macros', '@babel/plugin-syntax-dynamic-import'], + plugins: ['babel-plugin-macros'], }, }), - dynamicImport(), VitePWA({ // Deploy'dan sonra otomatik güncelle registerType: 'autoUpdate',