Skip to content

Commit 14aaae3

Browse files
committed
#903 Remove donation modal
1 parent 888aff8 commit 14aaae3

File tree

11 files changed

+52
-263
lines changed

11 files changed

+52
-263
lines changed

src/components/page-header/about-modal.tsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ import {
1717
} from '@chakra-ui/react';
1818
import rmgRuntime from '@railmapgen/rmg-runtime';
1919
import { useTranslation } from 'react-i18next';
20+
import AfdianIcon from '../../images/afdian.png';
2021
import GithubIcon from '../../images/github-mark.svg';
22+
import OpenCollectiveIcon from '../../images/opencollective-icon.webp';
2123
import SlackIcon from '../../images/slack-mark.svg';
2224

2325
const AboutModal = (props: { isOpen: boolean; onClose: () => void }) => {
@@ -191,6 +193,41 @@ const AboutModal = (props: { isOpen: boolean; onClose: () => void }) => {
191193
</TagLabel>
192194
</Tag>
193195
</VStack>
196+
197+
<Heading as="h5" size="sm" mt={3} mb={2}>
198+
{t('header.donation.title')}
199+
</Heading>
200+
201+
<VStack>
202+
<Tag
203+
size="lg"
204+
w="85%"
205+
onClick={() => window.open('https://afdian.com/a/rail-map-toolkit', '_blank')}
206+
cursor="pointer"
207+
>
208+
<Avatar src={AfdianIcon} size="lg" my={2} ml={-1} mr={2} />
209+
<TagLabel display="block" width="100%" pb={1}>
210+
<Text fontSize="lg" fontWeight="bold" mb={1}>
211+
{t('header.donation.afdian')}
212+
</Text>
213+
<Text fontSize="sm">{t('header.donation.viaCNY')}</Text>
214+
</TagLabel>
215+
</Tag>
216+
<Tag
217+
size="lg"
218+
w="85%"
219+
onClick={() => window.open('https://opencollective.com/rail-map-toolkit', '_blank')}
220+
cursor="pointer"
221+
>
222+
<Avatar src={OpenCollectiveIcon} size="lg" my={2} ml={-1} mr={2} />
223+
<TagLabel display="block" width="100%" pb={1}>
224+
<Text fontSize="lg" fontWeight="bold" mb={1}>
225+
{t('header.donation.openCollective')}
226+
</Text>
227+
<Text fontSize="sm">{t('header.donation.viaUSD')}</Text>
228+
</TagLabel>
229+
</Tag>
230+
</VStack>
194231
</ModalBody>
195232
</ModalContent>
196233
</Modal>

src/components/page-header/donation-modal.tsx

Lines changed: 0 additions & 166 deletions
This file was deleted.

src/components/page-header/window-header.tsx

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import rmgRuntime, { RmgEnv } from '@railmapgen/rmg-runtime';
44
import { LANGUAGE_NAMES, LanguageCode } from '@railmapgen/rmg-translate';
55
import React from 'react';
66
import { Trans, useTranslation } from 'react-i18next';
7-
import { IoMdHeart } from 'react-icons/io';
87
import { MdHelp, MdRedo, MdSettings, MdTranslate, MdUndo } from 'react-icons/md';
98
import { Events } from '../../constants/constants';
109
import { useRootDispatch, useRootSelector } from '../../redux';
1110
import { redoAction, undoAction } from '../../redux/param/param-slice';
12-
import { refreshEdgesThunk, refreshNodesThunk, setIsDonationModalOpen } from '../../redux/runtime/runtime-slice';
11+
import { refreshEdgesThunk, refreshNodesThunk } from '../../redux/runtime/runtime-slice';
1312
import AboutModal from './about-modal';
14-
import DonationModal from './donation-modal';
1513
import DownloadActions from './download-actions';
1614
import OpenActions from './open-actions';
1715
import { SearchPopover } from './search-popover';
@@ -22,7 +20,6 @@ export default function WindowHeader() {
2220
const { t } = useTranslation();
2321
const dispatch = useRootDispatch();
2422
const { past, future } = useRootSelector(state => state.param);
25-
const { isDonationModalOpen } = useRootSelector(state => state.runtime);
2623
const isAllowAppTelemetry = rmgRuntime.isAllowAnalytics();
2724

2825
const [isSettingsModalOpen, setIsSettingsModalOpen] = React.useState(false);
@@ -128,17 +125,6 @@ export default function WindowHeader() {
128125
</WrapItem>
129126
)}
130127

131-
<WrapItem>
132-
<IconButton
133-
size="sm"
134-
variant="ghost"
135-
aria-label="Donation"
136-
color="red"
137-
icon={<IoMdHeart />}
138-
onClick={() => dispatch(setIsDonationModalOpen(true))}
139-
/>
140-
</WrapItem>
141-
142128
<WrapItem>
143129
<IconButton
144130
size="sm"
@@ -160,7 +146,6 @@ export default function WindowHeader() {
160146
</WrapItem>
161147
</Wrap>
162148

163-
<DonationModal isOpen={isDonationModalOpen} onClose={() => dispatch(setIsDonationModalOpen(false))} />
164149
<SettingsModal isOpen={isSettingsModalOpen} onClose={() => setIsSettingsModalOpen(false)} />
165150
<AboutModal isOpen={isAboutModalOpen} onClose={() => setIsAboutModalOpen(false)} />
166151
</RmgWindowHeader>

src/components/panels/tools/tools.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@ import {
1919
import React from 'react';
2020
import { useTranslation } from 'react-i18next';
2121
import { IconContext } from 'react-icons';
22-
import { IoMdHeart } from 'react-icons/io';
2322
import { MdCode, MdExpandLess, MdExpandMore, MdOpenInNew } from 'react-icons/md';
2423
import { LinePathType } from '../../../constants/lines';
2524
import { MAX_MASTER_NODE_FREE } from '../../../constants/master';
2625
import { MiscNodeType } from '../../../constants/nodes';
2726
import { StationType } from '../../../constants/stations';
2827
import { useRootDispatch, useRootSelector } from '../../../redux';
2928
import { setToolsPanelExpansion } from '../../../redux/app/app-slice';
30-
import { openPaletteAppClip, setIsDonationModalOpen, setMode, setTheme } from '../../../redux/runtime/runtime-slice';
29+
import { openPaletteAppClip, setMode, setTheme } from '../../../redux/runtime/runtime-slice';
3130
import { linePaths } from '../../svgs/lines/lines';
3231
import miscNodes from '../../svgs/nodes/misc-nodes';
3332
import stations from '../../svgs/stations/stations';
@@ -281,7 +280,6 @@ export default ToolsPanel;
281280
export const LearnHowToAdd = (props: { type: 'station' | 'misc-node' | 'line'; expand: boolean }) => {
282281
const { type, expand } = props;
283282
const { t } = useTranslation();
284-
const dispatch = useRootDispatch();
285283

286284
const doc = type === 'misc-node' ? 'nodes' : type === 'station' ? 'stations' : 'line-styles';
287285
const fontSize = type === 'line' ? 'xs' : undefined;
@@ -304,14 +302,6 @@ export const LearnHowToAdd = (props: { type: 'station' | 'misc-node' | 'line'; e
304302
{t(`panel.tools.learnHowToAdd.${type}`)}
305303
</Link>
306304
<Icon as={MdOpenInNew} color="teal.500" mr="auto" />
307-
<Link color="teal.500" onClick={() => dispatch(setIsDonationModalOpen(true))} isExternal>
308-
{t('panel.tools.learnHowToAdd.donate')}
309-
</Link>
310-
{type !== 'line' && (
311-
<IconContext.Provider value={{ style: { padding: 5 }, color: 'red', size }}>
312-
<IoMdHeart />
313-
</IconContext.Provider>
314-
)}
315305
</>
316306
)}
317307
</HStack>

src/constants/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ export enum Events {
115115
IMPORT_WORK_FROM_GALLERY = 'IMPORT_WORK_FROM_GALLERY',
116116
DOWNLOAD_PARAM = 'DOWNLOAD_PARAM',
117117
DOWNLOAD_IMAGES = 'DOWNLOAD_IMAGES',
118-
OPEN_DONATION = 'OPEN_DONATION',
119118
LOAD_TUTORIAL = 'LOAD_TUTORIAL',
120119
}
121120

src/i18n/translations/en.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
"learnHowToAdd": {
2121
"station": "Learn how to add your stations!",
2222
"misc-node": "Learn how to add your nodes!",
23-
"line": "Learn how to add your line styles!",
24-
"donate": "Or Donate!"
23+
"line": "Learn how to add your line styles!"
2524
}
2625
},
2726
"details": {
@@ -510,15 +509,6 @@
510509
},
511510
"donation": {
512511
"title": "Donation",
513-
"content": "Your support means the world to us! By donating, you enable us to continue our work and provide this free to everyone. Choose from our exciting reward options and make a difference today!",
514-
"rewards": "Rewards",
515-
"gallery": "Your fantasy works in Gallery",
516-
"galleryContent": "Upload your fantasy works and display them in Gallery.",
517-
"nodes": "Stations and miscellaneous nodes",
518-
"nodesContent": "Request to add stations and miscellaneous nodes.",
519-
"features": "Features requests",
520-
"featuresContent": "Request to add new features.",
521-
"methods": "Donation Methods",
522512
"openCollective": "Open Collective",
523513
"viaUSD": "Donate in USD via Paypal or Visa card.",
524514
"afdian": "爱发电",

src/i18n/translations/ja.json

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
"learnHowToAdd": {
2323
"station": "駅を追加する方法を学ぶ!",
2424
"misc-node": "節点を追加する方法を学ぶ!",
25-
"line": "路線風格を追加する方法を学ぶ!",
26-
"donate": "または寄付する!"
25+
"line": "路線風格を追加する方法を学ぶ!"
2726
}
2827
},
2928
"details": {
@@ -510,19 +509,10 @@
510509
},
511510
"donation": {
512511
"title": "寄付",
513-
"content": "あなたのサポートは私たちにとって非常に重要です! 寄付することで、私たちは活動を続け、誰にでも無料で提供できるようになります。 エキサイティングなリワードオプションから選んで、今日違いをつけてください!",
514-
"rewards": "リワード",
515-
"gallery": "ギャラリー内のあなたの幻想作品",
516-
"galleryContent": "あなたの幻想作品をアップロードして、ギャラリーに表示します。",
517-
"nodes": "駅とその他の節点",
518-
"nodesContent": "駅とその他の節点の追加をリクエストします。",
519-
"features": "機能リクエスト",
520-
"featuresContent": "新しい機能の追加をリクエストします。",
521-
"methods": "寄付方法",
522512
"openCollective": "Open Collective",
523-
"viaUSD": "PaypalまたはVisaカードを使用してUSDで寄付する",
513+
"viaUSD": "PaypalまたはVisaカードを使用してドルで寄付する",
524514
"afdian": "爱发电",
525-
"viaCNY": "AlipayまたはWechat Payを使用してCNYで寄付する"
515+
"viaCNY": "AlipayまたはWechat Payを使用して人民元で寄付する"
526516
},
527517
"settings": {
528518
"title": "設定",

0 commit comments

Comments
 (0)