Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.pnp.js

# testing
/coverage
coverage/

# production
/build
Expand Down
4 changes: 3 additions & 1 deletion contributors/src/components/donator-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export default function DonatorSection() {

{!isError && donators && (
<Group gap="xs">
{donators?.map(contributor => <GithubAvatar key={contributor} login={contributor} />)}
{donators?.map(contributor => (
<GithubAvatar key={contributor} login={contributor} />
))}
</Group>
)}
</RMSectionBody>
Expand Down
4,002 changes: 1,995 additions & 2,007 deletions package-lock.json

Large diffs are not rendered by default.

39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,48 @@
},
"license": "GPL-3.0-only",
"dependencies": {
"@mantine/core": "^8.0.0",
"@mantine/hooks": "^8.0.0",
"@railmapgen/mantine-components": "^0.1.15",
"@mantine/core": "^8.1.3",
"@mantine/hooks": "^8.1.3",
"@railmapgen/mantine-components": "^0.1.25",
"@railmapgen/rmg-runtime": "^12.0.2",
"@railmapgen/rmg-translate": "^3.4.1",
"@reduxjs/toolkit": "^2.8.1",
"@reduxjs/toolkit": "^2.8.2",
"clsx": "^2.1.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-i18next": "^15.5.1",
"react-i18next": "^15.6.0",
"react-icons": "^5.5.0",
"react-redux": "^9.2.0",
"react-router-dom": "^7.6.0"
"react-router-dom": "^7.7.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.26.0",
"@eslint/js": "^9.31.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/react": "^19.1.3",
"@types/react-dom": "^19.1.3",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react": "^4.4.1",
"eslint": "^9.26.0",
"eslint-plugin-prettier": "^5.4.0",
"@vitejs/plugin-react": "^4.7.0",
"@vitest/coverage-v8": "^3.2.4",
"eslint": "^9.31.0",
"eslint-plugin-prettier": "^5.5.3",
"eslint-plugin-react": "^7.37.5",
"jsdom": "^26.1.0",
"postcss": "^8.5.3",
"postcss-preset-mantine": "^1.17.0",
"postcss": "^8.5.6",
"postcss-preset-mantine": "^1.18.0",
"postcss-simple-vars": "^7.0.1",
"prettier": "^3.5.3",
"prettier": "^3.6.2",
"typescript": "^5.8.3",
"typescript-eslint": "^8.32.0",
"vite": "^6.3.5",
"vitest": "^3.1.3"
"typescript-eslint": "^8.37.0",
"vite": "^7.0.5",
"vitest": "^3.2.4"
},
"scripts": {
"dev": "vite --host",
"build": "tsc && vite build",
"test": "vitest",
"test": "vitest run --coverage",
"lint": "eslint src contributors runtime-demo",
"lint:fix": "eslint src contributors runtime-demo --fix",
"preview": "vite preview --host"
Expand Down
23 changes: 22 additions & 1 deletion src/components/menu/nav-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
MdWarning,
} from 'react-icons/md';
import clsx from 'clsx';
import { ComponentProps, ReactNode, useEffect } from 'react';
import { ComponentProps, ReactNode, useEffect, useState } from 'react';
import { fetchSaveList } from '../../redux/account/account-slice';
import useSmMediaQuery from '../hook/use-sm-media-query';

Expand All @@ -41,6 +41,8 @@ export default function NavMenu() {
const { isLoggedIn, name } = useRootSelector(state => state.account);
const dispatch = useRootDispatch();

const [showCommunityReviewAd, setShowCommunityReviewAd] = useState(true);

const smMediaQuery = useSmMediaQuery();
const [searchParams] = useSearchParams();
const prdUrl =
Expand Down Expand Up @@ -113,6 +115,25 @@ export default function NavMenu() {
</Alert>
)}

{showCommunityReviewAd && (
<Alert
color="blue"
icon="🎉"
className={classes.alert}
withCloseButton
onClose={() => setShowCommunityReviewAd(false)}
>
{t('You can now earn subscriptions through community reviews.')}{' '}
<Anchor
size="sm"
href="https://github.com/railmapgen/railmapgen.github.io/wiki/Earn-Subscriptions-Through-Community-Reviews"
target="_blank"
>
{t('More details')}
</Anchor>
</Alert>
)}

<div className={classes.body}>
<div className={classes.aside}>
{asideButtons.map(({ key, label, Icon, ActionIconProps }) => (
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/translations/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"Login success": "成功登录",
"Main languages": "主要语言",
"More": "更多",
"More details": "详细信息",
"More mirrors": "更多镜像",
"New tab": "新标签页",
"Notes: Contributors are sorted by number of commits and commit time.": "注:贡献者名单按提交次数和时间排序。",
Expand Down Expand Up @@ -100,6 +101,7 @@
"Web fonts": "网络字体",
"Welcome to Rail Map Toolkit": "欢迎使用地铁线路图工具包",
"We'll never share your email.": "我们绝不会透露您的邮箱地址。",
"You can now earn subscriptions through community reviews.": "您现在可以通过社区审核赢取订阅。",
"You cannot open multiple Rail Map Toolkit at the same time. Please close this window.": "您不能同时打开多个线路图工具包,请关闭当前窗口。",
"Your account is created successfully.": "已成功创建您的账户。",
"Your password has been reset successfully.": "已成功重置您的密码。",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/translations/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"Login success": "成功登入",
"Main languages": "主要語言",
"More": "更多",
"More details": "更多資訊",
"More mirrors": "更多鏡像",
"New tab": "新分頁",
"Notes: Contributors are sorted by number of commits and commit time.": "註:貢獻者列表按提交次數及時間排序。",
Expand Down Expand Up @@ -100,6 +101,7 @@
"Web fonts": "網絡字型",
"Welcome to Rail Map Toolkit": "歡迎使用地鐵路綫圖工具組",
"We'll never share your email.": "我們絕不會透露你的電郵地址。",
"You can now earn subscriptions through community reviews.": "即日起,你可以透過社群審核賺取訂閱。",
"You cannot open multiple Rail Map Toolkit at the same time. Please close this window.": "你不能同時開啟多個路綫圖工具組,請關閉當前視窗。",
"Your account is created successfully.": "已成功建立你的帳戶。",
"Your password has been reset successfully.": "已成功重設你的密碼。",
Expand Down
15 changes: 7 additions & 8 deletions vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/// <reference types="vitest/config" />

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { fileURLToPath } from 'node:url';
import * as path from 'node:path';
import { coverageConfigDefaults } from 'vitest/config';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -17,7 +16,7 @@ export default defineConfig({
input: {
main: path.resolve(__dirname, 'index.html'),
contributors: path.resolve(__dirname, 'contributors', 'index.html'),
demo: path.resolve(__dirname, 'runtime-demo', 'index.html')
demo: path.resolve(__dirname, 'runtime-demo', 'index.html'),
},
output: {
manualChunks: {
Expand Down Expand Up @@ -48,11 +47,11 @@ export default defineConfig({
globals: true,
environment: 'jsdom',
setupFiles: './src/setupTests.ts',
server: {
deps: {
fallbackCJS: false,
},
},
watch: false,
coverage: {
provider: 'v8',
exclude: coverageConfigDefaults.exclude,
skipFull: true,
},
},
});