Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0015d21

Browse files
committed
Translating the Donate link from React
1 parent 1fab3ad commit 0015d21

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

‎client/index.jsx‎

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { render } from 'react-dom';
33
import { Provider } from 'react-redux';
44
import { Router } from 'react-router-dom';
55

6+
import { useTranslation } from 'react-i18next';
67
import browserHistory from './browserHistory';
78
import configureStore from './store';
89
import Routing from './routes';
@@ -63,14 +64,32 @@ if (
6364
document.body.appendChild(buttonScript);
6465
}
6566

66-
const App = () => (
67-
<div>
68-
<Router history={browserHistory}>
69-
<SkipLink targetId="play-sketch" text="PlaySketch" />
70-
<Routing />
71-
</Router>
72-
</div>
73-
);
67+
const App = () => {
68+
const { t } = useTranslation();
69+
70+
setTimeout(() => {
71+
const donateButton = document.getElementsByClassName(
72+
'dbox-donation-button'
73+
)[0];
74+
75+
if (donateButton) {
76+
const donateLogoImage = document.createElement('img');
77+
donateLogoImage.src = 'https://donorbox.org/images/white_logo.svg';
78+
79+
donateButton.text = t('About.Donate');
80+
donateButton.prepend(donateLogoImage);
81+
}
82+
}, 0);
83+
84+
return (
85+
<div>
86+
<Router history={browserHistory}>
87+
<SkipLink targetId="play-sketch" text="PlaySketch" />
88+
<Routing />
89+
</Router>
90+
</div>
91+
);
92+
};
7493

7594
render(
7695
<Provider store={store}>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /